aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-img2pdf/APKBUILD
blob: 2eb99d7b5cf7714bbdcc9359d3b175a4a93524da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=py-img2pdf
pkgver=0.2.4
pkgrel=0
pkgdesc="Convert images to PDF via direct JPEG inclusion"
url="https://gitlab.mister-muffin.de/josch/img2pdf"
arch="noarch"
license="LGPL"
depends="py-pillow"
makedepends="python2-dev python3-dev py-setuptools"
install=""
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="https://pypi.python.org/packages/7e/a2/4f06081f674920be757d894b4bab874e6a3b5227e730cb7618430b366e69/img2pdf-$pkgver.tar.gz"
builddir="$srcdir/img2pdf-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

package() {
	mkdir -p "$pkgdir"
}

_py2() {
	replaces="$pkgname"
	depends="${depends//py-/py2-}"
	_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="c2d99da7076411cf4acabe8929fc8af4005ef1f3e3d9edc953f2731b8d41159c9e4637a803765e1405c595daebfb3d519d4c7903003ce0118d8b0c6e88f11860  img2pdf-0.2.4.tar.gz"