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

Filipe Laíns ffy00 at archlinux.org
Mon Aug 20 22:13:58 UTC 2018


    Date: Monday, August 20, 2018 @ 22:13:57
  Author: ffy00
Revision: 372927

make this a split package and also provide python2-keyring

Modified:
  python-keyring/trunk/PKGBUILD

----------+
 PKGBUILD |   52 ++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 38 insertions(+), 14 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-08-20 22:11:21 UTC (rev 372926)
+++ PKGBUILD	2018-08-20 22:13:57 UTC (rev 372927)
@@ -1,5 +1,6 @@
 # $Id$
 # Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Maintainer: Filipe Laíns (FFY00) <lains at archlinux.org>
 # Contributor: Johannes Dewender  arch at JonnyJD dot net
 # Contributor: Ivan Sichmann Freitas <ivansichfreitas at gmail.com>
 # Contributor: Brice Maron <brice at bmaron.net>
@@ -6,39 +7,62 @@
 # Contributor: Nuno Araujo <nuno.araujo at russo79.com>
 # Contributor: Steven Allen <steven {at} stebalien {dot} com>
 
-pkgname=python-keyring
+pkgbase=python-keyring
+_pkgname=${pkgbase#python-}
+pkgname=(python-$_pkgname python2-$_pkgname)
 pkgver=13.2.1
-pkgrel=2
+pkgrel=3
 pkgdesc="Store and access your passwords safely."
 arch=('any')
 url="https://pypi.org/project/keyring/"
 license=('PSF' 'MIT')
-depends=('python-entrypoints' 'python-secretstorage')
 optdepends=('python-keyrings-alt: Alternative backends')
-makedepends=('python-setuptools-scm')
-checkdepends=('python-pytest-flake8' 'python-pytest-runner')
-source=("https://pypi.io/packages/source/k/keyring/keyring-$pkgver.tar.gz")
+makedepends=('python-setuptools-scm' 'python2-setuptools-scm')
+checkdepends=('python-pytest-flake8' 'python-pytest-runner' 'python2-pytest-flake8' 'python2-pytest-runner')
+source=("https://pypi.io/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
 sha512sums=('3c15c3415ba4b657b041d2395536fc92ba656dc71f28669235f13a630946ad1b332d1f5b031a55776ce8a2120d3d2601462708f00ee105f46a27cf043c1bd906')
 
 prepare() {
-  cd keyring-$pkgver
-  echo -e '\nflake8-ignore = W191 W503 W504' >> pytest.ini
+  echo -e '\nflake8-ignore = W191 W503 W504' >> $_pkgname-$pkgver/pytest.ini
+
+  cp -a $_pkgname-$pkgver{,-py2}
 }
 
 build() {
-  cd keyring-$pkgver
+  echo "Building python-$_pkgname $pkgver"
+  cd "$srcdir"/$_pkgname-$pkgver
   python setup.py build
+
+  echo "Building python2-$_pkgname $pkgver"
+  cd "$srcdir"/$_pkgname-$pkgver-py2
+  python2 setup.py build
 }
 
 check() {
-  cd keyring-$pkgver
+  echo "Running tests on python-$_pkgname $pkgver"
+  cd "$srcdir"/$_pkgname-$pkgver
   python setup.py pytest
+
+  echo "Running tests on python2-$_pkgname $pkgver"
+  cd "$srcdir"/$_pkgname-$pkgver-py2
+  python2 setup.py pytest
 }
 
-package() {
-  cd keyring-$pkgver
-  python setup.py install --root="$pkgdir" --optimize=1
-  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+package_python-keyring() {
+  depends=('python-entrypoints' 'python-secretstorage')
+  cd $_pkgname-$pkgver
+
+  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }
 
+package_python2-keyring() {
+  depends=('python2-entrypoints' 'python2-secretstorage')
+  cd $_pkgname-$pkgver-py2
+
+  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  mv "$pkgdir"/usr/bin/keyring "$pkgdir"/usr/bin/keyring2 # Fix the binary name
+  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
 # vim:set ts=2 sw=2 et:



More information about the arch-commits mailing list