blob: c3948a40ec64276d403a4cbcc90e162afba60187 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001SUMMARY = "Rsyslog is an enhanced multi-threaded syslogd"
2DESCRIPTION = "\
3Rsyslog is an enhanced syslogd supporting, among others, MySQL,\
4 PostgreSQL, failover log destinations, syslog/tcp, fine grain\
5 output format control, high precision timestamps, queued operations\
6 and the ability to filter on any message part. It is quite\
7 compatible to stock sysklogd and can be used as a drop-in replacement.\
8 Its advanced features make it suitable for enterprise-class,\
9 encryption protected syslog relay chains while at the same time being\
10 very easy to setup for the novice user."
11
12DEPENDS = "zlib libestr libfastjson bison-native flex-native liblogging"
13HOMEPAGE = "http://www.rsyslog.com/"
Andrew Geissler9aee5002022-03-30 16:27:02 +000014LICENSE = "GPL-3.0-only & LGPL-3.0-only & Apache-2.0"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000015LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
16 file://COPYING.LESSER;md5=cb7903f1e5c39ae838209e130dca270a \
17 file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\
18"
19
Patrick Williams2a254922023-08-11 09:48:11 -050020SRC_URI = "https://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000021 file://initscript \
22 file://rsyslog.conf \
23 file://rsyslog.logrotate \
24 file://rsyslog.service \
25 file://use-pkgconfig-to-check-libgcrypt.patch \
26 file://run-ptest \
27 file://0001-tests-disable-the-check-for-inotify.patch \
28"
29
30SRC_URI:append:libc-musl = " \
31 file://0001-Include-sys-time-h.patch \
Andrew Geissler5082cc72023-09-11 08:41:39 -040032 file://disable-omfile-outchannel.patch \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000033"
34
Patrick Williams2a254922023-08-11 09:48:11 -050035SRC_URI[sha256sum] = "f6283efaadc609540a56e6bec88a362c966e77f29fe48e6b734bd6c1123e0be5"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000036
37UPSTREAM_CHECK_URI = "https://github.com/rsyslog/rsyslog/releases"
38UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
39
40inherit autotools pkgconfig systemd update-rc.d ptest
41
42EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"
43EXTRA_OECONF += "--enable-imfile-tests"
44EXTRA_OECONF:remove:mipsarch = "ap_cv_atomic_builtins=yes"
45EXTRA_OECONF:remove:powerpc = "ap_cv_atomic_builtins=yes"
46EXTRA_OECONF:remove:riscv32 = "ap_cv_atomic_builtins=yes"
47
48# first line is default yes in configure
49PACKAGECONFIG ??= " \
50 rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \
Andrew Geissler5082cc72023-09-11 08:41:39 -040051 fmhttp imdiag openssl imfile \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000052 ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \
53 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \
54"
55
56# default yes in configure
57PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp,"
58PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,,"
59PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,,"
60PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl,"
61PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,,"
62PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,,"
63PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,,"
64PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
65PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt,"
66PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,,"
67
68# default no in configure
69PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,,"
70PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,,"
71PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,,"
72PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp,"
73PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
Andrew Geissler5082cc72023-09-11 08:41:39 -040074PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000075PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
76PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal,"
77PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse,"
78PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
79PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql,"
80PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050081# For libcap-ng, see commit log and https://github.com/rsyslog/rsyslog/issues/5091
82PACKAGECONFIG[libcap-ng] = "--enable-libcap-ng,--disable-libcap-ng,libcap-ng,"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000083PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,,"
84PACKAGECONFIG[valgrind] = ",--without-valgrind-testbench,valgrind,"
85PACKAGECONFIG[imhttp] = "--enable-imhttp,--disable-imhttp,civetweb,"
86
87
88TESTDIR = "tests"
89do_compile_ptest() {
90 echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
91 oe_runmake -C ${TESTDIR} buildtest-TESTS
92}
93
94do_install_ptest() {
95 # install the tests
96 cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
97 cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
98
99 # give permissions to all users
100 # some tests need to write to this directory as user 'daemon'
101 chmod 777 -R ${D}${PTEST_PATH}/tests
102
103 # do NOT need to rebuild Makefile itself
104 sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
105 # do NOT need to rebuild $(check_PROGRAMS)
106 sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
107
108 # fix the srcdir, top_srcdir
109 sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
110 sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
111 # fix the abs_top_builddir
112 sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
113
114 # install test-driver
115 install -m 644 ${S}/test-driver ${D}${PTEST_PATH}
116
117 # install necessary links
118 install -d ${D}${PTEST_PATH}/tools
119 ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd
120
121 install -d ${D}${PTEST_PATH}/runtime
122 install -d ${D}${PTEST_PATH}/runtime/.libs
123 (
124 cd ${D}/${libdir}/rsyslog
125 allso="*.so"
126 for i in $allso; do
127 ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i
128 done
129 )
130
131 # fix the module load path with runtime/.libs
132 find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \
133 sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g'
134 # fix the python3 path for tests/set-envar
135 sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/tests/set-envvars
136}
137
138do_install:append() {
139 install -d "${D}${sysconfdir}/init.d"
140 install -d "${D}${sysconfdir}/logrotate.d"
141 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
142 install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
143 install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
144 sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
145
146 if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then
147 install -d 0755 ${D}${sysconfdir}/rsyslog.d
148 echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf
149 fi
150 if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then
151 install -d 0755 ${D}${sysconfdir}/rsyslog.d
152 echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf
153 fi
154 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
155 install -d ${D}${systemd_system_unitdir}
156 install -m 644 ${WORKDIR}/rsyslog.service ${D}${systemd_system_unitdir}
157 sed -i -e "s,@sbindir@,${sbindir},g" ${D}${systemd_system_unitdir}/rsyslog.service
158 fi
159}
160
161FILES:${PN} += "${bindir}"
162
163INITSCRIPT_NAME = "syslog"
164INITSCRIPT_PARAMS = "defaults"
165
166CONFFILES:${PN} = "${sysconfdir}/rsyslog.conf"
167
168RCONFLICTS:${PN} = "busybox-syslog sysklogd syslog-ng"
169
170RPROVIDES:${PN} += "${PN}-systemd"
171RREPLACES:${PN} += "${PN}-systemd"
172RCONFLICTS:${PN} += "${PN}-systemd"
173SYSTEMD_SERVICE:${PN} = "${BPN}.service"
174
175RDEPENDS:${PN} += "logrotate"
176
177# for rsyslog-ptest
178VALGRIND = "valgrind"
179
180# valgrind supports armv7 and above
181VALGRIND:armv4 = ''
182VALGRIND:armv5 = ''
183VALGRIND:armv6 = ''
184
185# X32 isn't supported by valgrind at this time
186VALGRIND:linux-gnux32 = ''
187VALGRIND:linux-muslx32 = ''
188
189# Disable for some MIPS variants
190VALGRIND:mipsarchr6 = ''
191VALGRIND:linux-gnun32 = ''
192
193# Disable for powerpc64 with musl
194VALGRIND:libc-musl:powerpc64 = ''
195VALGRIND:libc-musl:powerpc64le = ''
196
197# RISC-V support for valgrind is not there yet
198VALGRIND:riscv64 = ""
199VALGRIND:riscv32 = ""
200
201# util-linux: logger needs the -d option
202RDEPENDS:${PN}-ptest += "\
203 make diffutils gzip bash gawk coreutils procps \
204 libgcc python3-core python3-io python3-json \
205 curl util-linux shadow \
206 "
207
208RRECOMMENDS:${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"