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