diff options
Diffstat (limited to 'meta-oe/recipes-support/syslog-ng/syslog-ng.inc')
| -rw-r--r-- | meta-oe/recipes-support/syslog-ng/syslog-ng.inc | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc new file mode 100644 index 0000000000..e0c9055977 --- /dev/null +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | DESCRIPTION = "Alternative system logger daemon" | ||
| 2 | DEPENDS = "libol flex eventlog glib-2.0" | ||
| 3 | LICENSE = "GPL LGPL" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=7ec1bcc46f28b11f4722e20d9b7dd4d5" | ||
| 5 | |||
| 6 | # syslog initscript is handled explicitly because order of | ||
| 7 | # update-rc.d and update-alternatives is important | ||
| 8 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | ||
| 9 | |||
| 10 | INC_PR = "r12" | ||
| 11 | |||
| 12 | inherit autotools systemd | ||
| 13 | |||
| 14 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${BPN}_${PV}.tar.gz" | ||
| 15 | |||
| 16 | noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}" | ||
| 17 | |||
| 18 | EXTRA_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 | |||
| 30 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" | ||
| 31 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)}" | ||
| 32 | |||
| 33 | 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)}" | ||
| 35 | } | ||
| 36 | |||
| 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() { | ||
| 40 | mv ${D}/${sysconfdir}/modules.conf ${D}/${sysconfdir}/scl-modules.conf | ||
| 41 | sed -i "s#@include 'modules.conf'#@include 'scl-modules.conf'#g" ${D}/${sysconfdir}/scl.conf | ||
| 42 | install -d ${D}/${sysconfdir}/${PN} | ||
| 43 | install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf | ||
| 44 | install -d ${D}/${sysconfdir}/init.d | ||
| 45 | install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN} | ||
| 46 | } | ||
| 47 | |||
| 48 | FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \ | ||
| 49 | ${sysconfdir} ${sharedstatedir} ${localstatedir} \ | ||
| 50 | ${base_bindir}/* ${base_sbindir}/* \ | ||
| 51 | ${base_libdir}/*${SOLIBS} \ | ||
| 52 | ${datadir}/${BPN} ${libdir}/${BPN}/*${SOLIBS} \ | ||
| 53 | ${datadir}/include/scl/ ${datadir}/xsd" | ||
| 54 | FILES_${PN}-dev += "${libdir}/${BPN}/lib*.la ${libdir}/${BPN}/*${SOLIBSDEV}" | ||
| 55 | CONFFILES_${PN} = "${sysconfdir}/${PN}.conf ${sysconfdir}/scl.conf ${sysconfdir}/scl-modules.conf" | ||
| 56 | |||
| 57 | RPROVIDES_${PN} += "${PN}-systemd" | ||
| 58 | RREPLACES_${PN} += "${PN}-systemd" | ||
| 59 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
| 60 | SYSTEMD_SERVICE_${PN} = "${PN}.service" | ||
| 61 | |||
| 62 | pkg_postinst_${PN} () { | ||
| 63 | /etc/init.d/syslog stop | ||
| 64 | update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200 | ||
| 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 | |||
| 77 | pkg_prerm_${PN} () { | ||
| 78 | if test "x$D" = "x"; then | ||
| 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 | } | ||
