desktop/python-paramiko/PKGBUILD
2017-10-31 23:04:26 +01:00

50 lines
1.8 KiB
Bash

pkgbase=python-paramiko
pkgname=('python3-paramiko' 'python2-paramiko')
pkgver=2.3.1
pkgrel=1
pkgdesc="Python module that implements the SSH2 protocol"
url="https://github.com/paramiko/paramiko/"
license=('LGPL')
arch=('any')
makedepends=('python3-setuptools' 'python2-setuptools' 'python3-ecdsa' 'python2-ecdsa' 'python3-crypto' 'python2-crypto'
'python3-cryptography' 'python2-cryptography' 'python3-pyasn1' 'python2-pyasn1'
'python3-bcrypt' 'python2-bcrypt' 'python3-pynacl' 'python2-pynacl')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/paramiko/paramiko/archive/$pkgver.tar.gz")
sha256sums=('3b50a5a2ce206cb540c27ce83245f565d0139104ee83af33f695db944c926166')
prepare() {
cp -a paramiko-$pkgver{,-py2}
find paramiko-$pkgver-py2 -name '*.py' -print0 | xargs -0 \
sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,' \
-e 's,^#!/usr/bin/python$,#!/usr/bin/python2,'
}
check() {
cd "$srcdir/paramiko-$pkgver"
LANG=en_US.UTF-8 python3 test.py
cd "$srcdir/paramiko-$pkgver-py2"
LANG=en_US.UTF-8 python2 test.py
}
package_python3-paramiko() {
depends=('python3-crypto' 'python3-ecdsa')
cd "$srcdir/paramiko-$pkgver"
python3 setup.py install --root="$pkgdir" --optimize=1
install -dm755 "$pkgdir/usr/share/doc/$pkgname/demos"
install -m644 demos/* "$pkgdir/usr/share/doc/$pkgname/demos"
chmod 755 "$pkgdir/usr/share/doc/$pkgname/demos/"*.py
}
package_python2-paramiko() {
depends=('python2-crypto' 'python2-ecdsa')
cd "$srcdir/paramiko-$pkgver-py2"
python2 setup.py install --root="$pkgdir" --optimize=1
install -dm755 "$pkgdir/usr/share/doc/$pkgname/demos"
install -m644 demos/* "$pkgdir/usr/share/doc/$pkgname/demos"
chmod 755 "$pkgdir/usr/share/doc/$pkgname/demos/"*.py
}