Patchwork pigz: Add update-altneratives support since this otherwise conflicts with busybox/gzip

login
register
mail settings
Submitter Richard Purdie
Date March 21, 2012, 2:29 p.m.
Message ID <1332340189.9740.161.camel@ted>
Download mbox | patch
Permalink /patch/24017/
State Accepted
Commit 8903327ff483cd3dbde8cf692be2092462265188
Headers show

Comments

Richard Purdie - March 21, 2012, 2:29 p.m.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/meta/recipes-extended/pigz/pigz.inc b/meta/recipes-extended/pigz/pigz.inc
index 5fda8ca..e1cbc8b 100644
--- a/meta/recipes-extended/pigz/pigz.inc
+++ b/meta/recipes-extended/pigz/pigz.inc
@@ -15,7 +15,18 @@  PROVIDES_virtclass-native += "gzip-native"
 DEPENDS = "zlib"
 
 do_install () {
-        install -d ${D}${bindir}
-        install ${B}/pigz ${D}${bindir}/gzip
-        install ${B}/unpigz ${D}${bindir}/gunzip
+	if [ "${PN}" = "${BPN}" ] ; then
+		# Install files into /bin (FHS), which is typical place for gzip
+	        install -d ${D}${base_bindir}	        
+		install ${B}/pigz ${D}${base_bindir}/gzip
+	        install ${B}/unpigz ${D}${base_bindir}/gunzip
+	else
+	        install -d ${D}${bindir}
+	        install ${B}/pigz ${D}${bindir}/gzip
+	        install ${B}/unpigz ${D}${bindir}/gunzip
+	fi
 }
+
+ALTERNATIVE_LINKS = "${base_bindir}/gzip ${base_bindir}/gunzip"
+ALTERNATIVE_PRIORITY = "80"
+
diff --git a/meta/recipes-extended/pigz/pigz_2.2.4.bb b/meta/recipes-extended/pigz/pigz_2.2.4.bb
index eaf00c6..e76c49c 100644
--- a/meta/recipes-extended/pigz/pigz_2.2.4.bb
+++ b/meta/recipes-extended/pigz/pigz_2.2.4.bb
@@ -1,6 +1,6 @@ 
 require pigz.inc
 
-PR = "r1"
+PR = "r2"
 
 NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"