aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-07-27 11:59:02 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-07-27 11:59:02 +0000
commit3fbeb433d001c4fd1147587100c88bc96c3e7477 (patch)
tree397e65e248f5ca50e2a48966f0d69fa966e7fef2 /community
parent8022f7914678080337be8cd052d39cd007c8e960 (diff)
downloadaports-3fbeb433d001c4fd1147587100c88bc96c3e7477.tar.bz2
aports-3fbeb433d001c4fd1147587100c88bc96c3e7477.tar.xz
community/py-cparser: improved APKBUILD
Diffstat (limited to 'community')
-rw-r--r--community/py-cparser/APKBUILD46
1 files changed, 26 insertions, 20 deletions
diff --git a/community/py-cparser/APKBUILD b/community/py-cparser/APKBUILD
index a1b2271e17..c2ce5efb9c 100644
--- a/community/py-cparser/APKBUILD
+++ b/community/py-cparser/APKBUILD
@@ -2,37 +2,43 @@
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=py-cparser
pkgver=2.14
-pkgrel=0
+pkgrel=1
pkgdesc="a C parser written in Python"
url="https://github.com/eliben/pycparser"
arch="noarch"
license="BSD"
-depends="python"
-depends_dev=""
-makedepends="python-dev py-setuptools"
+depends=""
+makedepends="python-dev python3-dev py-setuptools"
install=""
-subpackages=""
+subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
source="https://files.pythonhosted.org/packages/source/p/pycparser/pycparser-$pkgver.tar.gz"
-
-_builddir="$srcdir"/pycparser-$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"/pycparser-$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"
+}
+
+_py() {
+ local python=$1
+ pkgdesc="$pkgdesc - $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+_py2() {
+ _py python2
+ replaces="$pkgname"
+}
+
+_py3() {
+ _py python3
}
md5sums="a2bc8d28c923b4fe2b2c3b4b51a4f935 pycparser-2.14.tar.gz"