aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2017-11-08 13:06:59 +0100
committerSören Tempel <soeren+git@soeren-tempel.net>2017-12-01 08:57:41 +0100
commit420d75883aebbe3326b1d12d582e916986af8d16 (patch)
tree25557ec3bb12b2771d030bea60361c91fa3fe53e
parentd73571fc38347fbb95df715a455bc71a833f8d6d (diff)
downloadaports-420d75883aebbe3326b1d12d582e916986af8d16.tar.gz
aports-420d75883aebbe3326b1d12d582e916986af8d16.tar.bz2
aports-420d75883aebbe3326b1d12d582e916986af8d16.tar.xz
community/py-crcmod: split into py3- and py2- subpackage
-rw-r--r--community/py-crcmod/APKBUILD48
1 files changed, 29 insertions, 19 deletions
diff --git a/community/py-crcmod/APKBUILD b/community/py-crcmod/APKBUILD
index 211eec39ad..87317abe28 100644
--- a/community/py-crcmod/APKBUILD
+++ b/community/py-crcmod/APKBUILD
@@ -1,36 +1,46 @@
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py-crcmod
-_pkgname=crcmod
+_pkgname=${pkgname#py-}
pkgver=1.7
-pkgrel=0
+pkgrel=1
pkgdesc="Cyclic Redundancy Check (CRC) implementation in Python"
url="https://pypi.python.org/pypi/crcmod/"
arch="all"
license="MIT"
-depends="python2"
-makedepends="python2-dev"
+depends=""
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
source="https://files.pythonhosted.org/packages/source/c/$_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"
- python2 setup.py build || return 1
+ cd "$builddir"
+ python2 setup.py build
+ python3 setup.py build
}
package() {
- cd "$_builddir"
- python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 || return 1
+ mkdir -p "$pkgdir"
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr \
+ --root="$subpkgdir" --optimize=1
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_py3() {
+ _py python3
}
md5sums="2d5b92117d958dcead94f9e17f54cd32 crcmod-1.7.tar.gz"