aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-udev/APKBUILD
diff options
context:
space:
mode:
authorLuca Weiss <luca@z3ntu.xyz>2017-09-25 13:52:56 +0200
committerTimo Teräs <timo.teras@iki.fi>2017-09-27 05:47:25 +0000
commit1569859fd53de7ba210ec19fc10d42c6a1bcaf59 (patch)
tree9cd520423a887c6fc848f2ba60d994251f82c06c /community/py-udev/APKBUILD
parent6fa2ccf5313047113fe614e441aa43947d612d42 (diff)
downloadaports-1569859fd53de7ba210ec19fc10d42c6a1bcaf59.tar.gz
aports-1569859fd53de7ba210ec19fc10d42c6a1bcaf59.tar.bz2
aports-1569859fd53de7ba210ec19fc10d42c6a1bcaf59.tar.xz
community/py-udev: update to include a python3 version
[TT: bump pkgrel, modernise a bit]
Diffstat (limited to 'community/py-udev/APKBUILD')
-rw-r--r--community/py-udev/APKBUILD33
1 files changed, 27 insertions, 6 deletions
diff --git a/community/py-udev/APKBUILD b/community/py-udev/APKBUILD
index fd3e6bef59..aa3bbdb91b 100644
--- a/community/py-udev/APKBUILD
+++ b/community/py-udev/APKBUILD
@@ -1,26 +1,47 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-udev
pkgver=0.21.0
-pkgrel=0
+pkgrel=1
pkgdesc="Python bindings to libudev"
url="http://pyudev.readthedocs.org"
arch="noarch"
license="LGPLv2.1"
-depends="python2 eudev"
-makedepends="python2-dev py-setuptools"
+depends="eudev py-six"
+makedepends="python2-dev python3-dev py-setuptools"
install=""
-subpackages=""
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="py-udev-$pkgver.tar.gz::https://github.com/pyudev/pyudev/archive/v$pkgver.tar.gz"
builddir="$srcdir/pyudev-$pkgver"
build() {
cd "$builddir"
- python2 setup.py build || return 1
+ python2 setup.py build
+ python3 setup.py build
}
package() {
+ 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"
- python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
}
sha512sums="c6cc8786c69de2a07eeae39cb57e33db6ca5fea83c38fdab277070bf052c97bd053911ab08a11fe65cb56c463492111e74451801390d89dc7f00fd00e68bba19 py-udev-0.21.0.tar.gz"