# Contributor: Carlo Landmeter # Maintainer: Carlo Landmeter pkgname=py-img2pdf pkgver=0.3.3 pkgrel=1 pkgdesc="Convert images to PDF via direct JPEG inclusion" url="https://gitlab.mister-muffin.de/josch/img2pdf" arch="noarch !s390x" license="LGPL" depends="py-pillow" _py2_depends="py-enum34" makedepends="python2-dev python3-dev py-setuptools" checkdepends="py-pdfrw" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="https://pypi.python.org/packages/source/i/img2pdf/img2pdf-$pkgver.tar.gz 10-tests-import-print-function.patch " builddir="$srcdir/img2pdf-$pkgver" build() { cd "$builddir" python2 setup.py build python3 setup.py build } check() { cd "$builddir" python2 setup.py test python3 setup.py test } package() { mkdir -p "$pkgdir" } _py2() { replaces="$pkgname" depends="${depends//py-/py2-} _py2_depends" _py python2 } _py3() { depends="${depends//py-/py3-}" _py python3 } _py() { local python="$1" pkgdesc="$pkgdesc (for $python)" depends="$depends $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } sha512sums="234e0031d75727d2f5d2b82603bb447d9101ace81e604b6d5eb358d0b4681e209dbd737775b90b44096cf84239aac9e87e2369e0c6112a17f24ccbf10a20cdd5 img2pdf-0.3.3.tar.gz 495bc1d41ff72615666c7e746040b6e38ee4f7f4ad2c581f4c9fa16b617484ea70b63036ea4d5b7270aa9fc64e873b47d2ba6ab5d0c05f484e2c99a3cfae2f41 10-tests-import-print-function.patch"