Date: Thursday, January 9, 2020 @ 21:25:26 Author: dvzrv Revision: 551493
archrelease: copy trunk to community-any Added: python-aiosmtpd/repos/community-any/ python-aiosmtpd/repos/community-any/PKGBUILD (from rev 551492, python-aiosmtpd/trunk/PKGBUILD) ----------+ PKGBUILD | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) Copied: python-aiosmtpd/repos/community-any/PKGBUILD (from rev 551492, python-aiosmtpd/trunk/PKGBUILD) =================================================================== --- community-any/PKGBUILD (rev 0) +++ community-any/PKGBUILD 2020-01-09 21:25:26 UTC (rev 551493) @@ -0,0 +1,53 @@ +# Maintainer: David Runge <dv...@archlinux.org> + +_name=aiosmtpd +pkgname=python-aiosmtpd +pkgver=1.2.1 +pkgrel=1 +pkgdesc="An asyncio based SMTP server" +arch=('any') +url="https://github.com/aio-libs/aiosmtpd" +license=('Apache') +depends=('python-atpublic') +makedepends=('python-setuptools') +checkdepends=('python-pytest') +# 1.2.1 is not available on pypi +# https://github.com/aio-libs/aiosmtpd/issues/168 +source=("$pkgname-$pkgver.tar.gz::https://github.com/aio-libs/${_name}/archive/${pkgver}.tar.gz" + "$pkgname-1.2.1-fix_test_certs.patch::https://github.com/aio-libs/aiosmtpd/commit/f414dcdc0312c4cf3f3d39deb3ea7d15e89a5334.patch") +sha512sums=('be1e9f34846a354e570c67e04c0fd12e26531dccb79b9c90158b421d191e767f5e3502c6be0e9dad85f3123662e4446a424356fe9380a1ed31d81a37eae2a4a2' + '72fb10acd59b2866bd1d8a4dcb6775b0a5b13dc5be1d5286797022e6e5aa2ba7f268af4d26e8a48d3c943b3ecb9df23fac0aad9e0156e3c3f548d5109b3d2f50') + +prepare() { + mv -v "${_name}-$pkgver" "$pkgname-$pkgver" + cd "$pkgname-$pkgver" + # the certs required for testing have expired: + # https://github.com/aio-libs/aiosmtpd/issues/180 + patch -Np1 -i "../$pkgname-1.2.1-fix_test_certs.patch" +} + +build() { + cd "$pkgname-$pkgver" + python setup.py build +} + +check() { + cd "$pkgname-$pkgver" + export PYTHONPATH="build:${PYTHONPATH}" + pytest -v +} + +package() { + cd "$pkgname-$pkgver" + local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') + python setup.py install --skip-build \ + --optimize=1 \ + --prefix=/usr \ + --root="${pkgdir}" + # move examples to a non-generic location: + # https://github.com/aio-libs/aiosmtpd/issues/181 + install -vDm 644 "${pkgdir}/usr/lib/python${python_version}/site-packages/examples/"{client,server}.py \ + -t "${pkgdir}/usr/share/doc/${pkgname}/examples/" + rm -rvf "${pkgdir}/usr/lib/python${python_version}/site-packages/examples/" + install -vDm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}" +}