Mail archive
alpine-aports

[alpine-aports] [PATCH 3/7] main/py-ukcodeparser: new APKBUILD

From: Drew DeVault <sir_at_cmpwn.com>
Date: Wed, 6 Mar 2019 14:01:24 -0700

---
 main/py-ukpostcodeparser/APKBUILD | 57 +++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 main/py-ukpostcodeparser/APKBUILD
diff --git a/main/py-ukpostcodeparser/APKBUILD b/main/py-ukpostcodeparser/APKBUILD
new file mode 100644
index 0000000000..6cd72d4adb
--- /dev/null
+++ b/main/py-ukpostcodeparser/APKBUILD
_at_@ -0,0 +1,57 @@
+# Maintainer: Drew DeVault <sir_at_cmpwn.com>
+pkgname=py-ukpostcodeparser
+_pkgname=ukpostcodeparser
+pkgver=1.1.2
+pkgrel=0
+pkgdesc="UK Postcode parser"
+url=https://github.com/hamstah/ukpostcodeparser
+arch=noarch
+license=MIT
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+makedepends="py-setuptools"
+source="$pkgname-$pkgver.tar.gz::https://github.com/hamstah/$_pkgname/archive/v$pkgver.tar.gz"
+builddir=$srcdir/$_pkgname-$pkgver
+# tests broken upstream: https://github.com/hamstah/ukpostcodeparser/issues/8
+options="!check"
+
+prepare() {
+	cp -r "$builddir" "$builddir"-py3
+}
+
+build() {
+	cd "$builddir"
+	python2 setup.py build
+	cd "$builddir"-py3
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	python2 setup.py test
+	cd "$builddir"-py3
+	python3 setup.py test
+}
+
+package() {
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+	cd "$builddir"
+	_py python2
+}
+
+_py3() {
+	cd "$builddir"-py3
+	_py python3
+}
+
+_py() {
+	python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+	install_if="$pkgname=$pkgver-r$pkgrel $python"
+	$python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+sha512sums="8113522b728c095f937a9f53f21c369130e3e63c4fc3546dbea4ad1c53648742fb0e766b1254c76ee65d69dec585f1a90caa7d39ca540de1765ff5f989a702de  py-ukpostcodeparser-1.1.2.tar.gz"
-- 
2.21.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Wed Mar 06 2019 - 14:01:24 UTC