summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-04-16 11:15:35 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-26 10:05:08 +0100
commit469a4b9d8ad5d6c6a7572bdbbdbbaea4a11c71e4 (patch)
treee50dc40b0dc40338b13da4c997cebaf2027934d9
parent46ffeed9183ec12ff20dbb5c5b46ea35555835d5 (diff)
downloadpoky-469a4b9d8ad5d6c6a7572bdbbdbbaea4a11c71e4.tar.gz
gzip: Use update-alternatives class
Switch to using the update-alternatives class. Need this for consistency and to ensure the necessary package provides get set. (From OE-Core rev: e0626a0270fb0f4ff128e761c13d44162723434c) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/gzip/gzip.inc32
-rw-r--r--meta/recipes-extended/gzip/gzip_1.3.12.bb24
-rw-r--r--meta/recipes-extended/gzip/gzip_1.4.bb2
3 files changed, 18 insertions, 40 deletions
diff --git a/meta/recipes-extended/gzip/gzip.inc b/meta/recipes-extended/gzip/gzip.inc
index a44944923c..1d608a6713 100644
--- a/meta/recipes-extended/gzip/gzip.inc
+++ b/meta/recipes-extended/gzip/gzip.inc
@@ -12,29 +12,15 @@ SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
12 12
13inherit autotools 13inherit autotools
14 14
15do_install () { 15do_install_append () {
16 autotools_do_install 16 # Rename and move files into /bin (FHS), which is typical place for gzip
17 if [ "${PN}" = "${BPN}" ] ; then 17 install -d ${D}${base_bindir}
18 # Rename and move files into /bin (FHS), which is typical place for gzip 18 mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip
19 install -d ${D}${base_bindir} 19 mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip
20 mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip.${PN} 20 mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat
21 mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip.${PN}
22 mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat.${PN}
23 fi
24} 21}
25 22
26pkg_postinst_${PN} () { 23inherit update-alternatives
27 if [ "${PN}" = "${BPN}" ] ; then
28 update-alternatives --install ${base_bindir}/gunzip gunzip gunzip.${PN} 100
29 update-alternatives --install ${base_bindir}/gzip gzip gzip.${PN} 100
30 update-alternatives --install ${base_bindir}/zcat zcat zcat.${PN} 100
31 fi
32}
33 24
34pkg_prerm_${PN} () { 25ALTERNATIVE_LINKS = "${base_bindir}/gunzip ${base_bindir}/gzip ${base_bindir}/zcat"
35 if [ "${PN}" = "${BPN}" ] ; then 26ALTERNATIVE_PRIORITY = "100"
36 update-alternatives --remove gunzip gunzip.${PN}
37 update-alternatives --remove gzip gzip.${PN}
38 update-alternatives --remove zcat zcat.${PN}
39 fi
40}
diff --git a/meta/recipes-extended/gzip/gzip_1.3.12.bb b/meta/recipes-extended/gzip/gzip_1.3.12.bb
index 2836942f8b..6d18d47cb8 100644
--- a/meta/recipes-extended/gzip/gzip_1.3.12.bb
+++ b/meta/recipes-extended/gzip/gzip_1.3.12.bb
@@ -16,29 +16,21 @@ SRC_URI = "${GNU_MIRROR}/gzip/gzip-${PV}.tar.gz \
16SRC_URI[md5sum] = "b5bac2d21840ae077e0217bc5e4845b1" 16SRC_URI[md5sum] = "b5bac2d21840ae077e0217bc5e4845b1"
17SRC_URI[sha256sum] = "3f565be05f7f3d1aff117c030eb7c738300510b7d098cedea796ca8e4cd587af" 17SRC_URI[sha256sum] = "3f565be05f7f3d1aff117c030eb7c738300510b7d098cedea796ca8e4cd587af"
18 18
19PR = "r0" 19PR = "r1"
20 20
21inherit autotools 21inherit autotools
22 22
23do_install () { 23do_install_append () {
24 autotools_do_install
25 # move files into /bin (FHS) 24 # move files into /bin (FHS)
26 install -d ${D}${base_bindir} 25 install -d ${D}${base_bindir}
27 mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip.${PN} 26 mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip
28 mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip.${PN} 27 mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip
29 mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat.${PN} 28 mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat
30} 29}
31 30
32pkg_postinst_${PN} () { 31inherit update-alternatives
33 update-alternatives --install ${base_bindir}/gunzip gunzip gunzip.${PN} 100
34 update-alternatives --install ${base_bindir}/gzip gzip gzip.${PN} 100
35 update-alternatives --install ${base_bindir}/zcat zcat zcat.${PN} 100
36}
37 32
38pkg_prerm_${PN} () { 33ALTERNATIVE_LINKS = "${base_bindir}/gunzip ${base_bindir}/gzip ${base_bindir}/zcat"
39 update-alternatives --remove gunzip gunzip.${PN} 34ALTERNATIVE_PRIORITY = "100"
40 update-alternatives --remove gzip gzip.${PN}
41 update-alternatives --remove zcat zcat.${PN}
42}
43 35
44BBCLASSEXTEND = "native" 36BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/gzip/gzip_1.4.bb b/meta/recipes-extended/gzip/gzip_1.4.bb
index 8f4a237ec3..54dd50a96b 100644
--- a/meta/recipes-extended/gzip/gzip_1.4.bb
+++ b/meta/recipes-extended/gzip/gzip_1.4.bb
@@ -1,6 +1,6 @@
1require gzip.inc 1require gzip.inc
2 2
3PR = "r1" 3PR = "r2"
4 4
5NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}" 5NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
6 6