blob: 650c7bd5f33f52b56489b152003c6a57a85d8498 [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"
Andrew Geissler87f5cff2022-09-30 13:13:31 -050013LIC_FILES_CHKSUM = "file://COPYING;md5=71d15c2fb22f43e1a380f3f799ebde30"
Andrew Geissler9aee5002022-03-30 16:27:02 +000014
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 \
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
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050029SRC_URI[sha256sum] = "c16eafe447191c079f471846182876b7919d3d789af8c1f9fe55ab14521ceb2c"
Andrew Geissler9aee5002022-03-30 16:27:02 +000030
31UPSTREAM_CHECK_URI = "https://github.com/balabit/syslog-ng/releases"
32
33inherit autotools gettext systemd pkgconfig update-rc.d multilib_header
34
35EXTRA_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
50PACKAGECONFIG ??= " \
51 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
52"
53PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
54PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd,"
55PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap,"
56PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi,"
57PACKAGECONFIG[spoof-source] = "--enable-spoof-source --with-libnet=${STAGING_BINDIR_CROSS},--disable-spoof-source,libnet,"
58PACKAGECONFIG[http] = "--enable-http,--disable-http,curl,"
59PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp,"
60PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c,"
61PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers,"
62PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip,"
63PACKAGECONFIG[native] = "--enable-native,--disable-native,,"
64
65do_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
74do_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 Williams8e7b46e2023-05-01 14:19:06 -050088 # 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 Geissler9aee5002022-03-30 16:27:02 +000092 # 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
113FILES:${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools ${systemd_unitdir}/system/multi-user.target.wants/*"
114RDEPENDS:${PN} += "gawk ${@bb.utils.contains('PACKAGECONFIG','json','${PN}-jconf','',d)}"
115
116FILES:${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
126PACKAGES =+ "${PN}-jconf ${PN}-libs ${PN}-libs-dev"
127RPROVIDES:${PN}-dbg += "${PN}-libs-dbg"
128FILES:${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*"
129FILES:${PN}-libs-dev = "${libdir}/${BPN}/lib*.la"
130FILES:${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a"
131FILES:${PN} += "${systemd_unitdir}/system/*.service"
132INSANE_SKIP:${PN}-libs = "dev-so"
133RDEPENDS:${PN} += "${PN}-libs"
134
135CONFFILES:${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf"
136
137RCONFLICTS:${PN} = "busybox-syslog sysklogd rsyslog"
138RCONFLICTS:${PN}-libs = "busybox-syslog sysklogd rsyslog"
139
140RPROVIDES:${PN} += "${PN}-systemd"
141RREPLACES:${PN} += "${PN}-systemd"
142RCONFLICTS:${PN} += "${PN}-systemd"
143SYSTEMD_SERVICE:${PN} = "${BPN}@.service"
144
145INITSCRIPT_NAME = "syslog"
146INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."