core/python-hyperlink/PKGBUILD
2017-08-15 21:59:36 +02:00

52 lines
1.5 KiB
Bash

# Arch Contributor: Felix Yan <felixonmars@archlinux.org>
pkgbase=python-hyperlink
pkgname=('python3-hyperlink' 'python2-hyperlink')
pkgver=17.3.0
pkgrel=1
pkgdesc='A featureful, correct URL for Python'
arch=('any')
license=('BSD')
url='https://github.com/python-hyper/hyperlink'
makedepends=('python3-setuptools' 'python2-setuptools')
checkdepends=('python3-pytest-runner' 'python2-pytest-runner')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/python-hyper/hyperlink/archive/v$pkgver.tar.gz")
sha512sums=('8ad7efaf977018ac2524b39e1c96878df85789532c2e85b0cbd69e86c330285070428be1e64545e6b273dd331142b27f915e5186fc12b3b4c59013e123c69531')
prepare() {
cp -a hyperlink-$pkgver{,-py2}
}
build() {
cd "$srcdir"/hyperlink-$pkgver
python3 setup.py build
cd "$srcdir"/hyperlink-$pkgver-py2
python2 setup.py build
}
check() {
# fail check AssertionError: _ExpectedException not raised and missing __init__.py
cd "$srcdir"/hyperlink-$pkgver
python setup.py pytest || msg "Failed"
cd "$srcdir"/hyperlink-$pkgver-py2
python2 setup.py pytest || msg "Failed"
}
package_python3-hyperlink() {
depends=('python3')
cd hyperlink-$pkgver
python3 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-hyperlink() {
depends=('python2')
cd hyperlink-$pkgver-py2
python2 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}