diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2014-07-17 05:37:08 -0400 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-07-24 15:31:50 +0200 |
commit | 1a6e16bcb1145df51b15c19df0d7ef655b683f5e (patch) | |
tree | 836b30d519b105b5a6a49d8c81ab83a4eb38258b /meta-oe/recipes-support/syslog-ng/syslog-ng.inc | |
parent | b8a40ca5d4cdd457eb3fa25359e56d2e64c94b88 (diff) | |
download | meta-openembedded-1a6e16bcb1145df51b15c19df0d7ef655b683f5e.tar.gz |
syslog-ng: uprev to 3.5.4.1
- initscript: add status, PIDFILE and xconsole
- syslog-ng.conf: dump the version
- Fix some memory leak problems we found
- Some backport patches
- scl: fix wrong ownership issue
- libnet: add libnet enable option and add it in PACKAGECONFIG
- add HOMEPAGE
- remove INC_PR
- change some config into PACKAGECONFIG
- add PACKAGE syslog-ng-libs to fix QA issue
- use volatiles
- inherit update-rc.d and update-alternative
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/syslog-ng/syslog-ng.inc')
-rw-r--r-- | meta-oe/recipes-support/syslog-ng/syslog-ng.inc | 134 |
1 files changed, 63 insertions, 71 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc index e0c905597..01c9b202c 100644 --- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc | |||
@@ -1,98 +1,90 @@ | |||
1 | DESCRIPTION = "Alternative system logger daemon" | 1 | SUMMARY = "Alternative system logger daemon" |
2 | DEPENDS = "libol flex eventlog glib-2.0" | 2 | DESCRIPTION = "syslog-ng, as the name shows, is a syslogd replacement, \ |
3 | LICENSE = "GPL LGPL" | 3 | but with new functionality for the new generation. The original syslogd \ |
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5" | 4 | allows messages only to be sorted based on priority/facility pairs; \ |
5 | 5 | syslog-ng adds the possibility to filter based on message contents using \ | |
6 | # syslog initscript is handled explicitly because order of | 6 | regular expressions. The new configuration scheme is intuitive and powerful. \ |
7 | # update-rc.d and update-alternatives is important | 7 | Forwarding logs over TCP and remembering all forwarding hops makes it \ |
8 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | 8 | ideal for firewalled environments. \ |
9 | " | ||
10 | HOMEPAGE = "http://www.balabit.com/network-security/syslog-ng/opensource-logging-system" | ||
9 | 11 | ||
10 | INC_PR = "r12" | 12 | LICENSE = "GPLv2 & LGPLv2.1" |
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408" | ||
11 | 14 | ||
12 | inherit autotools systemd | 15 | DEPENDS = "flex eventlog glib-2.0" |
13 | 16 | ||
14 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${BPN}_${PV}.tar.gz" | 17 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${BPN}_${PV}.tar.gz \ |
18 | file://syslog-ng.conf \ | ||
19 | file://initscript \ | ||
20 | file://volatiles.03_syslog-ng \ | ||
21 | " | ||
15 | 22 | ||
16 | noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}" | 23 | inherit autotools systemd pkgconfig update-rc.d update-alternatives |
17 | 24 | ||
18 | EXTRA_OECONF = " \ | 25 | EXTRA_OECONF = " \ |
19 | --with-libnet=${STAGING_BINDIR_CROSS} \ | ||
20 | --enable-dynamic-linking \ | 26 | --enable-dynamic-linking \ |
21 | ${noipv6} \ | ||
22 | --enable-ssl \ | ||
23 | --disable-sub-streams \ | 27 | --disable-sub-streams \ |
24 | --disable-pacct \ | 28 | --disable-pacct \ |
25 | --disable-linux-caps \ | 29 | --localstatedir=${localstatedir}/run/${BPN} \ |
26 | --disable-pcre \ | 30 | --sysconfdir=${sysconfdir}/${BPN} \ |
27 | --disable-sql \ | 31 | --with-module-dir=${libdir}/${BPN} \ |
32 | --with-sysroot=${STAGING_DIR_HOST} \ | ||
28 | " | 33 | " |
29 | 34 | ||
30 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" | 35 | PACKAGECONFIG ??= "openssl \ |
31 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)}" | 36 | ${@base_contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \ |
37 | ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ | ||
38 | " | ||
39 | PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl,openssl," | ||
40 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,," | ||
41 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd," | ||
42 | PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap," | ||
43 | PACKAGECONFIG[pcre] = "--enable-pcre,--disable-pcre,libpcre," | ||
44 | PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi," | ||
45 | PACKAGECONFIG[libnet] = "--enable-libnet --with-libnet=${STAGING_BINDIR_CROSS},--disable-libnet,libnet," | ||
46 | PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp," | ||
32 | 47 | ||
33 | do_configure_prepend() { | 48 | do_configure_prepend() { |
34 | eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}" | 49 | eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}" |
35 | } | 50 | } |
36 | 51 | ||
37 | # rename modules.conf because it breaks update-modules | ||
38 | # see http://lists.linuxtogo.org/pipermail/openembedded-devel/2011-October/035537.html | ||
39 | do_install_append() { | 52 | do_install_append() { |
40 | mv ${D}/${sysconfdir}/modules.conf ${D}/${sysconfdir}/scl-modules.conf | 53 | install -d ${D}/${sysconfdir}/${BPN} |
41 | sed -i "s#@include 'modules.conf'#@include 'scl-modules.conf'#g" ${D}/${sysconfdir}/scl.conf | 54 | install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf |
42 | install -d ${D}/${sysconfdir}/${PN} | ||
43 | install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf | ||
44 | install -d ${D}/${sysconfdir}/init.d | 55 | install -d ${D}/${sysconfdir}/init.d |
45 | install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN} | 56 | install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${BPN} |
57 | install -d ${D}/${sysconfdir}/default/volatiles/ | ||
58 | install -m 755 ${WORKDIR}/volatiles.03_syslog-ng ${D}/${sysconfdir}/default/volatiles/03_syslog-ng | ||
59 | |||
60 | # Remove /var/run as it is created on startup | ||
61 | rm -rf ${D}${localstatedir}/run | ||
46 | } | 62 | } |
47 | 63 | ||
48 | FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \ | 64 | FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools" |
49 | ${sysconfdir} ${sharedstatedir} ${localstatedir} \ | 65 | |
50 | ${base_bindir}/* ${base_sbindir}/* \ | 66 | # This overcomes the syslog-ng rdepends on syslog-ng-dev QA Error |
51 | ${base_libdir}/*${SOLIBS} \ | 67 | PACKAGES =+ "${PN}-libs ${PN}-libs-dev ${PN}-libs-dbg" |
52 | ${datadir}/${BPN} ${libdir}/${BPN}/*${SOLIBS} \ | 68 | FILES_${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*" |
53 | ${datadir}/include/scl/ ${datadir}/xsd" | 69 | FILES_${PN}-libs-dev = "${libdir}/${BPN}/lib*.la" |
54 | FILES_${PN}-dev += "${libdir}/${BPN}/lib*.la ${libdir}/${BPN}/*${SOLIBSDEV}" | 70 | FILES_${PN}-libs-dbg = "${libdir}/${BPN}/.debug" |
55 | CONFFILES_${PN} = "${sysconfdir}/${PN}.conf ${sysconfdir}/scl.conf ${sysconfdir}/scl-modules.conf" | 71 | INSANE_SKIP_${PN}-libs = "dev-so" |
72 | RDEPENDS_${PN} += "${PN}-libs" | ||
73 | |||
74 | CONFFILES_${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf" | ||
75 | |||
76 | # syslog initscript is handled explicitly because order of | ||
77 | # update-rc.d and update-alternatives is important | ||
78 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | ||
56 | 79 | ||
57 | RPROVIDES_${PN} += "${PN}-systemd" | 80 | RPROVIDES_${PN} += "${PN}-systemd" |
58 | RREPLACES_${PN} += "${PN}-systemd" | 81 | RREPLACES_${PN} += "${PN}-systemd" |
59 | RCONFLICTS_${PN} += "${PN}-systemd" | 82 | RCONFLICTS_${PN} += "${PN}-systemd" |
60 | SYSTEMD_SERVICE_${PN} = "${PN}.service" | 83 | SYSTEMD_SERVICE_${PN} = "${PN}.service" |
61 | 84 | ||
62 | pkg_postinst_${PN} () { | 85 | ALTERNATIVE_${PN} = "syslog-init" |
63 | /etc/init.d/syslog stop | 86 | ALTERNATIVE_PRIORITY[syslog-init] = "200" |
64 | update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200 | 87 | ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog" |
65 | |||
66 | if test "x$D" != "x"; then | ||
67 | OPT="-r $D" | ||
68 | else | ||
69 | OPT="-s" | ||
70 | fi | ||
71 | # remove all rc.d-links potentially created from alternative | ||
72 | # syslog packages before creating new ones | ||
73 | update-rc.d $OPT -f syslog remove | ||
74 | update-rc.d $OPT syslog start 20 2 3 4 5 . stop 90 0 1 6 . | ||
75 | } | ||
76 | 88 | ||
77 | pkg_prerm_${PN} () { | 89 | INITSCRIPT_NAME = "syslog" |
78 | if test "x$D" = "x"; then | 90 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ." |
79 | if test "$1" = "upgrade" -o "$1" = "remove"; then | ||
80 | /etc/init.d/syslog stop | ||
81 | fi | ||
82 | fi | ||
83 | |||
84 | update-alternatives --remove syslog-init syslog.${PN} | ||
85 | } | ||
86 | |||
87 | pkg_postrm_${PN} () { | ||
88 | if test "x$D" != "x"; then | ||
89 | OPT="-r $D" | ||
90 | else | ||
91 | OPT="" | ||
92 | fi | ||
93 | if test "$1" = "remove" -o "$1" = "purge"; then | ||
94 | if ! test -e "/etc/init.d/syslog"; then | ||
95 | update-rc.d $OPT syslog remove | ||
96 | fi | ||
97 | fi | ||
98 | } | ||