diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2016-07-18 13:27:10 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2016-07-18 13:27:10 +0000 |
commit | 82b6642e3e308d401b3201de567f2e9a05891df8 (patch) | |
tree | dc5ddf97d592b9f887e1cbc0b69b4b17841fc7ac /main | |
parent | 3746f61939fc1ee58e1d3a57a99c502950d6ac89 (diff) | |
download | aports-82b6642e3e308d401b3201de567f2e9a05891df8.tar.bz2 aports-82b6642e3e308d401b3201de567f2e9a05891df8.tar.xz |
main/py-markupsafe: added support for python3, added py2 and py3 subpackages
Diffstat (limited to 'main')
-rw-r--r-- | main/py-markupsafe/APKBUILD | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/main/py-markupsafe/APKBUILD b/main/py-markupsafe/APKBUILD index 25fae115df..57ad0ae55e 100644 --- a/main/py-markupsafe/APKBUILD +++ b/main/py-markupsafe/APKBUILD @@ -6,24 +6,47 @@ pkgver=0.23 pkgrel=0 pkgdesc="Implements a XML/HTML/XHTML Markup safe string" url="https://github.com/mitsuhiko/markupsafe" -arch="all" +arch="noarch" license="BSD" -depends="python" +depends="" depends_dev="" -makedepends="python-dev py-setuptools" +makedepends="python-dev python3-dev py-setuptools" install="" -subpackages="$pkgname-dev" +subpackages="$pkgname-dev py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2" 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" + cd "$builddir" python setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$_builddir" - python setup.py install --prefix=/usr --root="$pkgdir" || return 1 + cd "$builddir" + python setup.py install --root=$pkgdir/ --optimize=1 || return 1 + python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1 +} + +_py() { + local python=$1 + pkgdesc="$pkgdesc - $python" + arch="all" + install_if="$pkgname=$pkgver-r$pkgrel $python" + local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))') + + mkdir -p "$subpkgdir"${dir} + mv "$pkgdir"${dir}/* "$subpkgdir"${dir} +} + +_py2() { + _py python2 + replaces="$pkgname" +} + +_py3() { + _py python3 } md5sums="f5ab3deee4c37cd6a922fb81e730da6e MarkupSafe-0.23.tar.gz" |