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