Subject: [alpine-devel] [PATCH] testing/heimdal: some clients/daemons in subpkgs, fixed install dirs, init scripts added

From: Leonardo Arena <[email-masked]>
Date: Thu, 14 May 2009 13:36:17 +0200

Please review attached patch
thanks
leo
From 862d1f8f1efe17e127fd17c409af07cfe0dee851 Mon Sep 17 00:00:00 2001
From: Leonardo Arena <[email-masked]>
Date: Thu, 14 May 2009 11:35:32 +0000
Subject: [PATCH] testing/heimdal: some clients/daemons in subpkgs, fixed install dirs, init scripts added

---
 testing/heimdal/APKBUILD              |   72 +++++++++++++++++++++++++++++----
 testing/heimdal/heimdal-kadmind.init  |   24 +++++++++++
 testing/heimdal/heimdal-kdc.init      |   23 ++++++++++
 testing/heimdal/heimdal-kpasswdd.init |   24 +++++++++++
 4 files changed, 135 insertions(+), 8 deletions(-)
 create mode 100755 testing/heimdal/heimdal-kadmind.init
 create mode 100755 testing/heimdal/heimdal-kdc.init
 create mode 100755 testing/heimdal/heimdal-kpasswdd.init

diff --git a/testing/heimdal/APKBUILD b/testing/heimdal/APKBUILD
index a070d8c..ba99648 100644
--- a/testing/heimdal/APKBUILD
+++ b/testing/heimdal/APKBUILD
@@ -8,7 +8,7 @@ license="BSD"
 depends="uclibc sqlite readline openssl"
 makedepends="gawk readline-dev"
 install=
-subpackages="$pkgname-doc $pkgname-dev"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-ftp $pkgname-telnet $pkgname-su $pkgname-rsh"
 source="http://www.h5l.org/dist/src/$pkgname-$pkgver.tar.gz
 001_all_heimdal-no_libedit.patch
 002_all_heimdal-fPIC.patch
