aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-mysqlclient/APKBUILD
blob: bcbb81d2bb4dee49730f34262de93829def19c0e (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
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py-mysqlclient
pkgver=1.3.14
pkgrel=0
pkgdesc="MySQL database connector for Python (with py3 support)"
url="https://mysqlclient.readthedocs.io/"
arch="all"
license="GPL-2.0"
depends=""
makedepends="python2-dev python3-dev py-setuptools mariadb-dev"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="mysqlclient-python-$pkgver.tar.gz::https://github.com/PyMySQL/mysqlclient-python/archive/$pkgver.tar.gz"
builddir="$srcdir/mysqlclient-python-$pkgver"

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() {
	_py python2
}

_py3() {
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}
sha512sums="480e36f7d7b31851f2d50eb3f6f2e8009277e8c5fff8ea8e5d2a3bc2424a5f13735e6c1fa620d17383ac0dd5020440425fcf8781911c3360f752e344813a7ddb  mysqlclient-python-1.3.14.tar.gz"