Date: Tuesday, February 13, 2018 @ 11:46:44
  Author: dvzrv
Revision: 293803

upgpkg: python-iwlib 1.5-9

Adding proper tests to check(). Adding python-cffi to depends. Adding docs also 
to python2 version of the package.

Modified:
  python-iwlib/trunk/PKGBUILD

----------+
 PKGBUILD |   32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2018-02-13 11:39:55 UTC (rev 293802)
+++ PKGBUILD    2018-02-13 11:46:44 UTC (rev 293803)
@@ -3,21 +3,22 @@
 pkgbase=python-iwlib
 pkgname=('python-iwlib' 'python2-iwlib')
 pkgver=1.5
-pkgrel=8
+pkgrel=9
 pkgdesc='Python module to interface with iwlib'
 arch=('x86_64')
-url='https://github.com/nathan-hoad/python-iwlib'
+url="https://github.com/nathan-hoad/python-iwlib";
 license=('GPL2')
 makedepends=('python-setuptools' 'python2-setuptools' 'wireless_tools')
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/nathan-hoad/${pkgname}/archive/${pkgver}.tar.gz";)
+checkdepends=('python-pytest' 'python2-pytest')
+source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/nathan-hoad/${pkgbase}/archive/${pkgver}.tar.gz";)
 
sha512sums=('2b79e412949a465d1383620745b6bfbf5924ef8ed47d459882afc5c86e54d10d1b963055df7076a481fb7bd6ade1d318ce35ed36ee5c129c048bbf6b1790f432')
 
 prepare(){
-  cp -a "${pkgname[0]}-${pkgver}" "${pkgname[1]}-${pkgver}"
+  cp -av "${pkgname[0]}-${pkgver}" "${pkgname[1]}-${pkgver}"
 }
 
 build() {
-  cd "${pkgname}-${pkgver}"
+  cd "${pkgname[0]}-${pkgver}"
   python setup.py build
   cd ../"${pkgname[1]}-${pkgver}"
   python2 setup.py build
@@ -24,29 +25,34 @@
 }
 
 check() {
-  cd "${pkgname}-${pkgver}"
-  python setup.py test
+  cd "${pkgname[0]}-${pkgver}"
+  export 
PYTHONPATH="${srcdir}/${pkgname[0]}-${pkgver}/build/lib.linux-x86_64-3.6/":${PYTHONPATH}
+  py.test
   cd ../"${pkgname[1]}-${pkgver}"
-  python2 setup.py test
+  export 
PYTHONPATH="${srcdir}/${pkgname[1]}-${pkgver}/build/lib.linux-x86_64-2.7/":${PYTHONPATH}
+  py.test2
 }
 
 package_python-iwlib() {
-  depends=('python' 'wireless_tools')
-  cd "${pkgname}-${pkgver}"
+  depends=('python-cffi' 'wireless_tools')
+  cd "${pkgname[0]}-${pkgver}"
   python setup.py install --skip-build \
     --optimize=1 \
     --prefix=/usr \
     --root="${pkgdir}"
-
-  install -t "${pkgdir}/usr/share/doc/${pkgname}/" \
+  # docs
+  install -t "${pkgdir}/usr/share/doc/${pkgname[0]}/" \
     -vDm644 {AUTHORS,README.rst}
 }
 
 package_python2-iwlib() {
-  depends=('python2' 'wireless_tools')
+  depends=('python2-cffi' 'wireless_tools')
   cd "${pkgname[1]}-${pkgver}"
   python2 setup.py install --skip-build \
     --optimize=1 \
     --prefix=/usr \
     --root="${pkgdir}"
+  # docs
+  install -t "${pkgdir}/usr/share/doc/${pkgname[0]}/" \
+    -vDm644 {AUTHORS,README.rst}
 }

Reply via email to