Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | SUMMARY = "Alternative system logger daemon" |
| 2 | DESCRIPTION = "syslog-ng, as the name shows, is a syslogd replacement, \ |
| 3 | but with new functionality for the new generation. The original syslogd \ |
| 4 | allows messages only to be sorted based on priority/facility pairs; \ |
| 5 | syslog-ng adds the possibility to filter based on message contents using \ |
| 6 | regular expressions. The new configuration scheme is intuitive and powerful. \ |
| 7 | Forwarding logs over TCP and remembering all forwarding hops makes it \ |
| 8 | ideal for firewalled environments. \ |
| 9 | " |
| 10 | HOMEPAGE = "http://www.balabit.com/network-security/syslog-ng/opensource-logging-system" |
| 11 | |
| 12 | LICENSE = "GPLv2 & LGPLv2.1" |
| 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408" |
| 14 | |
| 15 | # util-linux added to get libuuid |
| 16 | DEPENDS = "libpcre flex eventlog glib-2.0 util-linux" |
| 17 | |
| 18 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${BPN}_${PV}.tar.gz \ |
| 19 | file://syslog-ng.conf \ |
| 20 | file://initscript \ |
| 21 | file://volatiles.03_syslog-ng \ |
| 22 | file://configure.ac-add-option-enable-thread-tls-to-manage-.patch \ |
| 23 | " |
| 24 | |
| 25 | inherit autotools systemd pkgconfig update-alternatives update-rc.d |
| 26 | |
| 27 | EXTRA_OECONF = " \ |
| 28 | --enable-dynamic-linking \ |
| 29 | --disable-sub-streams \ |
| 30 | --disable-pacct \ |
| 31 | --localstatedir=${localstatedir}/lib/${BPN} \ |
| 32 | --sysconfdir=${sysconfdir}/${BPN} \ |
| 33 | --with-module-dir=${libdir}/${BPN} \ |
| 34 | --with-sysroot=${STAGING_DIR_HOST} \ |
| 35 | --with-libmongo-client=no --disable-mongodb \ |
| 36 | --with-librabbitmq-client=no \ |
| 37 | ${CONFIG_TLS} \ |
| 38 | " |
| 39 | |
| 40 | CONFIG_TLS = "--enable-thread-tls" |
| 41 | CONFIG_TLS_arm = "${@base_conditional( "DEBUG_BUILD", "1", " --disable-thread-tls", " --enable-thread-tls", d )}" |
| 42 | |
| 43 | PACKAGECONFIG ??= "openssl \ |
| 44 | ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \ |
| 45 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
| 46 | " |
| 47 | PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl,openssl," |
| 48 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,," |
| 49 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd," |
| 50 | PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap," |
| 51 | PACKAGECONFIG[pcre] = "--enable-pcre,--disable-pcre,libpcre," |
| 52 | PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi," |
| 53 | PACKAGECONFIG[libnet] = "--enable-libnet --with-libnet=${STAGING_BINDIR_CROSS},--disable-libnet,libnet," |
| 54 | PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp," |
| 55 | PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c," |
| 56 | PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers," |
| 57 | PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip," |
| 58 | |
| 59 | do_configure_prepend() { |
| 60 | eval "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}" |
| 61 | } |
| 62 | |
| 63 | do_install_append() { |
| 64 | install -d ${D}/${sysconfdir}/${BPN} |
| 65 | install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf |
| 66 | install -d ${D}/${sysconfdir}/init.d |
| 67 | install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${BPN} |
| 68 | install -d ${D}/${sysconfdir}/default/volatiles/ |
| 69 | install -m 755 ${WORKDIR}/volatiles.03_syslog-ng ${D}/${sysconfdir}/default/volatiles/03_syslog-ng |
| 70 | install -d ${D}/${localstatedir}/lib/${BPN} |
| 71 | # Remove /var/run as it is created on startup |
| 72 | rm -rf ${D}${localstatedir}/run |
| 73 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${S}/contrib/systemd/*.service |
| 74 | sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${S}/contrib/systemd/*.service |
| 75 | sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${S}/contrib/systemd/*.service |
| 76 | } |
| 77 | |
| 78 | FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools" |
| 79 | RDEPENDS_${PN} += "gawk" |
| 80 | |
| 81 | # This overcomes the syslog-ng rdepends on syslog-ng-dev QA Error |
| 82 | PACKAGES =+ "${PN}-libs ${PN}-libs-dev ${PN}-libs-dbg" |
| 83 | FILES_${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*" |
| 84 | FILES_${PN}-libs-dev = "${libdir}/${BPN}/lib*.la" |
| 85 | FILES_${PN}-libs-dbg = "${libdir}/${BPN}/.debug" |
| 86 | FILES_${PN}-staticdev = "${libdir}/${BPN}/libtest/*.a" |
| 87 | INSANE_SKIP_${PN}-libs = "dev-so" |
| 88 | RDEPENDS_${PN} += "${PN}-libs" |
| 89 | |
| 90 | CONFFILES_${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf" |
| 91 | |
| 92 | # syslog initscript is handled explicitly because order of |
| 93 | # update-rc.d and update-alternatives is important |
| 94 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" |
| 95 | |
| 96 | RPROVIDES_${PN} += "${PN}-systemd" |
| 97 | RREPLACES_${PN} += "${PN}-systemd" |
| 98 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 99 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" |
| 100 | |
| 101 | # no syslog-init for systemd |
| 102 | python () { |
| 103 | if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 104 | pn = d.getVar('PN', True) |
| 105 | sysconfdir = d.getVar('sysconfdir', True) |
| 106 | d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init') |
| 107 | d.setVarFlag('ALTERNATIVE_PRIORITY', 'syslog-init', '200') |
| 108 | d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir)) |
| 109 | |
| 110 | if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d): |
| 111 | pn = d.getVar('PN', True) |
| 112 | d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service') |
| 113 | d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True))) |
| 114 | d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/${BPN}.service' % (d.getVar('systemd_unitdir', True))) |
| 115 | } |
| 116 | |
| 117 | INITSCRIPT_NAME = "syslog" |
| 118 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ." |