summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authormschubert2019-01-06 21:41:50 +0100
committermschubert2019-01-06 21:41:50 +0100
commitc2790b4fa36b4684b10741b125786bddd81b5ec5 (patch)
tree6df3de5ebfeb889ede8c7cd7d74f5da20775f6f8 /PKGBUILD
parent0993f5ec91f3918564a0ee08db647ecbebc396d8 (diff)
downloadaur-c2790b4fa36b4684b10741b125786bddd81b5ec5.tar.gz
proper split pkg; add check
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD55
1 files changed, 26 insertions, 29 deletions
diff --git a/PKGBUILD b/PKGBUILD
index c5e98edebbbd..7a8e32cb4415 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,43 +1,40 @@
-# Maintainer: Kyle Meyer <kyle@kyleam.com>
-# https://github.com/kyleam/maint-aur
-
-pkgname=python-ratelimiter
-# To build and install the python 2 package as well, use the next line
-# instead of the above one.
-# pkgname=('python-ratelimiter' 'python2-ratelimiter')
-
-_libname=${pkgname/python-/}
-pkgver=1.2.0
+# Maintainer: Michael Schubert <mschu.dev at gmail>
+# Contributor: Kyle Meyer <kyle@kyleam.com> https://github.com/kyleam/maint-aur
+pkgname=(python-ratelimiter python2-ratelimiter)
+_pkgname=${pkgname#python-}
+pkgver=1.2.0.post0
pkgrel=1
pkgdesc='Simple Python module providing rate limiting'
arch=('any')
-url='https://github.com/RazerM/ratelimiter'
+url="https://github.com/RazerM/$_pkgname"
license=('Apache')
-
-source=("https://pypi.python.org/packages/29/92/20d7b661892a19680887fdd2c410a4e3bd51c90a1940dd406e46072ceb94/ratelimiter-1.2.0.tar.gz")
-md5sums=('d5b1005e39da11767d2f74b9fc1b666c')
+makedepends=('python-setuptools' 'python2-setuptools')
+checkdepends=('python2-pytest>=3.0' 'python-pytest>=3.0')
+source=("$_pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
+sha256sums=('b8dbff5bdfd922126f20cd513473cfd0d61b017cd354cb641a3d50b62897eca9')
build() {
- cd "$srcdir/$_libname-$pkgver"
-
- rm -rf ../buildpy3; mkdir ../buildpy3
- python setup.py build -b ../buildpy3
+ cd "$srcdir/$_pkgname-$pkgver"
+ # build step only copies files, same for python and python2
+ python setup.py build
+}
- ## python 2 build
- if [ ${#pkgname[@]} -eq 2 ]; then
- rm -rf ../buildpy2; mkdir ../buildpy2
- python2 setup.py build -b ../buildpy2
- fi
+check() {
+ cd "$srcdir/$_pkgname-$pkgver"
+ python setup.py test
+# python2 setup.py test # fails: asyncio not backported
}
package_python-ratelimiter() {
- cd "$srcdir/$_libname-$pkgver"
- rm -rf build; ln -s ../buildpy3 build
- python setup.py install --skip-build -O1 --root="$pkgdir"
+ depends=('python')
+
+ cd "$srcdir/$_pkgname-$pkgver"
+ python setup.py install --skip-build --prefix=/usr --root="$pkgdir" --optimize=1
}
package_python2-ratelimiter() {
- cd "$srcdir/$_libname-$pkgver"
- rm -rf build; ln -s ../buildpy2 build
- python2 setup.py install --skip-build -O1 --root="$pkgdir"
+ depends=('python2')
+
+ cd "$srcdir/$_pkgname-$pkgver"
+ python2 setup.py install --skip-build --prefix=/usr --root="$pkgdir" --optimize=1
}