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

Felix Yan felixonmars at archlinux.org
Thu Nov 17 10:29:12 UTC 2016


    Date: Thursday, November 17, 2016 @ 10:29:12
  Author: felixonmars
Revision: 196230

upgpkg: python-qrcode 5.3-2

- add a python 3 counterpart
- enable tests

Modified:
  python-qrcode/trunk/PKGBUILD

----------+
 PKGBUILD |   43 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 35 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-11-17 10:22:32 UTC (rev 196229)
+++ PKGBUILD	2016-11-17 10:29:12 UTC (rev 196230)
@@ -1,28 +1,55 @@
 # $Id$
 # Maintainer: Timothy Redaelli <timothy.redaelli at gmail.com>
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
 # Contributor: Francois Boulogne <fboulogne at april dot org>
 
-pkgname=python2-qrcode
+pkgbase=python-qrcode
+pkgname=(python-qrcode python2-qrcode)
 pkgver=5.3
-pkgrel=1
+pkgrel=2
 pkgdesc="Python library to generate QR codes"
 arch=('any')
 url="https://github.com/lincolnloop/python-qrcode"
 license=('custom')
-depends=('python2-pillow' 'python2-six' 'python2-setuptools')
-source=(https://pypi.org/packages/source/q/qrcode/qrcode-${pkgver}.tar.gz)
+makedepends=('python-pillow' 'python2-pillow' 'python-six' 'python2-six' 'python-setuptools' 'python2-setuptools')
+checkdepends=('python2-mock')
+source=(https://pypi.io/packages/source/q/qrcode/qrcode-${pkgver}.tar.gz)
+md5sums=('af41b650a3675d0a0366f842de9786b9')
 
 prepare() {
-  find "qrcode-$pkgver" -type f -exec sed -i 's#/usr/bin/python#/usr/bin/python2#g' {} +
-  find . -type f -exec sed -i 's#/usr/bin/env python#/usr/bin/env python2#g' {} +
+  cp -a qrcode-$pkgver{,-py2}
+
+  find "qrcode-$pkgver-py2" -type f -exec sed -e 's#/usr/bin/python#/usr/bin/python2#g' \
+                                              -e 's#/usr/bin/env python#/usr/bin/env python2#g' -i {} +
 }
 
-package() {
+check() {
+  cd "$srcdir"/qrcode-$pkgver
+  python -m unittest discover qrcode
+
+  cd "$srcdir"/qrcode-$pkgver-py2
+  python2 -m unittest discover qrcode
+}
+
+package_python-qrcode() {
+  depends=('python-pillow' 'python-six' 'python-setuptools')
+
   cd "qrcode-$pkgver"
+  python setup.py install --root="${pkgdir}" --optimize=1
+
+  install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_python2-qrcode() {
+  depends=('python2-pillow' 'python2-six' 'python2-setuptools')
+
+  cd "qrcode-$pkgver-py2"
   python2 setup.py install --root="${pkgdir}" --optimize=1
 
   install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+
+  mv "$pkgdir"/usr/bin/qr{,2}
+  mv "$pkgdir"/usr/share/man/man1/qr{,2}.1
 }
 
 # vim:ts=2:sw=2:et:
-md5sums=('af41b650a3675d0a0366f842de9786b9')



More information about the arch-commits mailing list