diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-02 01:30:54 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-02 01:36:54 +0200 |
commit | fb65477edad1170a5177c3fd8a371a134e28f5df (patch) | |
tree | 1452fde3cf642b73166ece766fd4aee9da12b9ee /main/py-requests-oauthlib | |
parent | a023ff32ccea62ac0fdaa5f4ccee7c02f5b3e2a9 (diff) | |
download | aports-fb65477edad1170a5177c3fd8a371a134e28f5df.tar.bz2 aports-fb65477edad1170a5177c3fd8a371a134e28f5df.tar.xz |
main/py-requests-oauthlib: add py2/py3 subpackages
Diffstat (limited to 'main/py-requests-oauthlib')
-rw-r--r-- | main/py-requests-oauthlib/APKBUILD | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/main/py-requests-oauthlib/APKBUILD b/main/py-requests-oauthlib/APKBUILD index fc3d12b708..5c281ef113 100644 --- a/main/py-requests-oauthlib/APKBUILD +++ b/main/py-requests-oauthlib/APKBUILD @@ -7,32 +7,41 @@ pkgdesc="First-class OAuth library support for Requests" url="https://pypi.python.org/pypi/requests-oauthlib" arch="noarch" license="GPL" -depends="python3 py-requests py-oauthlib" -depends_dev="" -makedepends="python3-dev py-setuptools" -install="" -subpackages="" +depends="py-oauthlib py-requests" +makedepends="python2-dev python3-dev py-setuptools" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" - -_builddir="$srcdir"/$_pkgname-$pkgver -prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done -} +builddir="$srcdir/$_pkgname-$pkgver" build() { - cd "$_builddir" + cd "$builddir" + python2 setup.py build || return 1 python3 setup.py build || return 1 } package() { - cd "$_builddir" - python3 setup.py install --prefix=/usr --root="$pkgdir" || return 1 + mkdir -p "$pkgdir" +} + +_py2() { + depends="${depends//py-/py2-}" + _py python2 +} + +_py3() { + replaces="$pkgname" + depends="${depends//py-/py3-}" + _py python3 +} + +_py() { + local python="$1" + pkgdesc="$pkgdesc (for $python)" + depends="$depends $python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" } md5sums="f770e7313035ecad1edd10ce50d1caec requests-oauthlib-0.7.0.tar.gz" |