blob: ef30fd707b506d575b4a9844ee99cddfa68be8db [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "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 = "GPLv2 & LGPLv2.1"
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050013LIC_FILES_CHKSUM = "file://COPYING;md5=189c3826d32deaf83ad8d0d538a10023"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050014
15# util-linux added to get libuuid
Andrew Geissler72956ed2021-01-08 16:11:14 -060016DEPENDS = "libpcre flex glib-2.0 openssl util-linux bison-native"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050017
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019 file://syslog-ng.conf.systemd \
20 file://syslog-ng.conf.sysvinit \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050021 file://initscript \
22 file://volatiles.03_syslog-ng \
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050023 file://syslog-ng-tmp.conf \
24 file://syslog-ng.service-the-syslog-ng-service.patch \
25 file://0002-scl-fix-wrong-ownership-during-installation.patch \
26 file://0005-.py-s-python-python3-exclude-tests.patch \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050027"
28
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050029SRC_URI[md5sum] = "69ef4dc5628d5e603e9e4a1b937592f8"
30SRC_URI[sha256sum] = "2eeb8e0dbbcb556fdd4e50bc9f29bc8c66c9b153026f87caa7567bd3139c186a"
31
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032UPSTREAM_CHECK_URI = "https://github.com/balabit/syslog-ng/releases"
33
Brad Bishop996bc452019-12-02 13:05:15 -050034inherit autotools gettext systemd pkgconfig update-rc.d multilib_header
Patrick Williamsb48b7b42016-08-17 15:04:38 -050035
36EXTRA_OECONF = " \
37 --enable-dynamic-linking \
38 --disable-sub-streams \
39 --disable-pacct \
40 --localstatedir=${localstatedir}/lib/${BPN} \
41 --sysconfdir=${sysconfdir}/${BPN} \
42 --with-module-dir=${libdir}/${BPN} \
43 --with-sysroot=${STAGING_DIR_HOST} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044 --without-mongoc --disable-mongodb \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050045 --with-librabbitmq-client=no \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050046 --disable-python \
47 --disable-java --disable-java-modules \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050048 --with-pidfile-dir=${localstatedir}/run/${BPN} \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050049"
50
Brad Bishop6e60e8b2018-02-01 10:27:11 -050051PACKAGECONFIG ??= " \
52 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050053"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050054PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
55PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd,"
56PACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap,"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050057PACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi,"
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050058PACKAGECONFIG[spoof-source] = "--enable-spoof-source --with-libnet=${STAGING_BINDIR_CROSS},--disable-spoof-source,libnet,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050059PACKAGECONFIG[http] = "--enable-http,--disable-http,curl,"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050060PACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp,"
61PACKAGECONFIG[json] = "--enable-json,--disable-json,json-c,"
62PACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers,"
63PACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050064PACKAGECONFIG[native] = "--enable-native,--disable-native,,"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050065
Patrick Williams213cb262021-08-07 19:21:33 -050066do_configure:prepend() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067 olddir=$(pwd)
68 cd ${AUTOTOOLS_SCRIPT_PATH}
69
70 ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} -I ${S}/m4 ${ACLOCALEXTRAPATH} || die "extra autoreconf execution failed."
71
72 cd $olddir
Patrick Williamsb48b7b42016-08-17 15:04:38 -050073}
74
Patrick Williams213cb262021-08-07 19:21:33 -050075do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050076 install -d ${D}${sysconfdir}/${BPN}
77 install -d ${D}${sysconfdir}/init.d
78 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
Brad Bishop868407c2019-11-04 13:24:47 -050079
Andrew Geissler82c905d2020-04-13 13:39:40 -050080 install -d ${D}${sysconfdir}/default/volatiles/
81 install -m 644 ${WORKDIR}/volatiles.03_syslog-ng ${D}${sysconfdir}/default/volatiles/03_syslog-ng
82 install -d ${D}${sysconfdir}/tmpfiles.d/
83 install -m 644 ${WORKDIR}/syslog-ng-tmp.conf ${D}${sysconfdir}/tmpfiles.d/syslog-ng.conf
Brad Bishop868407c2019-11-04 13:24:47 -050084
Andrew Geissler82c905d2020-04-13 13:39:40 -050085 install -d ${D}${localstatedir}/lib/${BPN}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050086 # Remove /var/run as it is created on startup
87 rm -rf ${D}${localstatedir}/run
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080088
89 # support for systemd
90 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
Andrew Geissler82c905d2020-04-13 13:39:40 -050091 install -m 644 ${WORKDIR}/syslog-ng.conf.systemd ${D}${sysconfdir}/${BPN}/${BPN}.conf
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080092
93 install -d ${D}${systemd_unitdir}/system/
Andrew Geissler82c905d2020-04-13 13:39:40 -050094 install -m 644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
95 install -m 644 ${S}/contrib/systemd/${BPN}@default ${D}${sysconfdir}/default/${BPN}@default
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080096
97 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
98 sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
99 sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
100
101 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
102 ln -sf ../${BPN}@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/${BPN}@default.service
103 else
Andrew Geissler82c905d2020-04-13 13:39:40 -0500104 install -m 644 ${WORKDIR}/syslog-ng.conf.sysvinit ${D}${sysconfdir}/${BPN}/${BPN}.conf
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800105 fi
Brad Bishop996bc452019-12-02 13:05:15 -0500106
107 oe_multilib_header syslog-ng/syslog-ng-config.h
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500108}
109
Patrick Williams213cb262021-08-07 19:21:33 -0500110FILES:${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools ${systemd_unitdir}/system/multi-user.target.wants/*"
111RDEPENDS:${PN} += "gawk ${@bb.utils.contains('PACKAGECONFIG','json','${PN}-jconf','',d)}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800112
Patrick Williams213cb262021-08-07 19:21:33 -0500113FILES:${PN}-jconf += " \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800114${datadir}/${BPN}/include/scl/cim \
115${datadir}/${BPN}/include/scl/elasticsearch \
116${datadir}/${BPN}/include/scl/ewmm \
117${datadir}/${BPN}/include/scl/graylog2 \
118${datadir}/${BPN}/include/scl/loggly \
119${datadir}/${BPN}/include/scl/logmatic \
120"
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500121
122# This overcomes the syslog-ng rdepends on syslog-ng-dev QA Error
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800123PACKAGES =+ "${PN}-jconf ${PN}-libs ${PN}-libs-dev"
Patrick Williams213cb262021-08-07 19:21:33 -0500124RPROVIDES:${PN}-dbg += "${PN}-libs-dbg"
125FILES:${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*"
126FILES:${PN}-libs-dev = "${libdir}/${BPN}/lib*.la"
127FILES:${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a"
128FILES:${PN} += "${systemd_unitdir}/system/*.service"
129INSANE_SKIP:${PN}-libs = "dev-so"
130RDEPENDS:${PN} += "${PN}-libs"
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500131
Patrick Williams213cb262021-08-07 19:21:33 -0500132CONFFILES:${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf"
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500133
Patrick Williams213cb262021-08-07 19:21:33 -0500134RCONFLICTS:${PN} = "busybox-syslog sysklogd rsyslog"
135RCONFLICTS:${PN}-libs = "busybox-syslog sysklogd rsyslog"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500136
Patrick Williams213cb262021-08-07 19:21:33 -0500137RPROVIDES:${PN} += "${PN}-systemd"
138RREPLACES:${PN} += "${PN}-systemd"
139RCONFLICTS:${PN} += "${PN}-systemd"
140SYSTEMD_SERVICE:${PN} = "${BPN}@.service"
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500141
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500142INITSCRIPT_NAME = "syslog"
143INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."