aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-pefile/APKBUILD
blob: 54b8cf37fabb6767f5c2334cf7e839b72906b261 (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
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py-pefile
_pkgname=pefile
pkgver=2016.3.28
pkgrel=1
pkgdesc="Python PE parsing module"
url="https://github.com/erocarrera/pefile"
arch="noarch"
license="MIT"
depends="py3-future"
makedepends="python2-dev python3-dev py-setuptools"
install=""
subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
source="https://github.com/erocarrera/$_pkgname/files/192316/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

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

package() {
	cd "$builddir"
	python2 setup.py install --root=$pkgdir/ --optimize=1 || return 1
	python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1
	install -Dm0644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}

_py() {
	local python=$1
	pkgdesc="$pkgdesc - $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')

	mkdir -p "$subpkgdir"${dir}
	mv "$pkgdir"${dir}/* "$subpkgdir"${dir}
}

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

_py3() {
	_py python3
}



md5sums="2f3259fa2b5cf48a3fdc5422a58f854f  pefile-2016.3.28.tar.gz"
sha256sums="f24021085b5c3ef7b0898bb1f1d93eecd3839e03512769e22b0c5a10d9095f7b  pefile-2016.3.28.tar.gz"
sha512sums="f27918634507fd839b3bc71677b57676f1b2e46c43970dba158b1b4cb4202344de41fef53fffd294dd70f89b1a52aec0124e835a410ff7f0bec9b11ece425201  pefile-2016.3.28.tar.gz"