Mail archive
alpine-aports

[alpine-aports] [PATCH 2/4] main/py-httplib2: add py3 subpackages

From: Ivan Tham <pickfire_at_riseup.net>
Date: Sat, 25 Feb 2017 16:09:42 +0800

---
 main/py-httplib2/APKBUILD | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/main/py-httplib2/APKBUILD b/main/py-httplib2/APKBUILD
index aca2221..2ff97d5 100644
--- a/main/py-httplib2/APKBUILD
+++ b/main/py-httplib2/APKBUILD
_at_@ -5,30 +5,41 @@ _pkgname=httplib2
 pkgver=0.10.3
 pkgrel=0
 pkgdesc="A Python HTTP client library"
-url="https://github.com/jcgregorio/httplib2"
+url="https://github.com/httplib2/httplib2"
 arch="noarch"
 license="MIT"
-depends="python2"
-makedepends="python2-dev py-setuptools"
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-${_pkgname}:_py2 py3-${_pkgname}:_py3"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
 builddir="$srcdir/$_pkgname-$pkgver"
 
-prepare() {
-	default_prepare || return 1
-
-	cd "$builddir"
-	chmod 644 python2/${_pkgname}.egg-info/*
-}
-
 build() {
 	cd "$builddir"
 	python2 setup.py build || return 1
+	python3 setup.py build || return 1
 }
 
 package() {
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+	replaces="$pkgname"
+	_py python2
+}
+
+_py3() {
+	_py python3
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+	install_if="$pkgname=$pkgver-r$pkgrel $python"
+
 	cd "$builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
-	chmod o+r $pkgdir/usr/lib/python2.7/site-packages/httplib2/cacerts.txt
+	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
 sha512sums="d024986ffd577858017d7a8cfcae98a6cd04b8c89634ea302df4c1443eb2381cecca6ffbb631c9d4260335a3462df6d5604ec485aa591a05cb0231a3f6745aaa  httplib2-0.10.3.tar.gz"
-- 
2.11.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sat Feb 25 2017 - 16:09:42 GMT