blob: 4cc5d84519b22ec2311a75d01fdb101ae5335739 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "Alternative system logger daemon"
2DESCRIPTION = "syslog-ng, as the name shows, is a syslogd replacement, \
3but with new functionality for the new generation. The original syslogd \
4allows messages only to be sorted based on priority/facility pairs; \
5syslog-ng adds the possibility to filter based on message contents using \
6regular expressions. The new configuration scheme is intuitive and powerful. \
7Forwarding logs over TCP and remembering all forwarding hops makes it \
8ideal for firewalled environments. \
9"
10HOMEPAGE = "http://www.balabit.com/network-security/syslog-ng/opensource-logging-system"
11
12LICENSE = "GPL-2.0-only & LGPL-2.1-only"
Patrick Williamsb58112e2024-03-07 11:16:36 -060013LIC_FILES_CHKSUM = "file://COPYING;md5=924958cefc9f7de3e0b818832b8a1cec"
Andrew Geissler9aee5002022-03-30 16:27:02 +000014
15# util-linux added to get libuuid
Patrick Williamsb58112e2024-03-07 11:16:36 -060016DEPENDS = "libpcre flex glib-2.0 openssl util-linux bison-native curl"
Andrew Geissler9aee5002022-03-30 16:27:02 +000017
18SRC_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 Geisslerfc113ea2023-03-31 09:59:46 -050025 file://0001-Fix-buildpaths-warning.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000026"
Patrick Williams864cc432023-02-09 14:54:44 -060027SRC_URI:append:powerpc64le = " file://0001-plugin.c-workaround-powerpc64le-segfaults-error.patch"
Andrew Geissler9aee5002022-03-30 16:27:02 +000028
Patrick Williamsb58112e2024-03-07 11:16:36 -060029SRC_URI[sha256sum] = "b69e3360dfb96a754a4e1cbead4daef37128b1152a23572356db4ab64a475d4f"
Andrew Geissler9aee5002022-03-30 16:27:02 +000030
31UPSTREAM_CHECK_URI = "https://github.com/balabit/syslog-ng/releases"
32
Patrick Williams73bd93f2024-02-20 08:07:48 -060033CVE_STATUS[CVE-2022-38725] = "cpe-incorrect: cve-check wrongly matches cpe:2.3:a:oneidentity:syslog-ng:*:*:*:*:premium:*:*:* < 7.0.32"
34
Andrew Geissler9aee5002022-03-30 16:27:02 +000035inherit autotools gettext systemd pkgconfig update-rc.d multilib_header
36
37EXTRA_OECONF = " \
38 --enable-dynamic-linking \
39 --disable-sub-streams \
40 --disable-pacct \
41 --localstatedir=${localstatedir}/lib/${BPN} \
42 --sysconfdir=${sysconfdir}/${BPN} \
43 --with-module-dir=${libdir}/${BPN} \
44 --with-sysroot=${STAGING_DIR_HOST} \
45 --without-mongoc --disable-mongodb \
46 --with-librabbitmq-client=no \
47 --disable-python \
48 --disable-java --disable-java-modules \
49 --with-pidfile-dir=${localstatedir}/run/${BPN} \
50"
51
52PACKAGECONFIG ??= " \
53 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
54"
55PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
56PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd,"
57PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap,"
58PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi,"
59PACKAGECONFIG[spoof-source] = "--enable-spoof-source --with-libnet=${STAGING_BINDIR_CROSS},--disable-spoof-source,libnet,"
60PACKAGECONFIG[http] = "--enable-http,--disable-http,curl,"
61PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp,"
62PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c,"
63PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers,"
64PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip,"
65PACKAGECONFIG[native] = "--enable-native,--disable-native,,"
66
67do_configure:prepend() {
68 olddir=$(pwd)
69 cd ${AUTOTOOLS_SCRIPT_PATH}
70
71 ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} -I ${S}/m4 ${ACLOCALEXTRAPATH} || die "extra autoreconf execution failed."
72
73 cd $olddir
74}
75
76do_install:append() {
77 install -d ${D}${sysconfdir}/${BPN}
78 install -d ${D}${sysconfdir}/init.d
79 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
80
81 install -d ${D}${sysconfdir}/default/volatiles/
82 install -m 644 ${WORKDIR}/volatiles.03_syslog-ng ${D}${sysconfdir}/default/volatiles/03_syslog-ng
83 install -d ${D}${sysconfdir}/tmpfiles.d/
84 install -m 644 ${WORKDIR}/syslog-ng-tmp.conf ${D}${sysconfdir}/tmpfiles.d/syslog-ng.conf
85
86 install -d ${D}${localstatedir}/lib/${BPN}
87 # Remove /var/run as it is created on startup
88 rm -rf ${D}${localstatedir}/run
89
Patrick Williams8e7b46e2023-05-01 14:19:06 -050090 # it causes install conflict when multilib enabled
91 # since python support is disabled, not deliver it
92 rm -f ${D}${bindir}/syslog-ng-update-virtualenv
93
Andrew Geissler9aee5002022-03-30 16:27:02 +000094 # support for systemd
95 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
96 install -m 644 ${WORKDIR}/syslog-ng.conf.systemd ${D}${sysconfdir}/${BPN}/${BPN}.conf
97
98 install -d ${D}${systemd_unitdir}/system/
99 install -m 644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
100 install -m 644 ${S}/contrib/systemd/${BPN}@default ${D}${sysconfdir}/default/${BPN}@default
101
102 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
103 sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
104 sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
105
106 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
107 ln -sf ../${BPN}@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/${BPN}@default.service
108 else
109 install -m 644 ${WORKDIR}/syslog-ng.conf.sysvinit ${D}${sysconfdir}/${BPN}/${BPN}.conf
110 fi
111
112 oe_multilib_header syslog-ng/syslog-ng-config.h
113}
114
115FILES:${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools ${systemd_unitdir}/system/multi-user.target.wants/*"
116RDEPENDS:${PN} += "gawk ${@bb.utils.contains('PACKAGECONFIG','json','${PN}-jconf','',d)}"
117
118FILES:${PN}-jconf += " \
119${datadir}/${BPN}/include/scl/cim \
120${datadir}/${BPN}/include/scl/elasticsearch \
121${datadir}/${BPN}/include/scl/ewmm \
122${datadir}/${BPN}/include/scl/graylog2 \
123${datadir}/${BPN}/include/scl/loggly \
124${datadir}/${BPN}/include/scl/logmatic \
125"
126
127# This overcomes the syslog-ng rdepends on syslog-ng-dev QA Error
128PACKAGES =+ "${PN}-jconf ${PN}-libs ${PN}-libs-dev"
129RPROVIDES:${PN}-dbg += "${PN}-libs-dbg"
130FILES:${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*"
131FILES:${PN}-libs-dev = "${libdir}/${BPN}/lib*.la"
132FILES:${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a"
133FILES:${PN} += "${systemd_unitdir}/system/*.service"
134INSANE_SKIP:${PN}-libs = "dev-so"
135RDEPENDS:${PN} += "${PN}-libs"
136
137CONFFILES:${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf"
138
139RCONFLICTS:${PN} = "busybox-syslog sysklogd rsyslog"
140RCONFLICTS:${PN}-libs = "busybox-syslog sysklogd rsyslog"
141
142RPROVIDES:${PN} += "${PN}-systemd"
143RREPLACES:${PN} += "${PN}-systemd"
144RCONFLICTS:${PN} += "${PN}-systemd"
145SYSTEMD_SERVICE:${PN} = "${BPN}@.service"
146
147INITSCRIPT_NAME = "syslog"
148INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."