[arch-commits] Commit in python-cchardet/trunk (PKGBUILD)

Massimiliano Torromeo mtorromeo at nymeria.archlinux.org
Mon May 13 08:34:11 EDT 2013


    Date: Monday, May 13, 2013 @ 14:34:11
  Author: mtorromeo
Revision: 90630

upgpkg: python-cchardet 0.3.3-1

Updated to latest upstream version and merged python 2/3 pkgbuilds

Modified:
  python-cchardet/trunk/PKGBUILD

----------+
 PKGBUILD |   42 +++++++++++++++++++++++++++++++++---------
 1 file changed, 33 insertions(+), 9 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-05-13 12:33:13 UTC (rev 90629)
+++ PKGBUILD	2013-05-13 12:34:11 UTC (rev 90630)
@@ -2,26 +2,50 @@
 # Maintainer: Massimiliano Torromeo <massimiliano.torromeo at gmail.com>
 
 pkgname=python-cchardet
-pkgver=0.3.2
+pkgname=(python-cchardet python2-cchardet)
+pkgver=0.3.3
 pkgrel=1
-_libname=${pkgname/python-/}
 pkgdesc="Universal encoding detector faster than chardet."
 url="http://pypi.python.org/pypi/cchardet/"
-depends=('python')
-makedepends=('cython' 'python-distribute')
+makedepends=('cython' 'cython2' 'python-distribute' 'python2-distribute')
 license=('MIT')
 arch=('i686' 'x86_64')
-source=(http://pypi.python.org/packages/source/${_libname:0:1}/$_libname/$_libname-$pkgver.tar.gz)
+source=(http://pypi.python.org/packages/source/c/cchardet/cchardet-$pkgver.tar.gz)
 
 build() {
-    cd "$srcdir/$_libname-$pkgver"
-    python setup.py build
+    cd "$srcdir/cchardet-$pkgver"
+
+    rm -rf ../buildpy3; mkdir ../buildpy3
+    python setup.py build -b ../buildpy3
+
+    rm -rf ../buildpy2; mkdir ../buildpy2
+    python2 setup.py build -b ../buildpy2
+    find ../buildpy2 -name \*.py -exec sed -r 's|^#!(.*)python$|#!\1python2|' -i {} +
 }
 
 package() {
-    cd "$srcdir/$_libname-$pkgver"
+    cd "$srcdir/cchardet-$pkgver"
     python setup.py install --root="$pkgdir"
 	install -m0644 -D "README.rst" "$pkgdir/usr/share/licenses/$pkgname/README.rst"
 }
 
-sha256sums=('a3e92811d5a8aacd9ecfdb4ea9637ba801b9b18b7c779dbdf41d07bb48235a23')
+package_python-cchardet() {
+    depends=(python)
+
+
+    cd "$srcdir/cchardet-$pkgver"
+    rm -rf build; ln -s ../buildpy3 build
+    python setup.py install --skip-build -O1 --root="$pkgdir"
+	install -m0644 -D "README.rst" "$pkgdir/usr/share/licenses/$pkgname/README.rst"
+}
+
+package_python2-cchardet() {
+    depends=(python2)
+
+    cd "$srcdir/cchardet-$pkgver"
+    rm -rf build; ln -s ../buildpy2 build
+    python2 setup.py install --skip-build -O1 --root="$pkgdir"
+	install -m0644 -D "README.rst" "$pkgdir/usr/share/licenses/$pkgname/README.rst"
+}
+
+sha256sums=('f326245fa9dc1541a3251cbae66ce2fa8d94969a6f6dfb2800e3beb3636cd2b8')



More information about the arch-commits mailing list