aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-beautifulsoup4/APKBUILD
blob: e05726c35a3b494f7aeaafe92811bc45a98ca119 (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
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-beautifulsoup4
_pkgname=beautifulsoup4
pkgver=4.6.0
pkgrel=1
pkgdesc="A Python HTML/XML parser"
url="http://www.crummy.com/software/BeautifulSoup/index.html"
arch="noarch"
license="MIT"
makedepends="python2-dev py-setuptools python3-dev"
subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare

	local python; for python in python2 python3; do
		cp -r "$builddir" "$builddir-$python"
	done

	cd "$builddir-python3"
	2to3 -w bs4 >/dev/null
}

build() {
	local python; for python in python2 python3; do
		cd "$builddir-$python"
		$python setup.py build
	done
}

check() {
	local python; for python in python2 python3; do
		cd "$builddir-$python"
		$python -c "import bs4"
	done
}

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

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

_py3() {
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends="$python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir-$python"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

sha512sums="1a7eee4218e58cc3852e71fe4f0892f673bb46a851941264766a38eff8ef05d612d88b4641fcb478ce8f66ac50dc987ca039923c4bbb11867c74813289f7e578  beautifulsoup4-4.6.0.tar.gz"