From f58147375dd0d2e2c6cd6bd757838f40b4b504d7 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Tue, 30 Aug 2016 21:29:05 +0200 Subject: main/py-lxml: add py2/py3 subpackages --- main/py-lxml/APKBUILD | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/main/py-lxml/APKBUILD b/main/py-lxml/APKBUILD index 89b9dca83d..d7f803f9e6 100644 --- a/main/py-lxml/APKBUILD +++ b/main/py-lxml/APKBUILD @@ -1,27 +1,47 @@ # Contributor: Francesco Colista +# Contributor: Jakub Jirutka # Maintainer: Francesco Colista pkgname=py-lxml _pkgname=lxml pkgver=3.6.0 -pkgrel=0 +pkgrel=1 pkgdesc="Python LXML Library" url="http://lxml.de/" -arch="all" +arch="noarch" license="BSD" depends="" -makedepends="python-dev libxml2-dev libxslt-dev py-setuptools" -install="" +makedepends="python2-dev python3-dev libxml2-dev libxslt-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" -_builddir="$srcdir"/$_pkgname-$pkgver build() { - cd "$_builddir" - python setup.py build || return 1 + cd "$builddir" + python2 setup.py build || return 1 + python3 setup.py build } package() { - cd "$_builddir" - python setup.py install --prefix=/usr --root="$pkgdir" || return 1 + mkdir -p "$pkgdir" +} + +_py2() { + replaces="$pkgname" + _py python2 +} + +_py3() { + _py python3 +} + +_py() { + local python="$1" + pkgdesc="$pkgdesc (for $python)" + arch="all" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" } md5sums="5957cc384bd6e83934be35c057ec03b6 lxml-3.6.0.tar.gz" -- cgit v1.2.3