blob: 22059d1407ba0f156a5f2211d9a43cce70ed5154 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "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/"
14LICENSE = "GPLv3 & LGPLv3 & Apache-2.0"
15LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
16 file://COPYING.LESSER;md5=cb7903f1e5c39ae838209e130dca270a \
17 file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\
18"
19
20SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.tar.gz \
21 file://initscript \
22 file://rsyslog.conf \
23 file://rsyslog.logrotate \
Andrew Geissler97771a32021-03-05 15:23:11 -060024 file://rsyslog.service \
Andrew Geissler82c905d2020-04-13 13:39:40 -050025 file://use-pkgconfig-to-check-libgcrypt.patch \
26 file://run-ptest \
27"
28
29SRC_URI_append_libc-musl = " \
30 file://0001-Include-sys-time-h.patch \
31"
32
Andrew Geissler97771a32021-03-05 15:23:11 -060033SRC_URI[md5sum] = "1f6150dfd2ef38db37c2165e98d2f2b1"
34SRC_URI[sha256sum] = "94ee0d0312c2edea737665594cbe4a9475e4e3b593e12b5b8ae3a743ac9c72a7"
Andrew Geissler82c905d2020-04-13 13:39:40 -050035
36UPSTREAM_CHECK_URI = "https://github.com/rsyslog/rsyslog/releases"
37UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
38
39inherit autotools pkgconfig systemd update-rc.d ptest
40
41EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"
42EXTRA_OECONF += "--enable-imfile-tests"
43EXTRA_OECONF_remove_mipsarch = "ap_cv_atomic_builtins=yes"
44EXTRA_OECONF_remove_powerpc = "ap_cv_atomic_builtins=yes"
Andrew Geisslere231d582020-05-05 08:53:09 -050045EXTRA_OECONF_remove_riscv32 = "ap_cv_atomic_builtins=yes"
Andrew Geissler82c905d2020-04-13 13:39:40 -050046
47# first line is default yes in configure
48PACKAGECONFIG ??= " \
49 rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \
50 fmhttp imdiag gnutls imfile \
51 ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \
52 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \
53"
54
55# default yes in configure
56PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp,"
57PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,,"
58PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,,"
59PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl,"
60PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,,"
61PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,,"
62PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,,"
63PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
64PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt,"
65PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,,"
66
67# default no in configure
68PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,,"
69PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,,"
70PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,,"
71PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp,"
72PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
73PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
74PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal,"
75PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse,"
76PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
77PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql,"
78PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
79PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,,"
Andrew Geisslerd688a012020-09-18 13:36:00 -050080PACKAGECONFIG[valgrind] = ",--without-valgrind-testbench,valgrind,"
Andrew Geissler97771a32021-03-05 15:23:11 -060081PACKAGECONFIG[imhttp] = "--enable-imhttp,--disable-imhttp,civetweb,"
Andrew Geissler82c905d2020-04-13 13:39:40 -050082
83do_configure_prepend() {
84 sed -i -e 's|python |python3 |g' ${S}/tests/*.sh
85 sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/*.py
86 sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/testsuites/*.py
87}
88
89TESTDIR = "tests"
90do_compile_ptest() {
91 echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
92 oe_runmake -C ${TESTDIR} buildtest-TESTS
93}
94
95do_install_ptest() {
96 # install the tests
97 cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
98 cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
99
100 # do NOT need to rebuild Makefile itself
101 sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
102 # do NOT need to rebuild $(check_PROGRAMS)
103 sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
104
105 # fix the srcdir, top_srcdir
106 sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
107 sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
108 # fix the abs_top_builddir
109 sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
110
Andrew Geissler82c905d2020-04-13 13:39:40 -0500111 # install test-driver
112 install -m 644 ${S}/test-driver ${D}${PTEST_PATH}
113
114 # install necessary links
115 install -d ${D}${PTEST_PATH}/tools
116 ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd
117
118 install -d ${D}${PTEST_PATH}/runtime
119 install -d ${D}${PTEST_PATH}/runtime/.libs
120 (
121 cd ${D}/${libdir}/rsyslog
122 allso="*.so"
123 for i in $allso; do
124 ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i
125 done
126 )
127
128 # fix the module load path with runtime/.libs
129 find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \
130 sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g'
131 # fix the python3 path for tests/set-envar
132 sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/tests/set-envvars
133}
134
135do_install_append() {
136 install -d "${D}${sysconfdir}/init.d"
137 install -d "${D}${sysconfdir}/logrotate.d"
138 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
139 install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
140 install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
141 sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
142
143 if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then
144 install -d 0755 ${D}${sysconfdir}/rsyslog.d
145 echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf
146 fi
147 if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then
148 install -d 0755 ${D}${sysconfdir}/rsyslog.d
149 echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf
150 fi
Andrew Geissler748a4832020-07-24 16:24:21 -0500151 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
Andrew Geissler97771a32021-03-05 15:23:11 -0600152 install -d ${D}${systemd_system_unitdir}
153 install -m 644 ${WORKDIR}/rsyslog.service ${D}${systemd_system_unitdir}
Yi Fan Yu0947bf22021-03-08 14:00:20 -0500154 sed -i -e "s,@sbindir@,${sbindir},g" ${D}${systemd_system_unitdir}/rsyslog.service
Andrew Geissler748a4832020-07-24 16:24:21 -0500155 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -0500156}
157
158FILES_${PN} += "${bindir}"
159
160INITSCRIPT_NAME = "syslog"
161INITSCRIPT_PARAMS = "defaults"
162
163CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
164
165RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng"
166
167RPROVIDES_${PN} += "${PN}-systemd"
168RREPLACES_${PN} += "${PN}-systemd"
169RCONFLICTS_${PN} += "${PN}-systemd"
170SYSTEMD_SERVICE_${PN} = "${BPN}.service"
171
172RDEPENDS_${PN} += "logrotate"
173
174# for rsyslog-ptest
175VALGRIND = "valgrind"
176
177# valgrind supports armv7 and above
178VALGRIND_armv4 = ''
179VALGRIND_armv5 = ''
180VALGRIND_armv6 = ''
181
182# X32 isn't supported by valgrind at this time
183VALGRIND_linux-gnux32 = ''
184VALGRIND_linux-muslx32 = ''
185
186# Disable for some MIPS variants
187VALGRIND_mipsarchr6 = ''
188VALGRIND_linux-gnun32 = ''
189
190# Disable for powerpc64 with musl
191VALGRIND_libc-musl_powerpc64 = ''
192VALGRIND_libc-musl_powerpc64le = ''
193
194# RISC-V support for valgrind is not there yet
195VALGRIND_riscv64 = ""
196VALGRIND_riscv32 = ""
197
198RDEPENDS_${PN}-ptest += "\
199 make diffutils gzip bash gawk coreutils procps \
200 libgcc python3-core python3-io \
201 "
202RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"