APKBUILD 1.12 KB
Newer Older
1
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
2
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
3
pkgname=py-ipaddress
4
_pkgname=ipaddress
5
pkgver=1.0.22
6
pkgrel=0
7 8 9 10 11
pkgdesc="IPv4/IPv6 manipulation library"
url="https://github.com/phihag/ipaddress"
arch="noarch"
license="PSF"
depends=""
12
makedepends="python2-dev python3-dev py-setuptools"
13 14 15
subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
16 17

build() {
18 19
	cd "$builddir"
	python2 setup.py build || return 1
20
	python3 setup.py build || return 1
21 22 23
}

package() {
24
	mkdir -p "$pkgdir"
25 26
}

27
_py() {
28 29 30 31 32
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends="$depends $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

33 34 35 36 37 38
	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

_py2() {
	replaces="$pkgname"
39
	_py python2
40 41 42 43 44 45
}

_py3() {
	_py python3
}

46
sha512sums="b0b0bae50c0819c46554f4ca2d14403a054d73cb9df7efd8bde03bd32b7599510a0e8eb7a63bd7cc6af45a035a0fcce38058b0625732472c7f252f72b88a6084  ipaddress-1.0.22.tar.gz"