Mail archive
alpine-aports

[alpine-aports] [PATCH 1/2] main/bind: more fine grained package split

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Mon, 16 Nov 2015 13:30:13 +0100

For instance dnssec used to be part of the bind package but now belongs
to the bind-tools package. Furthermore a tools-doc subpackage has been
added.
---
 main/bind/APKBUILD | 59 ++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 48 insertions(+), 11 deletions(-)
diff --git a/main/bind/APKBUILD b/main/bind/APKBUILD
index d76d917..0b7149a 100644
--- a/main/bind/APKBUILD
+++ b/main/bind/APKBUILD
_at_@ -1,3 +1,4 @@
+# Contributor: Sören Tempel <soeren+alpine_at_soeren-tempel.net>
 # Contributor: Carlo Landmeter <clandmeter_at_gmail.com>
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=bind
_at_@ -5,17 +6,22 @@ pkgver=9.10.3
 _ver=${pkgver%_p*}
 _p=${pkgver#*_p}
 [ "$_p" != "$pkgver" ] && _ver="${_ver}-P$_p"
-pkgrel=0
-pkgdesc="The Berkeley Internet Name Domain Name Server and tools"
+pkgrel=1
+pkgdesc="The ISC DNS server"
 url="http://www.isc.org"
 arch="all"
 license="MIT BSD"
 depends=""
 pkgusers="named"
 pkggroups="named"
-makedepends="openssl-dev libcap-dev perl linux-headers bsd-compat-headers"
+makedepends="bash openssl-dev libcap-dev perl linux-headers bsd-compat-headers"
 install="$pkgname.pre-install"
-subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-tools"
+subpackages="
+	$pkgname-doc
+	$pkgname-dev
+	$pkgname-libs
+	$pkgname-tools
+	$pkgname-tools-doc:tools_doc"
 source="http://ftp.isc.org/isc/bind9/${_ver}/bind-${_ver}.tar.gz
 	bind.so_bsdcompat.patch
 	named.initd
_at_@ -32,7 +38,7 @@ prepare() {
 	cd "$_builddir"
 
 	### http://bugs.gentoo.org/show_bug.cgi?id=227333
-	export CFLAGS="$CFLAGS -D_GNU_SOURCE" 
+	export CFLAGS="$CFLAGS -D_GNU_SOURCE"
 
 	# Adjusting PATHs in manpages
 	for i in bin/named/named.8 bin/check/named-checkconf.8 bin/rndc/rndc.8; do
_at_@ -83,7 +89,19 @@ package() {
 	install -d -m0750 -g named -o root "$pkgdir"/etc/bind \
 		"$pkgdir"/var/bind/pri || return 1
 
-	make DESTDIR="$pkgdir" install || return 1
+	# Libraries and headers shipped by bind-{dev,libs}
+	make DESTDIR="$pkgdir" install \
+		-C "$_builddir"/lib || return 1
+
+	# Executables shipped by bind package
+	for d in check confgen named rndc; do
+		make DESTDIR="$pkgdir" install \
+			-C "$_builddir"/bin/$d || return 1
+	done
+
+	# FIXME: Workaround for broken symlink handling in abuild
+	find "$pkgdir"/usr/share/man/man3 -name 'lwres_*' \
+		-type f -exec rm -f \{\} \;
 
 	install -Dm755 "$srcdir"/named.initd \
 		"$pkgdir"/etc/init.d/named || return 1
_at_@ -99,17 +117,36 @@ package() {
 		"$pkgdir"/var/bind/pri/127.zone || return 1
 	install -Dm644 "$srcdir"/localhost.zone \
 		"$pkgdir"/var/bind/pri/localhost.zone || return 1
+
 	cd "$pkgdir"/var/bind
 	ln -s named.ca root.cache || return 1
 }
 
 tools() {
-	install=
-	depends=
-	mkdir -p "$subpkgdir"/usr/bin
-	for i in dig host nslookup nsupdate; do
-		mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/ || return 1
+	pkgdesc="The ISC DNS tools"
+	install=""
+	depends=""
+
+	for d in dig dnssec delv nsupdate; do
+		make DESTDIR="$subpkgdir" install \
+			-C "$_builddir"/bin/$d || return 1
 	done
+
+	rm -rf "$subpkgdir"/usr/share/man || return 1
+}
+
+tools_doc() {
+	pkgdesc="The ISC DNS tools (documentation)"
+	arch="noarch"
+	install_if="docs $pkgname-tools=$pkgver-r$pkgrel"
+
+	for d in dig dnssec delv nsupdate; do
+		make DESTDIR="$subpkgdir" install \
+			-C "$_builddir"/bin/$d || return 1
+	done
+
+	rm -rf "$subpkgdir"/usr/bin "$subpkgdir"/usr/sbin || return 1
+	find "$subpkgdir" -type f -name '*.[0-8]' -exec gzip -9 \{\} \;
 }
 
 md5sums="d8cbf04a62a139a841d4bf878087a555  bind-9.10.3.tar.gz
-- 
2.6.3
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Nov 16 2015 - 13:30:13 GMT