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