xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-support/syslog-ng/syslog-ng_3.36.1.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Alternative system logger daemon"
2*4882a593SmuzhiyunDESCRIPTION = "syslog-ng, as the name shows, is a syslogd replacement, \
3*4882a593Smuzhiyunbut with new functionality for the new generation. The original syslogd \
4*4882a593Smuzhiyunallows messages only to be sorted based on priority/facility pairs; \
5*4882a593Smuzhiyunsyslog-ng adds the possibility to filter based on message contents using \
6*4882a593Smuzhiyunregular expressions. The new configuration scheme is intuitive and powerful. \
7*4882a593SmuzhiyunForwarding logs over TCP and remembering all forwarding hops makes it \
8*4882a593Smuzhiyunideal for firewalled environments. \
9*4882a593Smuzhiyun"
10*4882a593SmuzhiyunHOMEPAGE = "http://www.balabit.com/network-security/syslog-ng/opensource-logging-system"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunLICENSE = "GPL-2.0-only & LGPL-2.1-only"
13*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=189c3826d32deaf83ad8d0d538a10023"
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun# util-linux added to get libuuid
16*4882a593SmuzhiyunDEPENDS = "libpcre flex glib-2.0 openssl util-linux bison-native"
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunSRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
19*4882a593Smuzhiyun           file://syslog-ng.conf.systemd \
20*4882a593Smuzhiyun           file://syslog-ng.conf.sysvinit \
21*4882a593Smuzhiyun           file://initscript \
22*4882a593Smuzhiyun           file://volatiles.03_syslog-ng \
23*4882a593Smuzhiyun           file://syslog-ng-tmp.conf \
24*4882a593Smuzhiyun           file://syslog-ng.service-the-syslog-ng-service.patch \
25*4882a593Smuzhiyun	   file://CVE-2022-38725-0001.patch \
26*4882a593Smuzhiyun           file://CVE-2022-38725-0002.patch \
27*4882a593Smuzhiyun           file://CVE-2022-38725-0003.patch \
28*4882a593Smuzhiyun           file://CVE-2022-38725-0004.patch \
29*4882a593Smuzhiyun           file://CVE-2022-38725-0005.patch \
30*4882a593Smuzhiyun           file://CVE-2022-38725-0006.patch \
31*4882a593Smuzhiyun           file://CVE-2022-38725-0007.patch \
32*4882a593Smuzhiyun           file://CVE-2022-38725-0008.patch \
33*4882a593Smuzhiyun"
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunSRC_URI[sha256sum] = "90a25c9767fe749db50f118ddfc92ec71399763d2ecd5ad4f11ff5eea049e60b"
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunUPSTREAM_CHECK_URI = "https://github.com/balabit/syslog-ng/releases"
38*4882a593Smuzhiyun
39*4882a593Smuzhiyuninherit autotools gettext systemd pkgconfig update-rc.d multilib_header
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunEXTRA_OECONF = " \
42*4882a593Smuzhiyun    --enable-dynamic-linking \
43*4882a593Smuzhiyun    --disable-sub-streams \
44*4882a593Smuzhiyun    --disable-pacct \
45*4882a593Smuzhiyun    --localstatedir=${localstatedir}/lib/${BPN} \
46*4882a593Smuzhiyun    --sysconfdir=${sysconfdir}/${BPN} \
47*4882a593Smuzhiyun    --with-module-dir=${libdir}/${BPN} \
48*4882a593Smuzhiyun    --with-sysroot=${STAGING_DIR_HOST} \
49*4882a593Smuzhiyun    --without-mongoc --disable-mongodb \
50*4882a593Smuzhiyun    --with-librabbitmq-client=no \
51*4882a593Smuzhiyun    --disable-python \
52*4882a593Smuzhiyun    --disable-java --disable-java-modules \
53*4882a593Smuzhiyun    --with-pidfile-dir=${localstatedir}/run/${BPN} \
54*4882a593Smuzhiyun"
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunPACKAGECONFIG ??= " \
57*4882a593Smuzhiyun    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \
58*4882a593Smuzhiyun"
59*4882a593SmuzhiyunPACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
60*4882a593SmuzhiyunPACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/,--disable-systemd --without-systemdsystemunitdir,systemd,"
61*4882a593SmuzhiyunPACKAGECONFIG[linux-caps] = "--enable-linux-caps,--disable-linux-caps,libcap,"
62*4882a593SmuzhiyunPACKAGECONFIG[dbi] = "--enable-sql,--disable-sql,libdbi,"
63*4882a593SmuzhiyunPACKAGECONFIG[spoof-source] = "--enable-spoof-source --with-libnet=${STAGING_BINDIR_CROSS},--disable-spoof-source,libnet,"
64*4882a593SmuzhiyunPACKAGECONFIG[http] = "--enable-http,--disable-http,curl,"
65*4882a593SmuzhiyunPACKAGECONFIG[smtp] = "--enable-smtp --with-libesmtp=${STAGING_LIBDIR},--disable-smtp,libesmtp,"
66*4882a593SmuzhiyunPACKAGECONFIG[json] = "--enable-json,--disable-json,json-c,"
67*4882a593SmuzhiyunPACKAGECONFIG[tcp-wrapper] = "--enable-tcp-wrapper,--disable-tcp-wrapper,tcp-wrappers,"
68*4882a593SmuzhiyunPACKAGECONFIG[geoip] = "--enable-geoip,--disable-geoip,geoip,"
69*4882a593SmuzhiyunPACKAGECONFIG[native] = "--enable-native,--disable-native,,"
70*4882a593Smuzhiyun
71*4882a593Smuzhiyundo_configure:prepend() {
72*4882a593Smuzhiyun	olddir=$(pwd)
73*4882a593Smuzhiyun	cd ${AUTOTOOLS_SCRIPT_PATH}
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun	ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} -I ${S}/m4 ${ACLOCALEXTRAPATH} || die "extra autoreconf execution failed."
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun	cd $olddir
78*4882a593Smuzhiyun}
79*4882a593Smuzhiyun
80*4882a593Smuzhiyundo_install:append() {
81*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/${BPN}
82*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/init.d
83*4882a593Smuzhiyun    install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/default/volatiles/
86*4882a593Smuzhiyun    install -m 644 ${WORKDIR}/volatiles.03_syslog-ng ${D}${sysconfdir}/default/volatiles/03_syslog-ng
87*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/tmpfiles.d/
88*4882a593Smuzhiyun    install -m 644 ${WORKDIR}/syslog-ng-tmp.conf ${D}${sysconfdir}/tmpfiles.d/syslog-ng.conf
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun    install -d ${D}${localstatedir}/lib/${BPN}
91*4882a593Smuzhiyun    # Remove /var/run as it is created on startup
92*4882a593Smuzhiyun    rm -rf ${D}${localstatedir}/run
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun    # support for systemd
95*4882a593Smuzhiyun    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
96*4882a593Smuzhiyun        install -m 644 ${WORKDIR}/syslog-ng.conf.systemd ${D}${sysconfdir}/${BPN}/${BPN}.conf
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun        install -d ${D}${systemd_unitdir}/system/
99*4882a593Smuzhiyun        install -m 644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
100*4882a593Smuzhiyun        install -m 644 ${S}/contrib/systemd/${BPN}@default ${D}${sysconfdir}/default/${BPN}@default
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
103*4882a593Smuzhiyun        sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
104*4882a593Smuzhiyun        sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${sysconfdir}/default/${BPN}@default
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun        install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
107*4882a593Smuzhiyun        ln -sf ../${BPN}@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/${BPN}@default.service
108*4882a593Smuzhiyun    else
109*4882a593Smuzhiyun        install -m 644 ${WORKDIR}/syslog-ng.conf.sysvinit ${D}${sysconfdir}/${BPN}/${BPN}.conf
110*4882a593Smuzhiyun    fi
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun    oe_multilib_header syslog-ng/syslog-ng-config.h
113*4882a593Smuzhiyun}
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunFILES:${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools ${systemd_unitdir}/system/multi-user.target.wants/*"
116*4882a593SmuzhiyunRDEPENDS:${PN} += "gawk ${@bb.utils.contains('PACKAGECONFIG','json','${PN}-jconf','',d)}"
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunFILES:${PN}-jconf += " \
119*4882a593Smuzhiyun${datadir}/${BPN}/include/scl/cim \
120*4882a593Smuzhiyun${datadir}/${BPN}/include/scl/elasticsearch \
121*4882a593Smuzhiyun${datadir}/${BPN}/include/scl/ewmm \
122*4882a593Smuzhiyun${datadir}/${BPN}/include/scl/graylog2 \
123*4882a593Smuzhiyun${datadir}/${BPN}/include/scl/loggly \
124*4882a593Smuzhiyun${datadir}/${BPN}/include/scl/logmatic \
125*4882a593Smuzhiyun"
126*4882a593Smuzhiyun
127*4882a593Smuzhiyun# This overcomes the syslog-ng rdepends on syslog-ng-dev QA Error
128*4882a593SmuzhiyunPACKAGES =+ "${PN}-jconf ${PN}-libs ${PN}-libs-dev"
129*4882a593SmuzhiyunRPROVIDES:${PN}-dbg += "${PN}-libs-dbg"
130*4882a593SmuzhiyunFILES:${PN}-libs = "${libdir}/${BPN}/*.so ${libdir}/libsyslog-ng-*.so*"
131*4882a593SmuzhiyunFILES:${PN}-libs-dev = "${libdir}/${BPN}/lib*.la"
132*4882a593SmuzhiyunFILES:${PN}-staticdev += "${libdir}/${BPN}/libtest/*.a"
133*4882a593SmuzhiyunFILES:${PN} += "${systemd_unitdir}/system/*.service"
134*4882a593SmuzhiyunINSANE_SKIP:${PN}-libs = "dev-so"
135*4882a593SmuzhiyunRDEPENDS:${PN} += "${PN}-libs"
136*4882a593Smuzhiyun
137*4882a593SmuzhiyunCONFFILES:${PN} = "${sysconfdir}/${BPN}.conf ${sysconfdir}/scl.conf"
138*4882a593Smuzhiyun
139*4882a593SmuzhiyunRCONFLICTS:${PN} = "busybox-syslog sysklogd rsyslog"
140*4882a593SmuzhiyunRCONFLICTS:${PN}-libs = "busybox-syslog sysklogd rsyslog"
141*4882a593Smuzhiyun
142*4882a593SmuzhiyunRPROVIDES:${PN} += "${PN}-systemd"
143*4882a593SmuzhiyunRREPLACES:${PN} += "${PN}-systemd"
144*4882a593SmuzhiyunRCONFLICTS:${PN} += "${PN}-systemd"
145*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "${BPN}@.service"
146*4882a593Smuzhiyun
147*4882a593SmuzhiyunINITSCRIPT_NAME = "syslog"
148*4882a593SmuzhiyunINITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
149