aboutsummaryrefslogtreecommitdiffstats
path: root/main/talloc/APKBUILD
blob: cdb15cee1fe34d8409a86547d4096e12ef42944d (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Contributor: 
# Maintainer: 
pkgname=talloc
pkgver=2.1.14
pkgrel=2
pkgdesc="Memory pool management library"
url="https://talloc.samba.org"
arch="all"
license="LGPL-3.0-or-later"
replaces="samba-common"
makedepends="docbook-xsl libxslt python2-dev python3-dev"
subpackages="$pkgname-dev py2-$pkgname:_py2 py3-$pkgname:_py3 $pkgname-doc"
source="https://samba.org/ftp/$pkgname/$pkgname-$pkgver.tar.gz
	always-libs.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--bundled-libraries=NONE \
		--builtin-libraries=replace \
		--disable-rpath \
		--disable-rpath-install \
		--without-gettext \
		--extra-python=/usr/bin/python3
	make

	# talloc's Waf setup doesn't build static libraries, so we do it manually
	ar qf libtalloc.a bin/default/talloc_*.o
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -Dm644 libtalloc.a "$pkgdir"/usr/lib/libtalloc.a
}

_py2() {
	pkgdesc="Python 2 binding for libtalloc"
	replaces="py-talloc"  # for backward compatibility
	provides="py-talloc=$pkgver-r$pkgrel"  # for backward compatibility

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpytalloc-util.so.* \
		"$pkgdir"/usr/lib/python2* "$subpkgdir"/usr/lib/
}

_py3() {
	pkgdesc="Python 3 binding for libtalloc"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpytalloc-util.cpython* \
		"$pkgdir"/usr/lib/python3* "$subpkgdir"/usr/lib/
}

sha512sums="1fcc70bf283a4d9fb61faf1c57f80a9c158efbe996452740db9755e879ad72ee7bff6f6c9bed358e085c5c7f97c78800bb903161143af2202952b702141cc130  talloc-2.1.14.tar.gz
fa818d6291f6291d193b475af993de4fd34e6133ccacb55203f5c96973c51b2e932523f5f2a8cd38a4959e80d8378841b3b5efd5411b7828a240102b492c16e7  always-libs.patch"