desktop/python-paramiko/PKGBUILD
2018-02-23 11:15:19 +00:00

52 lines
1.9 KiB
Bash

pkgbase=python-paramiko
pkgname=('python3-paramiko' 'python2-paramiko')
pkgver=2.4.0
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')
checkdepends=('python3-pytest-runner' 'python2-pytest-runner' 'python3-pytest-relaxed'
'python2-pytest-relaxed')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/paramiko/paramiko/archive/$pkgver.tar.gz")
sha256sums=('85d42262a2023b40fb3ea663b2fed06a15dc825eaab58de6c84b1519f0822427')
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 pytest
cd "$srcdir"/paramiko-$pkgver-py2
LANG=en_US.UTF-8 pytest2
}
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
}