netcat: use update-alternatives class (thx Koen)
authorMarcin Juszkiewicz <hrw@openembedded.org>
Tue, 19 May 2009 19:34:57 +0000 (21:34 +0200)
committerMarcin Juszkiewicz <hrw@openembedded.org>
Tue, 19 May 2009 19:46:45 +0000 (21:46 +0200)
recipes/netcat/netcat_0.7.1.bb

index cc5b9e2..7c4dfc5 100644 (file)
@@ -2,20 +2,17 @@ DESCRIPTION = "GNU Netcat"
 HOMEPAGE = "http://netcat.sourceforge.net"
 SECTION = "console/network"
 LICENSE = "GPLv2"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/netcat/netcat-${PV}.tar.bz2"
 
-inherit autotools
+inherit autotools update-alternatives
 
 do_install_append() {
        mv ${D}${bindir}/nc ${D}${bindir}/nc.${PN}
 }
 
-pkg_postinst_${PN} () {
-       update-alternatives --install ${bindir}/nc nc nc.${PN} 100
-}
-
-pkg_prerm_${PN} () {
-       update-alternatives --remove nc nc.${PN}
-}
+ALTERNATIVE_NAME = "nc"
+ALTERNATIVE_LINK = "${bindir}/nc"
+ALTERNATIVE_PATH = "${bindir}/nc.${PN}"
+ALTERNATIVE_PRIORITY = "100"