aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-07-18 13:50:14 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-07-18 13:50:14 +0000
commit93c671d6bd3c9bf33950566f878e8e6a8869cf35 (patch)
treed814c598b2eb5cab1a3cd25a4995cca87a798fe2
parent752cdf6d25afaef19248e7def025704d2ebc8dc8 (diff)
downloadaports-93c671d6bd3c9bf33950566f878e8e6a8869cf35.tar.bz2
aports-93c671d6bd3c9bf33950566f878e8e6a8869cf35.tar.xz
main/py-chardet: added python3 support, added py2 and py3 subpacakges
-rw-r--r--main/py-chardet/APKBUILD46
1 files changed, 30 insertions, 16 deletions
diff --git a/main/py-chardet/APKBUILD b/main/py-chardet/APKBUILD
index 5d10ffa926..01e6351ca8 100644
--- a/main/py-chardet/APKBUILD
+++ b/main/py-chardet/APKBUILD
@@ -3,37 +3,51 @@
_pkgname=chardet
pkgname=py-${_pkgname}
pkgver=2.3.0
-pkgrel=0
+pkgrel=1
pkgdesc="The Universal Character Encoding Detector"
url="https://github.com/chardet/chardet/"
arch="noarch"
license="LGPL2.1"
-makedepends="python-dev py-setuptools"
+makedepends="python-dev python3-dev py-setuptools"
+subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
depends=""
source="$pkgname-$pkgver.tar.gz::https://github.com/chardet/$_pkgname/archive/${pkgver}.tar.gz"
-_builddir="${srcdir}/${_pkgname}-${pkgver}"
-
-prepare() {
- local pf
- cd "${_builddir}"
- for pf in $source; do
- case $pf in
- *.patch) msg $pf; patch -p1 -i "$srcdir"/${pf} || return 1;;
- esac
- done
-}
+builddir="${srcdir}/${_pkgname}-${pkgver}"
build() {
- cd "${_builddir}"
+ cd "$builddir"
python setup.py build || return 1
+ python3 setup.py build || return 1
}
package() {
- cd "${_builddir}"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ cd "$builddir"
+ python setup.py install --root=$pkgdir/ --optimize=1 || return 1
+ python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1
+}
+
+
+_py() {
+ local python=$1
+ pkgdesc="$pkgdesc - $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+ local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')
+
+ mkdir -p "$subpkgdir"${dir}
+ mv "$pkgdir"${dir}/* "$subpkgdir"${dir}
}
+_py2() {
+ _py python2
+ replaces="$pkgname"
+}
+
+_py3() {
+ _py python3
+}
+
+
md5sums="1ce646cc083a7bb07398588db5b90043 py-chardet-2.3.0.tar.gz"
sha256sums="afb95679fb687fad167a714d929d033e3dd0d64b66d3646eecf117d350ae40cc py-chardet-2.3.0.tar.gz"
sha512sums="37f825e764754c9c697125b1faa604f92d49d578a44b5d1787c2c7cfcac73e161a371424bbaa3e692982bc7495b7a35b146e098d5069ae0e0edbd894ecacccd9 py-chardet-2.3.0.tar.gz"