[oe-commits] Tom Rini : realpath: Add update-alternatives

git version control git at git.openembedded.org
Fri Nov 12 03:15:57 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: c711c4c6556bb8744023f3e44edffafc2d2fbfac
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=c711c4c6556bb8744023f3e44edffafc2d2fbfac

Author: Tom Rini <tom_rini at mentor.com>
Date:   Thu Nov 11 20:07:30 2010 -0700

realpath: Add update-alternatives

Signed-off-by: Tom Rini <tom_rini at mentor.com>

---

 recipes/realpath/realpath_1.10.bb |   11 ++++++++++-
 recipes/realpath/realpath_1.15.bb |   12 ++++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/recipes/realpath/realpath_1.10.bb b/recipes/realpath/realpath_1.10.bb
index cd24dab..c6e8d7f 100644
--- a/recipes/realpath/realpath_1.10.bb
+++ b/recipes/realpath/realpath_1.10.bb
@@ -2,6 +2,7 @@ DESCRIPTION = "Return the canonicalized absolute pathname"
 SECTION = "utility"
 PRIORITY = "optional"
 LICENSE = "GPLv2"
+PR = "r1"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/r/realpath/realpath_${PV}.tar.gz;name=realpath \
            file://makefile.patch"
@@ -13,5 +14,13 @@ CFLAGS += "-DVERSION=${PV}"
 
 do_install () {
 	install -d ${D}${bindir}
-	install -p -m 0755 ${S}/realpath ${D}${bindir}
+	install -p -m 0755 ${S}/realpath ${D}${bindir}/realpath.${PN}
+}
+
+pkg_postinst_${PN} () {
+	update-alternatives --install ${bindir}/realpath realpath realpath.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+	update-alternatives --remove realpath realpath.${PN}
 }
diff --git a/recipes/realpath/realpath_1.15.bb b/recipes/realpath/realpath_1.15.bb
index d4001d3..74ffe5a 100644
--- a/recipes/realpath/realpath_1.15.bb
+++ b/recipes/realpath/realpath_1.15.bb
@@ -2,8 +2,8 @@ DESCRIPTION = "Return the canonicalized absolute pathname"
 SECTION = "utility"
 PRIORITY = "optional"
 LICENSE = "GPLv2"
+PR = "r2"
 
-PR = "r1"
 SRC_URI = "${DEBIAN_MIRROR}/main/r/realpath/realpath_${PV}.tar.gz;name=realpath \
 	   file://fix-common-mk.patch \
 	   file://no-po4a.patch  \
@@ -15,7 +15,15 @@ TARGET_CC_ARCH += "${LDFLAGS}"
 
 do_install () {
 	install -d ${D}${bindir}
-	install -p -m 0755 ${S}/src/_build/realpath ${D}${bindir}	
+	install -p -m 0755 ${S}/src/_build/realpath ${D}${bindir}/realpath.${PN}
+}
+
+pkg_postinst_${PN} () {
+	update-alternatives --install ${bindir}/realpath realpath realpath.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+	update-alternatives --remove realpath realpath.${PN}
 }
 
 SRC_URI[realpath.md5sum] = "3351ce6e3d0ce255641c8ca9216a8638"





More information about the Openembedded-commits mailing list