Patchwork [resend] netkit-base-0.17: use update-alternatives

login
register
mail settings
Submitter Andreas Oberritter
Date Feb. 24, 2011, 2:07 a.m.
Message ID <1298513240-2010-1-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/801/
State Accepted
Headers show

Comments

Andreas Oberritter - Feb. 24, 2011, 2:07 a.m.
* Give netkit-inetd a priority of 70.
* Add inetd.conf to CONFFILES_${PN}.
* RPROVIDE inetd.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
Last time, this patch didn't make it into patchwork. The patch to
create an inetd package for busybox has already been merged.

 recipes/netkit-base/netkit-base_0.17.bb |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Patch

diff --git a/recipes/netkit-base/netkit-base_0.17.bb b/recipes/netkit-base/netkit-base_0.17.bb
index 8ab8935..19fdaee 100644
--- a/recipes/netkit-base/netkit-base_0.17.bb
+++ b/recipes/netkit-base/netkit-base_0.17.bb
@@ -1,7 +1,8 @@ 
 SECTION = "base"
 DESCRIPTION = "netkit-base includes the inetd daemon."
 LICENSE = "BSD"
-PR = "r2"
+RPROVIDES_${PN} = "inetd"
+PR = "r3"
 
 SRC_URI = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-base-${PV}.tar.gz \
            file://configure.patch \
@@ -28,10 +29,18 @@  do_compile () {
 do_install () {
 	install -d ${D}${sysconfdir}/init.d ${D}${sbindir}
 	install -m 0755 inetd/inetd ${D}${sbindir}/inetd
-	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/inetd
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/inetd.${PN}
 	install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}
 }
 
+pkg_prerm_${PN} () {
+        update-alternatives --remove inetd-init inetd.${PN}
+}
+pkg_postinst_${PN} () {
+        update-alternatives --install ${sysconfdir}/init.d/inetd inetd-init inetd.${PN} 70
+}
+
+CONFFILES_${PN} = "${sysconfdir}/inetd.conf"
 
 SRC_URI[md5sum] = "1f0193358e92559ec0f598b09ccbc0ec"
 SRC_URI[sha256sum] = "16dd81625ebfc8f5dcb0dfd2e6bac223aad325a9405d66a556fe349446b3c332"