aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-scandir/APKBUILD
blob: 18f00c629fd84bc9f3457927462edc1956ee5bd3 (plain) (blame)
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
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py-scandir
pkgver=1.9.0
pkgrel=0
pkgdesc="Better directory iterator and faster os.walk(), now in the Python 3.5 stdlib"
url="https://github.com/benhoyt/scandir"
arch="noarch"
license="MIT"
source="py-scandir-$pkgver.tar.gz::https://github.com/benhoyt/scandir/archive/v$pkgver.tar.gz"
builddir="$srcdir/scandir-$pkgver"
depends=""
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py2-${pkgname#py-}:_py2:all py3-${pkgname#py-}:_py3:all"

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

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

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

_py2() {
	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="af3f20fe19620a7ccc17b2661dbf2d61038c6c55f1e815bcc777ad3776b469d523bbf0ca1052212ee45d0fd932cd6f055cae3a18592ef8bac2078eeada4ec6f4  py-scandir-1.9.0.tar.gz"