aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-future/APKBUILD
blob: d4b253cec8f84c39808b3e88bdd3a6707b336412 (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.0
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://github.com/PythonCharmers/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$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="0b914ba062dd2b3c6837d8d8d274d27faadc587b264e887266527940fa7b4b98ce1b0076f1e589f943406d24b9e17f3ae8c2060c4ffa2207f620040988c176a3  py-future-0.17.0.tar.gz"