A sr.ht/py-ansi2html/APKBUILD => sr.ht/py-ansi2html/APKBUILD +59 -0
@@ 0,0 1,59 @@
+# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
+# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
+pkgname=py-ansi2html
+_pkgname=ansi2html
+pkgver=1.5.2
+pkgrel=0
+pkgdesc="Convert text with ANSI color codes to HTML"
+url="http://github.com/ralphbean/ansi2html/"
+arch="noarch"
+license="LGPL-3.0-or-later"
+depends="py-six"
+makedepends="py-setuptools"
+checkdepends="py-nose py-mock py2-pytest pytest"
+source="$pkgname-$pkgver.tar.gz::https://github.com/ralphbean/$_pkgname/archive/$pkgver.tar.gz"
+builddir="$srcdir"/$_pkgname-$pkgver
+options="!check" # upstream tests don't work unless module is installed
+
+prepare() {
+ cp -r "$builddir" "$builddir"-py3
+}
+
+build() {
+ cd "$builddir"
+ PYTHONPATH="$(pwd)" python2 ./tests/test_ansi2html.py
+ cd "$builddir"-py3
+ PYTHONPATH="$(pwd)" python3 ./tests/test_ansi2html.py
+}
+
+check() {
+ cd "$builddir"
+ pytest-2
+ cd "$builddir"-py3
+ pytest-3
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ cd "$builddir"
+ replaces="py-ansi2html"
+ _py python2
+}
+
+_py3() {
+ cd "$builddir"-py3
+ _py python3
+}
+
+_py() {
+ python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ depends="$depends $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+sha512sums="d386502d755a393a8de2f9c37ac2f1d6cfad1ac5dd3c1e508fe42a72a49762d43546d474e9ad7def5c89b5d7466ae7dceb331c46e2be6cfc4d1f6896a278dce2 py-ansi2html-1.5.2.tar.gz"