diff options
Diffstat (limited to 'community/py-rfc3339/APKBUILD')
-rw-r--r-- | community/py-rfc3339/APKBUILD | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/community/py-rfc3339/APKBUILD b/community/py-rfc3339/APKBUILD index 39af7f2c28..1e5b609b08 100644 --- a/community/py-rfc3339/APKBUILD +++ b/community/py-rfc3339/APKBUILD @@ -1,6 +1,7 @@ # Contributor: Carlo Landmeter <clandmeter@gmail.com> # Maintainer: pkgname=py-rfc3339 +_pkgname=pyRFC3339 pkgver=1.0 pkgrel=0 pkgdesc="Generate and parse RFC 3339 timestamps" @@ -8,32 +9,41 @@ url="https://pypi.python.org/pypi/pyRFC3339" arch="noarch" license="MIT" depends="py-tz" -depends_dev="" -makedepends="$depends_dev py-setuptools" -install="" -subpackages="" -source="https://files.pythonhosted.org/packages/source/p/pyRFC3339/pyRFC3339-$pkgver.tar.gz" - -_builddir="$srcdir"/pyRFC3339-$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 -} +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" build() { - cd "$_builddir" - python setup.py build || return 1 + cd "$builddir" + + python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$_builddir" - python setup.py install --prefix=/usr --root="$pkgdir" || return 1 + mkdir -p "$pkgdir" +} + +_py2() { + replaces="$pkgname" + depends="${depends//py-/py2-}" + _py python2 +} + +_py3() { + 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="0f7edd7ffd756a582eeef9282fecb60d pyRFC3339-1.0.tar.gz" |