aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-mysqlclient/APKBUILD
blob: 8de583ea3f2676e3c8d3d13f23e056ebb366677e (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.13
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="d656c2c9d6eaf02331a994f154ab0d2e1624e563b7f8e1b6f39b4f7d7ad6416662b8caeeab775d435bba22a5aba2d4c72a56429b403bdcfbc21d7ea8c72cddcc  mysqlclient-python-1.3.13.tar.gz"