aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-ukpostcodeparser/APKBUILD
blob: 7fa0d32cb2d95bd0851034ad01873ff9767b5269 (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
49
50
51
52
53
54
55
56
57
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py-ukpostcodeparser
_pkgname=ukpostcodeparser
pkgver=1.1.2
pkgrel=1
pkgdesc="UK Postcode parser"
url=https://github.com/hamstah/ukpostcodeparser
arch=noarch
license=MIT
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
makedepends="py-setuptools python2-dev python3-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/hamstah/$_pkgname/archive/v$pkgver.tar.gz"
builddir=$srcdir/$_pkgname-$pkgver
# tests broken upstream: https://github.com/hamstah/ukpostcodeparser/issues/8
options="!check"

prepare() {
	cp -r "$builddir" "$builddir"-py3
}

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

check() {
	cd "$builddir"
	python2 setup.py test
	cd "$builddir"-py3
	python3 setup.py test
}

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

_py2() {
	cd "$builddir"
	_py python2
}

_py3() {
	cd "$builddir"-py3
	_py python3
}

_py() {
	python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends="$depends $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

sha512sums="8113522b728c095f937a9f53f21c369130e3e63c4fc3546dbea4ad1c53648742fb0e766b1254c76ee65d69dec585f1a90caa7d39ca540de1765ff5f989a702de  py-ukpostcodeparser-1.1.2.tar.gz"