diff options
author | Yu Ke <ke.yu@intel.com> | 2010-08-27 10:10:52 +0800 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-09-02 09:50:48 +0100 |
commit | df894c658d9df87b0b04fbb494d46d8eff0fd497 (patch) | |
tree | 716c831f92e4ac7f27d5d19c49ff928933760e56 /meta/recipes-extended/sysklogd/sysklogd.inc | |
parent | 8cbf96aeaf10182e97f5180d22eaf969f968202e (diff) | |
download | poky-df894c658d9df87b0b04fbb494d46d8eff0fd497.tar.gz |
sysklogd: add sysklogd 1.5
sysklogd implements two system log daemons: syslogd, klogd.
this commit adds sysklogd 1.5. it is ported from OE with some cleanup.
sysklogd: move to recipes-extended
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Saul Wold <Saul.Wold@intel.com>
Diffstat (limited to 'meta/recipes-extended/sysklogd/sysklogd.inc')
-rw-r--r-- | meta/recipes-extended/sysklogd/sysklogd.inc | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc new file mode 100644 index 0000000000..76ab707b21 --- /dev/null +++ b/meta/recipes-extended/sysklogd/sysklogd.inc | |||
@@ -0,0 +1,89 @@ | |||
1 | DESCRIPTION = "The sysklogd package implements two system log daemons: syslogd, klogd" | ||
2 | HOMEPAGE = "http://www.infodrom.org/projects/sysklogd/" | ||
3 | SECTION = "base" | ||
4 | |||
5 | LICENSE = "GPLv2+ & BSD" | ||
6 | LICENSE_syslogd = "BSD" | ||
7 | LICENSE_klogd = "GPLv2+" | ||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ | ||
9 | file://syslogd.c;beginline=2;endline=15;md5=77ffb2fec48c46d7ca0abb2d5813e7fd \ | ||
10 | file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \ | ||
11 | " | ||
12 | |||
13 | # syslog initscript is handled explicitly because order of | ||
14 | # update-rc.d and update-alternatives is important (see below) | ||
15 | DEPENDS_append = " update-rc.d update-rc.d-native" | ||
16 | RDEPENDS_${PN}_append = " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | ||
17 | |||
18 | SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \ | ||
19 | file://no-strip-install.patch \ | ||
20 | file://sysklogd \ | ||
21 | " | ||
22 | |||
23 | INITSCRIPT_NAME = "syslog" | ||
24 | |||
25 | CFLAGS_append = " -DSYSV" | ||
26 | |||
27 | do_install () { | ||
28 | install -d ${D}${mandir}/man8 \ | ||
29 | ${D}${mandir}/man5 \ | ||
30 | ${D}${base_sbindir} | ||
31 | oe_runmake 'BINDIR=${D}${base_sbindir}' \ | ||
32 | 'MANDIR=${D}${mandir}' install | ||
33 | mv ${D}${base_sbindir}/syslogd ${D}${base_sbindir}/syslogd.${PN} | ||
34 | mv ${D}${base_sbindir}/klogd ${D}${base_sbindir}/klogd.${PN} | ||
35 | install -d ${D}${sysconfdir} | ||
36 | install -m 644 ${S}/syslog.conf ${D}${sysconfdir}/syslog.conf | ||
37 | install -d ${D}${sysconfdir}/init.d | ||
38 | install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog.${PN} | ||
39 | } | ||
40 | |||
41 | pkg_preinst_${PN} () { | ||
42 | # all this is needed to avoid sysmlink errors, | ||
43 | # because update-rc.d runs before pkg_postinst | ||
44 | if [ -e ${sysconfdir}/init.d/syslog -a ! -L ${sysconfdir}/init.d/syslog ]; then | ||
45 | echo "WARNING:" "non symlink ${sysconfdir}/init.d/syslog exist -> backup to ${sysconfdir}/init.d/syslog.old" | ||
46 | mv ${sysconfdir}/init.d/syslog ${sysconfdir}/init.d/syslog.old | ||
47 | fi | ||
48 | if [ ! -e ${sysconfdir}/init.d/syslog ]; then | ||
49 | ln -s dummy ${sysconfdir}/init.d/syslog | ||
50 | fi | ||
51 | } | ||
52 | |||
53 | pkg_postinst_${PN} () { | ||
54 | update-alternatives --install ${base_sbindir}/syslogd syslogd syslogd.${PN} 100 | ||
55 | update-alternatives --install ${base_sbindir}/klogd klogd klogd.${PN} 100 | ||
56 | update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 100 | ||
57 | |||
58 | if test "x$D" != "x"; then | ||
59 | OPT="-r $D" | ||
60 | else | ||
61 | OPT="-s" | ||
62 | fi | ||
63 | update-rc.d $OPT syslog defaults | ||
64 | } | ||
65 | |||
66 | pkg_prerm_${PN} () { | ||
67 | update-alternatives --remove syslogd syslogd.${PN} | ||
68 | update-alternatives --remove klogd klogd.${PN} | ||
69 | |||
70 | if test "x$D" = "x"; then | ||
71 | if test "$1" = "upgrade" -o "$1" = "remove"; then | ||
72 | /etc/init.d/syslog stop | ||
73 | fi | ||
74 | fi | ||
75 | update-alternatives --remove syslog-init syslog.${PN} | ||
76 | } | ||
77 | |||
78 | pkg_postrm_${PN} () { | ||
79 | if test "x$D" != "x"; then | ||
80 | OPT="-r $D" | ||
81 | else | ||
82 | OPT="" | ||
83 | fi | ||
84 | if test "$1" = "remove" -o "$1" = "purge"; then | ||
85 | if ! test -e "/etc/init.d/syslog"; then | ||
86 | update-rc.d $OPT syslog remove | ||
87 | fi | ||
88 | fi | ||
89 | } | ||