aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-future/APKBUILD
blob: e654c2dc42ff5d7fa7fc183c7ebff44fb277b01d (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
58
59
60
61
62
63
64
65
66
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py-future
_pkgname=python-future
pkgver=0.17.1
pkgrel=0
pkgdesc="Easy, clean, reliable Python 2/3 compatibility"
url="http://python-future.org/"
arch="noarch"
license="MIT"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2"
source="$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/f/future/future-$pkgver.tar.gz"
builddir="$srcdir/${_pkgname/python-/}-$pkgver"

prepare() {
	default_prepare
	cd "$builddir"
	mkdir -p $pkgname-py2
	cp -a "$builddir" "$builddir"-py2
}

build() {
	cd "$builddir"-py2
	python2 setup.py build

	cd "$builddir"
	python3 setup.py build
}

check() {
	cd "$builddir"-py2
	python2 setup.py check

	cd "$builddir"
	python3 setup.py check
}

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

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends="$depends $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	if [ $python = "python2" ]; then 
		cd "$builddir"-py2
	else
		cd "$builddir"
	fi
	$python setup.py install --prefix=/usr --root="$subpkgdir"
	install -Dm0644 LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE.txt
}

_py2() {
	replaces="$pkgname"
	_py python2
}

_py3() {
	_py python3
}

sha512sums="50094c44db81afbfd37ee25e1710ed11ecb2c2d64ad076fb62a2688dd36a9696ab26b0d7989bf1ecb10da251961a0ee6bb37c4dbd115f70384cd8c9a675d0b2d  py-future-0.17.1.tar.gz"