| 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" | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240" | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 14 |  | 
 | 15 | # util-linux added to get libuuid | 
| Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 16 | DEPENDS = "libpcre flex glib-2.0 openssl util-linux bison-native" | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 17 |  | 
| Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 18 | # We expect the recipe to add anything specific for that version to these defaults. | 
 | 19 | # | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 20 | SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \ | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 21 |            file://syslog-ng.conf.systemd \ | 
 | 22 |            file://syslog-ng.conf.sysvinit \ | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 23 |            file://initscript \ | 
 | 24 |            file://volatiles.03_syslog-ng \ | 
 | 25 |            file://configure.ac-add-option-enable-thread-tls-to-manage-.patch \ | 
 | 26 | " | 
 | 27 |  | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 28 | UPSTREAM_CHECK_URI = "https://github.com/balabit/syslog-ng/releases" | 
 | 29 |  | 
| Brad Bishop | 996bc45 | 2019-12-02 13:05:15 -0500 | [diff] [blame] | 30 | inherit autotools gettext systemd pkgconfig update-rc.d multilib_header | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 31 |  | 
 | 32 | EXTRA_OECONF = " \ | 
 | 33 |     --enable-dynamic-linking \ | 
 | 34 |     --disable-sub-streams \ | 
 | 35 |     --disable-pacct \ | 
 | 36 |     --localstatedir=${localstatedir}/lib/${BPN} \ | 
 | 37 |     --sysconfdir=${sysconfdir}/${BPN} \ | 
 | 38 |     --with-module-dir=${libdir}/${BPN} \ | 
 | 39 |     --with-sysroot=${STAGING_DIR_HOST} \ | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 40 |     --without-mongoc --disable-mongodb \ | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 41 |     --with-librabbitmq-client=no \ | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 42 |     --disable-python \ | 
 | 43 |     --disable-java --disable-java-modules \ | 
| Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 44 |     --with-pidfile-dir=${localstatedir}/run/${BPN} \ | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 45 |     ${CONFIG_TLS} \ | 
 | 46 | " | 
 | 47 |  | 
 | 48 | CONFIG_TLS = "--enable-thread-tls" | 
| Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 49 | CONFIG_TLS_arm = "${@oe.utils.conditional( "DEBUG_BUILD", "1", " --disable-thread-tls", " --enable-thread-tls", d )}" | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 50 |  | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 51 | PACKAGECONFIG ??= " \ | 
 | 52 |     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \ | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 53 | " | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 54 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,," | 
 | 55 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd," | 
 | 56 | PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap," | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 57 | PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi," | 
 | 58 | PACKAGECONFIG[libnet] = "--enable-libnet --with-libnet=${STAGING_BINDIR_CROSS},--disable-libnet,libnet," | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 59 | PACKAGECONFIG[http] = "--enable-http,--disable-http,curl," | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 60 | PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp," | 
 | 61 | PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c," | 
 | 62 | PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers," | 
 | 63 | PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip," | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 64 | PACKAGECONFIG[native] = "--enable-native,--disable-native,," | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 65 |  | 
 | 66 | do_configure_prepend() { | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 67 | 	olddir=$(pwd) | 
 | 68 | 	cd ${AUTOTOOLS_SCRIPT_PATH} | 
 | 69 |  | 
 | 70 | 	ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} -I ${S}/m4 ${ACLOCALEXTRAPATH} || die "extra autoreconf execution failed." | 
 | 71 |  | 
 | 72 | 	cd $olddir | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 73 | } | 
 | 74 |  | 
 | 75 | do_install_append() { | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 76 |     install -d ${D}${sysconfdir}/${BPN} | 
 | 77 |     install -d ${D}${sysconfdir}/init.d | 
 | 78 |     install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog | 
| Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 79 |  | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 80 |     install -d ${D}${sysconfdir}/default/volatiles/ | 
 | 81 |     install -m 644 ${WORKDIR}/volatiles.03_syslog-ng ${D}${sysconfdir}/default/volatiles/03_syslog-ng | 
 | 82 |     install -d ${D}${sysconfdir}/tmpfiles.d/ | 
 | 83 |     install -m 644 ${WORKDIR}/syslog-ng-tmp.conf ${D}${sysconfdir}/tmpfiles.d/syslog-ng.conf | 
| Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 84 |  | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 85 |     install -d ${D}${localstatedir}/lib/${BPN} | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 86 |     # Remove /var/run as it is created on startup | 
 | 87 |     rm -rf ${D}${localstatedir}/run | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 88 |  | 
 | 89 |     # support for systemd | 
 | 90 |     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 91 |         install -m 644 ${WORKDIR}/syslog-ng.conf.systemd ${D}${sysconfdir}/${BPN}/${BPN}.conf | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 92 |  | 
 | 93 |         install -d ${D}${systemd_unitdir}/system/ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 94 |         install -m 644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service | 
 | 95 |         install -m 644 ${S}/contrib/systemd/${BPN}@default ${D}${sysconfdir}/default/${BPN}@default | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 96 |  | 
 | 97 |         sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default | 
 | 98 |         sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default | 
 | 99 |         sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default | 
 | 100 |  | 
 | 101 |         install -d ${D}${systemd_unitdir}/system/multi-user.target.wants | 
 | 102 |         ln -sf ../${BPN}@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/${BPN}@default.service | 
 | 103 |     else | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 104 |         install -m 644 ${WORKDIR}/syslog-ng.conf.sysvinit ${D}${sysconfdir}/${BPN}/${BPN}.conf | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 105 |     fi | 
| Brad Bishop | 996bc45 | 2019-12-02 13:05:15 -0500 | [diff] [blame] | 106 |  | 
 | 107 |     oe_multilib_header syslog-ng/syslog-ng-config.h | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 108 | } | 
 | 109 |  | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 110 | FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools ${systemd_unitdir}/system/multi-user.target.wants/*" | 
 | 111 | RDEPENDS_${PN} += "gawk ${@bb.utils.contains('PACKAGECONFIG','json','${PN}-jconf','',d)}" | 
 | 112 |  | 
 | 113 | FILES_${PN}-jconf += " \ | 
 | 114 | ${datadir}/${BPN}/include/scl/cim \ | 
 | 115 | ${datadir}/${BPN}/include/scl/elasticsearch \ | 
 | 116 | ${datadir}/${BPN}/include/scl/ewmm \ | 
 | 117 | ${datadir}/${BPN}/include/scl/graylog2 \ | 
 | 118 | ${datadir}/${BPN}/include/scl/loggly \ | 
 | 119 | ${datadir}/${BPN}/include/scl/logmatic \ | 
 | 120 | " | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 121 |  | 
 | 122 | # This overcomes the syslog-ng rdepends on syslog-ng-dev QA Error | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 123 | PACKAGES =+ "${PN}-jconf ${PN}-libs ${PN}-libs-dev" | 
 | 124 | RPROVIDES_${PN}-dbg += "${PN}-libs-dbg" | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 125 | FILES_${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*" | 
 | 126 | FILES_${PN}-libs-dev = "${libdir}/${BPN}/lib*.la" | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 127 | FILES_${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a" | 
| Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 128 | FILES_${PN} += "${systemd_unitdir}/system/*.service" | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 129 | INSANE_SKIP_${PN}-libs = "dev-so" | 
 | 130 | RDEPENDS_${PN} += "${PN}-libs" | 
 | 131 |  | 
 | 132 | CONFFILES_${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf" | 
 | 133 |  | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 134 | RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog" | 
| Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 135 | RCONFLICTS_${PN}-libs = "busybox-syslog sysklogd rsyslog" | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 136 |  | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 137 | RPROVIDES_${PN} += "${PN}-systemd" | 
 | 138 | RREPLACES_${PN} += "${PN}-systemd" | 
 | 139 | RCONFLICTS_${PN} += "${PN}-systemd" | 
| Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 140 | SYSTEMD_SERVICE_${PN} = "${BPN}@.service" | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 141 |  | 
| Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 142 | INITSCRIPT_NAME = "syslog" | 
 | 143 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ." |