# Contributor: Francesco Colista # Maintainer: Fabian Affolter pkgname=py-mechanize _pkgname=mechanize pkgver=0.2.5 pkgrel=2 pkgdesc="Stateful programmatic web browsing in Python" url="http://wwwsearch.sourceforge.net/mechanize/" arch="noarch" license="BSD ZPL" makedepends="python2-dev py-setuptools python3-dev" subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2" source="http://wwwsearch.sourceforge.net/$_pkgname/src/$_pkgname-$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" build() { python2 setup.py build python3 setup.py build } check() { python2 setup.py check python3 setup.py check } package() { mkdir -p "$pkgdir" install -Dm644 COPYING.txt ${pkgdir}/usr/share/licenses/custom/${pkgname}/COPYING.txt } _py() { local python=$1 pkgdesc="$pkgdesc - $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } _py2() { replaces="$pkgname" _py python2 } _py3() { _py python3 } sha512sums="23de1d9a5fba63d76fd577889594dacf5412fb2fccb58908a10ab350a81dd16a7a31019d0b4a59a5ed4115320c7e3585c77eef88dcd80a88a9c3c2da3c28fa68 mechanize-0.2.5.tar.gz"