~dricottone/huttese-apk

ref: 68e2b4a1d299bc5e3e788416a2ec0fe1f3e1225f huttese-apk/sr.ht/py-alembic/APKBUILD -rw-r--r-- 1.3 KiB
68e2b4a1 — Drew DeVault Actually fix old package removal 5 years ago
                                                                                
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
# Maintainer: Drew DeVault <sir@cmpwn.com>

pkgname=py-alembic
_pkgname=alembic
pkgver=0.9.6
pkgrel=0
pkgdesc="Lightweight database migration tool for usage with SQLAlchemy"
url="https://bitbucket.org/zzzeek/alembic"
arch="noarch"
license="MIT"
depends="py-mako py-dateutil py-sqlalchemy py-editor"
makedepends="python2-dev python3-dev py-setuptools py-mock pytest"
subpackages="py2-${_pkgname}:_py2 py3-${_pkgname}:_py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/${_pkgname}-${pkgver}"

prepare() {
	cp -r "$builddir" "$builddir"-py3
}

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

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

_py2() {
	cd "$builddir"
	_py
}

_py3() {
	cd "$builddir"-py3
	_py
}

_py() {
	local pyver="${subpkgname:2:1}"
	local python="python$pyver"
	pkgdesc="$pkgdesc (for $python)"
	depends="$python ${depends//py-/py$pyver-}"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
	mv "$subpkgdir"/usr/bin/alembic "$subpkgdir"/usr/bin/alembic-$pyver
}

sha512sums="f7bc6fa2888056d66b1d3640387b933b4accea6e6062ec089e5ce1353cbaa89ad3c1afac6c06aa52ddd497bdd41f9fdf5d4d860244ed8f339c69c16eb5494c46  alembic-0.9.6.tar.gz"