# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py-editor
_pkgname=editor
pkgver=1.0.3
pkgrel=0
pkgdesc="Programmatically open an editor, capture the result"
url="https://github.com/fmoo/python-editor"
arch="noarch"
license="Apache"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="${_pkgname}-${pkgver}.tar.gz::https://github.com/fmoo/python-editor/archive/${pkgver}.tar.gz"
builddir="$srcdir/python-${_pkgname}-${pkgver}"
# This dead-simple module has no tests
options="$options !check"
prepare() {
cp -r "$builddir" "$builddir"-py3
}
check() {
cd "$builddir"
python2 setup.py check
cd "$builddir"-py3
python3 setup.py check
}
package() {
mkdir -p "$pkgdir"
}
_py2() {
cd "$builddir"
_py python2
}
_py3() {
cd "$builddir"-py3
_py python3
}
_py() {
local python="$1"
pkgdesc="$pkgdesc (for $python)"
depends="$python"
install_if="$pkgname=$pkgver-r$pkgrel $python"
$python setup.py install --prefix=/usr --root="$subpkgdir"
}
sha512sums="0b14462099f8c5a3a7517f0f0cb744470284c34d164483bc58b15ecf4c5484090149d5dcb923b932a41857cfa34d4f10e4238ccc20089804a14631a459b63a39 editor-1.0.3.tar.gz"