1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 02:35:23 +03:00
aports/community/py3-twisted/APKBUILD

78 lines
2.5 KiB
Text

# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-twisted
pkgver=21.2.0
pkgrel=0
pkgdesc="Asynchronous networking framework written in Python3"
url="http://twistedmatrix.com/"
arch="all"
license="MIT"
depends="python3 py3-cryptography py3-zope-interface py3-constantly py3-incremental py3-attrs
py3-pyhamcrest py3-hyperlink py3-automat py3-service_identity py3-idna"
makedepends="libtirpc-dev py3-setuptools python3-dev cython"
checkdepends="xvfb-run py3-appdirs tzdata py3-asn1 py3-bcrypt"
subpackages="$pkgname-doc"
source="https://github.com/twisted/twisted/archive/twisted-$pkgver.tar.gz
disable-test-missing-ckeygen.patch
skip-failing-test.patch
"
builddir="$srcdir"/twisted-twisted-$pkgver
replaces="py-twisted" # Backwards compatibility
provides="py-twisted=$pkgver-r$pkgrel" # Backwards compatibility
case "$CARCH" in
s390x) options="$options !check" # Builders don't have IPV6 ;;
esac
# secfixes:
# 20.3.0-r0:
# - CVE-2020-10108
# - CVE-2020-10109
# 19.10.0-r0:
# - CVE-2019-9512
# - CVE-2019-9514
# - CVE-2019-9515
# 19.7.0-r0:
# - CVE-2019-12387
# - CVE-2019-12855
# 16.4.0-r0:
# - CVE-2016-1000111
prepare() {
default_prepare
# Remove tests that always fail due to our not-upstream testing procedure
# these tests if invoking the Twisted binary and twisted.trial tests work
rm -f src/twisted/test/test_main.py
}
build() {
find -name '*.pyx' -exec cython {} \;
CFLAGS="$CFLAGS $(pkgconf --cflags libtirpc)" python3 setup.py build
}
check() {
PYTHONPATH="$(echo $PWD/build/lib*)" xvfb-run python3 \
-c 'from twisted.scripts.trial import run; run()' twisted
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
# Do not remove the test as it is a legitimate module and not
# a (common) packaging mistake by upstream
# rm -rf "$pkgdir"/usr/lib/python3*/site-packages/twisted/test
_mans="pyhtmlizer.1 trial.1 twistd.1"
for _man in $_mans; do
install -m644 -D "$builddir"/docs/core/man/$_man \
"$pkgdir"/usr/share/man/man1/$_man
done
}
doc() {
replaces="py-twisted-doc" # Backwards compatibility
default_doc
}
sha512sums="fa743dcf22f3c17dfd17f39b7df0cc31fb8ce3e989478ada9a026424ec2de35e6a403ef35acdef5905eed008d42e3c2fee6b7ccdda433e6c250f1feaa83ea8a4 twisted-21.2.0.tar.gz
a39c0f6615699bfbed13411cc6990756ce0e25dcd9d21dfce83b130ab8d0adeeb1e7fca1577732b02c886da52eeddd121987f861418ad85f93907e5a47bfcf02 disable-test-missing-ckeygen.patch
0e2079a3d2790513b14de8803f42592ca638d0d9911ced0a60313efcdee41a9a159840aa9312cbc1bad6469a73aa706ca2f5a076952ad072158eca0a7664cdf9 skip-failing-test.patch"