summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3626c31d7e03b02c6d9509135b6382c0ea811008 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Maintainer: Tom Krizek <tkrizek@isc.org>

pkgname=python-dnspython-git
_pkgname=dnspython
pkgver=v2.1.0.r541.ef6cf0b6
pkgrel=1
pkgdesc="A DNS toolkit for Python"
arch=('any')
url="http://www.dnspython.org"
license=('custom:ISC')
depends=('python')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
makedepends=(
    'python-setuptools'
    # 'cython'  # uncomment dep & build option for cython optimization speedup
)
checkdepends=('python-idna' 'python-cryptography' 'python-trio' 'python-pytest')
optdepends=('python-cryptography: DNSSEC support'
            'python-httpx: DNS-over-HTTPS support'
            'python-h2: DNS-over-HTTPS support'
            'python-idna: support for updated IDNA 2008'
            'python-trio: async support'
            'python-sniffio: async support')
source=("${_pkgname}::git+https://github.com/rthalley/${_pkgname}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${_pkgname}"
    printf "%s" "$(git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

build() {
    cd "${srcdir}/${_pkgname}"

    python setup.py build  # --cython-compile
}

check() {
    cd "${srcdir}/${_pkgname}"

    # https://github.com/rthalley/dnspython/issues/622
    pytest -k 'not test_unpickle'
}

package() {
    cd "${srcdir}/${_pkgname}"

    python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE"
}