summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/sysklogd/sysklogd.inc
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-21 16:18:58 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 12:04:44 +0100
commitc17ae6f07b4e897e87df6ac7d76daa5bd0fc3995 (patch)
treefaf3b6c9b05305e9a3846de50798ea8a73d2d404 /meta/recipes-extended/sysklogd/sysklogd.inc
parent5cbc48638e2d52278f2ac466b3f59a2ec6aa60d5 (diff)
downloadpoky-c17ae6f07b4e897e87df6ac7d76daa5bd0fc3995.tar.gz
sysklogd: use new update-alternatives
(From OE-Core rev: c32dca4013d851aeb9d661a25cab81daf213121f) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/sysklogd/sysklogd.inc')
-rw-r--r--meta/recipes-extended/sysklogd/sysklogd.inc29
1 files changed, 14 insertions, 15 deletions
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
index fb2ddb2013..151babb34a 100644
--- a/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -25,7 +25,7 @@ SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar
25SRC_URI_append_e500v2 = " file://no-vectorization.patch" 25SRC_URI_append_e500v2 = " file://no-vectorization.patch"
26 26
27INITSCRIPT_NAME = "syslog" 27INITSCRIPT_NAME = "syslog"
28CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${PN}" 28CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
29 29
30CFLAGS_append = " -DSYSV" 30CFLAGS_append = " -DSYSV"
31 31
@@ -35,12 +35,10 @@ do_install () {
35 ${D}${base_sbindir} 35 ${D}${base_sbindir}
36 oe_runmake 'BINDIR=${D}${base_sbindir}' \ 36 oe_runmake 'BINDIR=${D}${base_sbindir}' \
37 'MANDIR=${D}${mandir}' install 37 'MANDIR=${D}${mandir}' install
38 mv ${D}${base_sbindir}/syslogd ${D}${base_sbindir}/syslogd.${PN}
39 mv ${D}${base_sbindir}/klogd ${D}${base_sbindir}/klogd.${PN}
40 install -d ${D}${sysconfdir} 38 install -d ${D}${sysconfdir}
41 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${PN} 39 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
42 install -d ${D}${sysconfdir}/init.d 40 install -d ${D}${sysconfdir}/init.d
43 install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog.${PN} 41 install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
44} 42}
45 43
46pkg_preinst_${PN} () { 44pkg_preinst_${PN} () {
@@ -57,12 +55,18 @@ pkg_preinst_${PN} () {
57 fi 55 fi
58} 56}
59 57
60pkg_postinst_${PN} () { 58inherit update-alternatives
61 update-alternatives --install ${base_sbindir}/syslogd syslogd syslogd.${PN} 100 59
62 update-alternatives --install ${base_sbindir}/klogd klogd klogd.${PN} 100 60ALTERNATIVE_PRIORITY = "100"
63 update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 100 61
64 update-alternatives --install ${sysconfdir}/syslog.conf syslog-conf syslog.conf.${PN} 100 62ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
65 63
64ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
65ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
66ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
67ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
68
69pkg_postinst_${PN} () {
66 if test "x$D" != "x"; then 70 if test "x$D" != "x"; then
67 OPT="-r $D" 71 OPT="-r $D"
68 else 72 else
@@ -72,16 +76,11 @@ pkg_postinst_${PN} () {
72} 76}
73 77
74pkg_prerm_${PN} () { 78pkg_prerm_${PN} () {
75 update-alternatives --remove syslogd syslogd.${PN}
76 update-alternatives --remove klogd klogd.${PN}
77
78 if test "x$D" = "x"; then 79 if test "x$D" = "x"; then
79 if test "$1" = "upgrade" -o "$1" = "remove"; then 80 if test "$1" = "upgrade" -o "$1" = "remove"; then
80 /etc/init.d/syslog stop 81 /etc/init.d/syslog stop
81 fi 82 fi
82 fi 83 fi
83 update-alternatives --remove syslog-init syslog.${PN}
84 update-alternatives --remove syslog-conf syslog.conf.${PN}
85} 84}
86 85
87pkg_postrm_${PN} () { 86pkg_postrm_${PN} () {