desktop/python-pexpect/PKGBUILD

48 lines
1.5 KiB
Bash

pkgbase=python-pexpect
pkgname=('python2-pexpect' 'python3-pexpect')
pkgver=4.0.1
pkgrel=3
pkgdesc='Python module for spawning and controlling other applications'
arch=('any')
url='http://pexpect.sourceforge.net/'
license=('MIT')
makedepends=('python2' 'python3')
source=("http://pypi.python.org/packages/source/p/pexpect/pexpect-$pkgver.tar.gz")
sha256sums=('232795ebcaaf2e120396dbbaa3a129eda51757eeaae1911558f4ef8ee414fc6c')
prepare() {
cp -r ${srcdir}/pexpect-$pkgver ${srcdir}/python2-pexpect-$pkgver
}
package_python3-pexpect() {
depends=('python3' 'python3-ptyprocess')
cd ${srcdir}/pexpect-$pkgver
python3 setup.py install --root=${pkgdir}
install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python3|" \
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python3|" \
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python3|" \
$(find ${pkgdir} -name '*.py')
}
package_python2-pexpect() {
depends=('python2' 'python2-ptyprocess')
conflicts=('python-pexpect')
replaces=('python-pexpect')
provides=('python-pexpect')
cd ${srcdir}/python2-pexpect-$pkgver
python2 setup.py install --root=${pkgdir}
install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
$(find ${pkgdir} -name '*.py')
}