pkgbase=python-bcrypt pkgname=("python3-bcrypt" "python2-bcrypt") pkgver=3.1.4 pkgrel=1 pkgdesc="Modern password hashing for your software and your servers" arch=('x86_64') url="https://github.com/pyca/bcrypt" license=('Apache') makedepends=('python3-setuptools' 'python2-setuptools' 'python3-cffi' 'python2-cffi' 'python3-six' 'python2-six') checkdepends=('python3-pytest-runner' 'python2-pytest-runner') source=("$pkgbase-$pkgver.tar.gz::https://github.com/pyca/bcrypt/archive/$pkgver.tar.gz") sha512sums=('f4b18095ee1ea09a4a1ae4d970353d4743b84e8b2637132857339febc8fd25697359c8a3308578db623ee0c900a5711a693d9bfd21625bf93c1e6437bfb24f6c') prepare() { cp -a "$srcdir"/bcrypt-$pkgver{,-py2} export LC_CTYPE=en_US.UTF-8 } build() { cd "$srcdir"/bcrypt-$pkgver python3 setup.py build cd "$srcdir"/bcrypt-$pkgver-py2 python2 setup.py build } check() { cd "$srcdir"/bcrypt-$pkgver python3 setup.py pytest cd "$srcdir"/bcrypt-$pkgver-py2 python2 setup.py pytest } package_python3-bcrypt() { depends=('python3-cffi' 'python3-six') cd bcrypt-$pkgver python3 setup.py install --prefix=/usr --root="$pkgdir" install -d "$pkgdir"/usr/share/licenses/$pkgname install -m 644 "$srcdir"/bcrypt-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname } package_python2-bcrypt() { depends=('python2-cffi' 'python2-six') cd bcrypt-$pkgver-py2 python2 setup.py install --prefix=/usr --root="$pkgdir" install -d "$pkgdir"/usr/share/licenses/$pkgname install -m 644 "$srcdir"/bcrypt-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname }