aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-beautifulsoup4
diff options
context:
space:
mode:
authorKeith Maxwell <keith.maxwell@gmail.com>2018-05-26 08:34:40 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-05-26 17:04:12 +0200
commitcfb9a680e6999fd53d13b68dfa446ab30f5f9e97 (patch)
tree2c887238bb41e170401fff8fcb0109046c3942a3 /testing/py-beautifulsoup4
parent8b9502281af825dc51d22466c4cd555ad8e747db (diff)
downloadaports-cfb9a680e6999fd53d13b68dfa446ab30f5f9e97.tar.bz2
aports-cfb9a680e6999fd53d13b68dfa446ab30f5f9e97.tar.xz
testing/py-beautifulsoup4: add check and fix #8935
Adds a basic check (python -c "import bs4") Follows the multi-version package example from https://wiki.alpinelinux.org/wiki/APKBUILD_examples:Python Fixes #8935 (https://bugs.alpinelinux.org/issues/8935)
Diffstat (limited to 'testing/py-beautifulsoup4')
-rw-r--r--testing/py-beautifulsoup4/APKBUILD29
1 files changed, 24 insertions, 5 deletions
diff --git a/testing/py-beautifulsoup4/APKBUILD b/testing/py-beautifulsoup4/APKBUILD
index 26dce245b0..809d9678f3 100644
--- a/testing/py-beautifulsoup4/APKBUILD
+++ b/testing/py-beautifulsoup4/APKBUILD
@@ -3,7 +3,7 @@
pkgname=py-beautifulsoup4
_pkgname=beautifulsoup4
pkgver=4.6.0
-pkgrel=0
+pkgrel=1
pkgdesc="A Python HTML/XML parser"
url="http://www.crummy.com/software/BeautifulSoup/index.html"
arch="noarch"
@@ -13,10 +13,29 @@ 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() {
- cd "$builddir"
- python2 setup.py build || return 1
- python3 setup.py build || return 1
+ 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() {
@@ -40,7 +59,7 @@ _py() {
depends="$depends $python"
install_if="$pkgname=$pkgver-r$pkgrel $python"
- cd "$builddir"
+ cd "$builddir-$python"
$python setup.py install --prefix=/usr --root="$subpkgdir"
}