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