Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [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 = "GPL-2.0-only & LGPL-2.1-only" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=71d15c2fb22f43e1a380f3f799ebde30" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 14 | |
| 15 | # util-linux added to get libuuid |
| 16 | DEPENDS = "libpcre flex glib-2.0 openssl util-linux bison-native" |
| 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://syslog-ng-tmp.conf \ |
| 24 | file://syslog-ng.service-the-syslog-ng-service.patch \ |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 25 | file://0001-Fix-buildpaths-warning.patch \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 26 | " |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 27 | SRC_URI:append:powerpc64le = " file://0001-plugin.c-workaround-powerpc64le-segfaults-error.patch" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 28 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 29 | SRC_URI[sha256sum] = "c16eafe447191c079f471846182876b7919d3d789af8c1f9fe55ab14521ceb2c" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 30 | |
| 31 | UPSTREAM_CHECK_URI = "https://github.com/balabit/syslog-ng/releases" |
| 32 | |
| 33 | inherit autotools gettext systemd pkgconfig update-rc.d multilib_header |
| 34 | |
| 35 | EXTRA_OECONF = " \ |
| 36 | --enable-dynamic-linking \ |
| 37 | --disable-sub-streams \ |
| 38 | --disable-pacct \ |
| 39 | --localstatedir=${localstatedir}/lib/${BPN} \ |
| 40 | --sysconfdir=${sysconfdir}/${BPN} \ |
| 41 | --with-module-dir=${libdir}/${BPN} \ |
| 42 | --with-sysroot=${STAGING_DIR_HOST} \ |
| 43 | --without-mongoc --disable-mongodb \ |
| 44 | --with-librabbitmq-client=no \ |
| 45 | --disable-python \ |
| 46 | --disable-java --disable-java-modules \ |
| 47 | --with-pidfile-dir=${localstatedir}/run/${BPN} \ |
| 48 | " |
| 49 | |
| 50 | PACKAGECONFIG ??= " \ |
| 51 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \ |
| 52 | " |
| 53 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,," |
| 54 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd," |
| 55 | PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap," |
| 56 | PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi," |
| 57 | PACKAGECONFIG[spoof-source] = "--enable-spoof-source --with-libnet=${STAGING_BINDIR_CROSS},--disable-spoof-source,libnet," |
| 58 | PACKAGECONFIG[http] = "--enable-http,--disable-http,curl," |
| 59 | PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp," |
| 60 | PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c," |
| 61 | PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers," |
| 62 | PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip," |
| 63 | PACKAGECONFIG[native] = "--enable-native,--disable-native,," |
| 64 | |
| 65 | do_configure:prepend() { |
| 66 | olddir=$(pwd) |
| 67 | cd ${AUTOTOOLS_SCRIPT_PATH} |
| 68 | |
| 69 | ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} -I ${S}/m4 ${ACLOCALEXTRAPATH} || die "extra autoreconf execution failed." |
| 70 | |
| 71 | cd $olddir |
| 72 | } |
| 73 | |
| 74 | do_install:append() { |
| 75 | install -d ${D}${sysconfdir}/${BPN} |
| 76 | install -d ${D}${sysconfdir}/init.d |
| 77 | install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog |
| 78 | |
| 79 | install -d ${D}${sysconfdir}/default/volatiles/ |
| 80 | install -m 644 ${WORKDIR}/volatiles.03_syslog-ng ${D}${sysconfdir}/default/volatiles/03_syslog-ng |
| 81 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 82 | install -m 644 ${WORKDIR}/syslog-ng-tmp.conf ${D}${sysconfdir}/tmpfiles.d/syslog-ng.conf |
| 83 | |
| 84 | install -d ${D}${localstatedir}/lib/${BPN} |
| 85 | # Remove /var/run as it is created on startup |
| 86 | rm -rf ${D}${localstatedir}/run |
| 87 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 88 | # it causes install conflict when multilib enabled |
| 89 | # since python support is disabled, not deliver it |
| 90 | rm -f ${D}${bindir}/syslog-ng-update-virtualenv |
| 91 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 92 | # support for systemd |
| 93 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 94 | install -m 644 ${WORKDIR}/syslog-ng.conf.systemd ${D}${sysconfdir}/${BPN}/${BPN}.conf |
| 95 | |
| 96 | install -d ${D}${systemd_unitdir}/system/ |
| 97 | install -m 644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service |
| 98 | install -m 644 ${S}/contrib/systemd/${BPN}@default ${D}${sysconfdir}/default/${BPN}@default |
| 99 | |
| 100 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default |
| 101 | sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default |
| 102 | sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default |
| 103 | |
| 104 | install -d ${D}${systemd_unitdir}/system/multi-user.target.wants |
| 105 | ln -sf ../${BPN}@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/${BPN}@default.service |
| 106 | else |
| 107 | install -m 644 ${WORKDIR}/syslog-ng.conf.sysvinit ${D}${sysconfdir}/${BPN}/${BPN}.conf |
| 108 | fi |
| 109 | |
| 110 | oe_multilib_header syslog-ng/syslog-ng-config.h |
| 111 | } |
| 112 | |
| 113 | FILES:${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools ${systemd_unitdir}/system/multi-user.target.wants/*" |
| 114 | RDEPENDS:${PN} += "gawk ${@bb.utils.contains('PACKAGECONFIG','json','${PN}-jconf','',d)}" |
| 115 | |
| 116 | FILES:${PN}-jconf += " \ |
| 117 | ${datadir}/${BPN}/include/scl/cim \ |
| 118 | ${datadir}/${BPN}/include/scl/elasticsearch \ |
| 119 | ${datadir}/${BPN}/include/scl/ewmm \ |
| 120 | ${datadir}/${BPN}/include/scl/graylog2 \ |
| 121 | ${datadir}/${BPN}/include/scl/loggly \ |
| 122 | ${datadir}/${BPN}/include/scl/logmatic \ |
| 123 | " |
| 124 | |
| 125 | # This overcomes the syslog-ng rdepends on syslog-ng-dev QA Error |
| 126 | PACKAGES =+ "${PN}-jconf ${PN}-libs ${PN}-libs-dev" |
| 127 | RPROVIDES:${PN}-dbg += "${PN}-libs-dbg" |
| 128 | FILES:${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*" |
| 129 | FILES:${PN}-libs-dev = "${libdir}/${BPN}/lib*.la" |
| 130 | FILES:${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a" |
| 131 | FILES:${PN} += "${systemd_unitdir}/system/*.service" |
| 132 | INSANE_SKIP:${PN}-libs = "dev-so" |
| 133 | RDEPENDS:${PN} += "${PN}-libs" |
| 134 | |
| 135 | CONFFILES:${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf" |
| 136 | |
| 137 | RCONFLICTS:${PN} = "busybox-syslog sysklogd rsyslog" |
| 138 | RCONFLICTS:${PN}-libs = "busybox-syslog sysklogd rsyslog" |
| 139 | |
| 140 | RPROVIDES:${PN} += "${PN}-systemd" |
| 141 | RREPLACES:${PN} += "${PN}-systemd" |
| 142 | RCONFLICTS:${PN} += "${PN}-systemd" |
| 143 | SYSTEMD_SERVICE:${PN} = "${BPN}@.service" |
| 144 | |
| 145 | INITSCRIPT_NAME = "syslog" |
| 146 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ." |