@@ -45,16 +45,11 @@ build() {
 	doc/setup.texi doc/heimdal.info kadmin/kadmind.8 kdc/kdc.8 \
 	lib/hdb/hdb.h lib/krb5/krb5.conf.5 lib/krb5/krb5.conf.cat5
 
+
 	export LDFLAGS="${LDFLAGS} -Wl,--as-needed"
 
 	./configure --prefix=/usr \
 		--enable-shared=yes --without-x \
-		--sysconfdir=/etc \
-		--mandir=/usr/share/man \
-		--infodir=/usr/share/info
-		--datadir=/var/lib/heimdal \
-		--localstatedir=/var/lib/heimdal \
-		--libexecdir=/usr/sbin \
 		--disable-berkeley-db \
 		--disable-netinfo \
 		--with-readline-lib=/usr/lib \
@@ -62,7 +57,68 @@ build() {
 		--with-openssl=/usr
 
 	make || return 1
-	make DESTDIR="$pkgdir" install
+	make DESTDIR="$pkgdir" exec_prefix=/usr sysconfdir=/etc \
+	mandir=/usr/share/man infodir=/usr/share/info datadir=/var/lib/heimdal \
+	localstatedir=/var/lib/heimdal libexecdir=/usr/sbin install
+
+	install -m644 -D krb5.conf ${pkgdir}/etc/krb5.conf || return 1
+	install -m755 -D ../../heimdal-kadmind.init ${pkgdir}/etc/init.d/heimdal-kadmind
+	install -m755 -D ../../heimdal-kdc.init ${pkgdir}/etc/init.d/heimdal-kdc
+	install -m755 -D ../../heimdal-kpasswdd.init ${pkgdir}/etc/init.d/heimdal-kpasswdd
+
+	# Rename daemons and their manpages
+	for i in telnetd ftpd rshd; do
+		mv ${pkgdir}/usr/share/man/man8/${i}.8 ${pkgdir}/usr/share/man/man8/k${i}.8 || return 1
+		mv ${pkgdir}/usr/sbin/${i} ${pkgdir}/usr/sbin/k${i} || return 1
+	done
+
+	# Rename clients and their manpages
+	for i in rcp rsh telnet ftp su login; do
+		if [ -f ${pkgdir}/usr/share/man/man1/${i}.1 ]; then
+			mv ${pkgdir}/usr/share/man/man1/${i}.1 ${pkgdir}/usr/share/man/man1/k${i}.1 || return 1
+		fi
+		mv ${pkgdir}/usr/bin/${i} ${pkgdir}/usr/bin/k${i} || return 1
+	done
+	rm -rf ${pkgdir}/usr/share/man/cat{1,3,5,8}
+
+	# Remove conflicts 
+	rm ${pkgdir}/usr/share/man/man5/ftpusers.5*
+
+	# Compress info pages
+	for page in heimdal hx509; do
+		gzip -9 ${pkgdir}/usr/share/info/${page}.info
+	done
+
+	# Install the license
+	install -d ${pkgdir}/usr/share/licenses/${pkgname}
+	install -D -m644 ${srcdir}/${pkgname}-${pkgver}/LICENSE \
+	${pkgdir}/usr/share/licenses/${pkgname}/ || return 1
+}
+
+ftp() {
+	mkdir -p $subpkgdir/usr/bin/
+	mv $pkgdir/usr/bin/kftp $subpkgdir/usr/bin/kftp
+	mkdir -p $subpkgdir/usr/sbin/
+	mv $pkgdir/usr/sbin/kftpd $subpkgdir/usr/sbin/kftpd
+}
+
+telnet() {
+	mkdir -p $subpkgdir/usr/bin/
+	mv $pkgdir/usr/bin/ktelnet $subpkgdir/usr/bin/ktelnet
+	mkdir -p $subpkgdir/usr/sbin/
+	mv $pkgdir/usr/sbin/ktelnetd $subpkgdir/usr/sbin/ktelnetd
+}
+
+su() {
+	mkdir -p $subpkgdir/usr/bin/
+	mv $pkgdir/usr/bin/ksu $subpkgdir/usr/bin/ksu
+}
+
+rsh() {
+	mkdir -p $subpkgdir/usr/bin/
+	mv $pkgdir/usr/bin/krsh $subpkgdir/usr/bin/krsh
+	mkdir -p $subpkgdir/usr/sbin/
+	mv $pkgdir/usr/sbin/krshd $subpkgdir/usr/sbin/krshd
 }
 
 md5sums="6e5028077e2a6b101a4a72801ba71b9e  heimdal-1.2.1.tar.gz
diff --git a/testing/heimdal/heimdal-kadmind.init b/testing/heimdal/heimdal-kadmind.init
new file mode 100755
index 0000000..b58ac99
--- /dev/null
+++ b/testing/heimdal/heimdal-kadmind.init
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/heimdal/files/heimdal-kadmind,v 1.3 2004/09/13 22:44:54 solar Exp $
+
+depend() {
+	need net
+	use heimdal-kdc
+	after logger
+}
+
+start() {
+	ebegin "Starting heimdal kadmind"
+		/usr/sbin/kadmind  &
+		echo $! > /var/run/heimdal-kadmind.pid
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping heimdal kadmind"
+	start-stop-daemon --stop --quiet --exec \
+		/usr/sbin/kadmind
+	eend $?
+}
diff --git a/testing/heimdal/heimdal-kdc.init b/testing/heimdal/heimdal-kdc.init
new file mode 100755
index 0000000..753a101
--- /dev/null
+++ b/testing/heimdal/heimdal-kdc.init
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/heimdal/files/heimdal-kdc,v 1.2 2004/09/13 15:40:34 dragonheart Exp $
+
+depend() {
+	need net
+	after logger
+}
+
+start() {
+	ebegin "Starting heimdal kdc"
+	start-stop-daemon --start --quiet --exec \
+		/usr/sbin/kdc -- --detach
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping heimdal kdc"
+	start-stop-daemon --stop --quiet --exec \
+		/usr/sbin/kdc
+	eend $?
+}
diff --git a/testing/heimdal/heimdal-kpasswdd.init b/testing/heimdal/heimdal-kpasswdd.init
new file mode 100755
index 0000000..517cb86
--- /dev/null
+++ b/testing/heimdal/heimdal-kpasswdd.init
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/heimdal/files/heimdal-kpasswdd,v 1.3 2004/09/13 22:44:54 solar Exp $
+
+depend() {
+	need net
+	use heimdal-kdc
+	after logger
+}
+
+start() {
+	ebegin "Starting heimdal kpasswdd"
+	start-stop-daemon --background --start --quiet --exec \
+		/usr/sbin/kpasswdd
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping heimdal kpasswdd"
+	start-stop-daemon --stop --quiet --exec \
+		/usr/sbin/kpasswdd
+	eend $?
+}
-- 
1.6.2.3

---

From: Natanael Copa <[email-masked]>
Date: Thu, 14 May 2009 14:52:16 +0200

> Please review attached patch

applied.
thanks alot!

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Thu, 14 May 2009 14:57:17 +0200

> Please review attached patch

btw... since the contents of package changed, the pkgrel should be
increased. Otherwise will not buildozer rebuild it.

Thats not needed when end package does not change, like when you append
a missing makedepends.

-nc

---

---

From: Leonardo Arena <[email-masked]>
Date: Thu, 14 May 2009 15:06:04 +0200

> increased. Otherwise will not buildozer rebuild it.

Done. Thanks for reminding

> Thats not needed when end package does not change, like when you append
More clients moved in subpkg. Maintainer set.
please review
leo
From 6f0ed5a4689234ae1ea9531cac7ef3884c974497 Mon Sep 17 00:00:00 2001
From: Leonardo Arena <[email-masked]>
Date: Thu, 14 May 2009 13:04:32 +0000
Subject: [PATCH] testing/heimdal: more clients in subpkgs

---
 testing/heimdal/APKBUILD |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/testing/heimdal/APKBUILD b/testing/heimdal/APKBUILD
index ba99648..2821ea9 100644
--- a/testing/heimdal/APKBUILD
+++ b/testing/heimdal/APKBUILD
@@ -1,14 +1,16 @@
-# Contributor: Leonardo Arena <[email-masked]>
+# Maintainer: Leonardo Arena <[email-masked]>
+# Contributor: Natanael Copa <[email-masked]>
 pkgname=heimdal
 pkgver=1.2.1
-pkgrel=0
+pkgrel=1
 pkgdesc="An implementation of Kerberos 5"
 url="http://www.h5l.org/"
 license="BSD"
 depends="uclibc sqlite readline openssl"
 makedepends="gawk readline-dev"
 install=
-subpackages="$pkgname-doc $pkgname-dev $pkgname-ftp $pkgname-telnet $pkgname-su $pkgname-rsh"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-ftp $pkgname-telnet \
+$pkgname-su $pkgname-rsh $pkgname-rcp $pkgname-pagsh $pkgname-kf"
 source="http://www.h5l.org/dist/src/$pkgname-$pkgver.tar.gz
 001_all_heimdal-no_libedit.patch
 002_all_heimdal-fPIC.patch
@@ -121,6 +123,21 @@ rsh() {
 	mv $pkgdir/usr/sbin/krshd $subpkgdir/usr/sbin/krshd
 }
 
+rcp() {
+        mkdir -p $subpkgdir/usr/bin/
+	mv $pkgdir/usr/bin/krcp $subpkgdir/usr/bin/krcp
+}
+
+pagsh() {
+        mkdir -p $subpkgdir/usr/bin/
+        mv $pkgdir/usr/bin/pagsh $subpkgdir/usr/bin/pagsh
+}
+
+kf() {
+        mkdir -p $subpkgdir/usr/bin/
+        mv $pkgdir/usr/bin/kf $subpkgdir/usr/bin/kf
+}
+
 md5sums="6e5028077e2a6b101a4a72801ba71b9e  heimdal-1.2.1.tar.gz
 98e28f11f906c967aac22d6184102c9e  001_all_heimdal-no_libedit.patch
 6d5571bdedba2e2423b90bccdbac2c0a  002_all_heimdal-fPIC.patch
-- 
1.6.2.3

---

From: Natanael Copa <[email-masked]>
Date: Thu, 14 May 2009 18:18:32 +0200

> More clients moved in subpkg. Maintainer set.

committed
thanks!

-nc

---