summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc')
-rw-r--r--meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc78
1 files changed, 78 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc
new file mode 100644
index 000000000..ef183d702
--- /dev/null
+++ b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc
@@ -0,0 +1,78 @@
1DESCRIPTION = "Alternative system logger daemon"
2DEPENDS = "libol flex eventlog glib-2.0"
3LICENSE = "GPL LGPL"
4LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408"
5
6# syslog initscript is handled explicitly because order of
7# update-rc.d and update-alternatives is important
8RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}"
9
10INC_PR = "r6"
11
12inherit autotools
13
14SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz"
15
16noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}"
17
18EXTRA_OECONF = " \
19 --with-libnet=${STAGING_BINDIR_CROSS} \
20 --enable-dynamic-linking \
21 ${noipv6} \
22 --enable-ssl \
23 --disable-sub-streams \
24 --disable-pacct \
25 --disable-linux-caps \
26 --disable-pcre \
27 --disable-sql \
28"
29
30do_configure_prepend() {
31 eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}"
32}
33
34do_install_append() {
35 install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf
36 install -d ${D}/${sysconfdir}/init.d
37 install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN}
38}
39
40CONFFILES_${PN} = "${sysconfdir}/${PN}.conf"
41
42pkg_postinst_${PN} () {
43 /etc/init.d/syslog stop
44 update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200
45
46 if test "x$D" != "x"; then
47 OPT="-r $D"
48 else
49 OPT="-s"
50 fi
51 # remove all rc.d-links potentially created from alternative
52 # syslog packages before creating new ones
53 update-rc.d $OPT -f syslog remove
54 update-rc.d $OPT syslog start 20 2 3 4 5 . stop 90 0 1 6 .
55}
56
57pkg_prerm_${PN} () {
58 if test "x$D" = "x"; then
59 if test "$1" = "upgrade" -o "$1" = "remove"; then
60 /etc/init.d/syslog stop
61 fi
62 fi
63
64 update-alternatives --remove syslog-init syslog.${PN}
65}
66
67pkg_postrm_${PN} () {
68 if test "x$D" != "x"; then
69 OPT="-r $D"
70 else
71 OPT=""
72 fi
73 if test "$1" = "remove" -o "$1" = "purge"; then
74 if ! test -e "/etc/init.d/syslog"; then
75 update-rc.d $OPT syslog remove
76 fi
77 fi
78}