blob: 8287d2b7fefbbf4c86efbd228ce4e3cdd33834c9 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "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
Brad Bishop93c3acf2019-10-29 09:48:15 -040032SRC_URI[md5sum] = "6d4d94359d083f449f089b8dbb93c423"
33SRC_URI[sha256sum] = "0219ee692f31a39743acb62aaf4196b644ce94edf386df4605fd6a11a4fe0c93"
Brad Bishop19323692019-04-05 15:28:33 -040034
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"
Brad Bishop0a921262019-09-24 07:40:45 -040041EXTRA_OECONF += "--enable-imfile-tests"
Brad Bishop23eaf032019-11-20 05:15:02 -050042EXTRA_OECONF_remove_mipsarch = "ap_cv_atomic_builtins=yes"
Brad Bishop19323692019-04-05 15:28:33 -040043
44# first line is default yes in configure
45PACKAGECONFIG ??= " \
46 rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \
47 fmhttp imdiag gnutls imfile \
48 ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \
49 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \
50"
51
52# default yes in configure
53PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp,"
54PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,,"
55PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,,"
56PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl,"
57PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,,"
58PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,,"
59PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,,"
60PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
61PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt,"
62PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,,"
63
64# default no in configure
65PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,,"
66PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,,"
67PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,,"
68PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp,"
69PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
70PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
71PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal,"
Brad Bishop34ae6002019-04-08 15:21:03 -040072PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse,"
Brad Bishop19323692019-04-05 15:28:33 -040073PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
74PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql,"
75PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
76PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,,"
77PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
78
79TESTDIR = "tests"
80do_compile_ptest() {
81 echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
82 oe_runmake -C ${TESTDIR} buildtest-TESTS
83}
84
85do_install_ptest() {
86 # install the tests
87 cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
88 cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
89
90 # do NOT need to rebuild Makefile itself
91 sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
92 # do NOT need to rebuild $(check_PROGRAMS)
93 sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
94
95 # fix the srcdir, top_srcdir
96 sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
97 sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
98 # fix the abs_top_builddir
99 sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
100
101 # valgrind is not compatible with arm and mips,
102 # so remove related test cases if there is no valgrind.
103 if [ x${VALGRIND} = x ]; then
104 sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
105 fi
106
107 # install test-driver
108 install -m 644 ${S}/test-driver ${D}${PTEST_PATH}
109
110 # install necessary links
111 install -d ${D}${PTEST_PATH}/tools
112 ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd
113
114 install -d ${D}${PTEST_PATH}/runtime
115 install -d ${D}${PTEST_PATH}/runtime/.libs
116 (
117 cd ${D}/${libdir}/rsyslog
118 allso="*.so"
119 for i in $allso; do
120 ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i
121 done
122 )
123
124 # fix the module load path with runtime/.libs
125 find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \
126 sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g'
127}
128
129do_install_append() {
130 install -d "${D}${sysconfdir}/init.d"
131 install -d "${D}${sysconfdir}/logrotate.d"
132 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
133 install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
134 install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
135 sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
136
137 if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then
138 install -d 0755 ${D}${sysconfdir}/rsyslog.d
139 echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf
140 fi
Brad Bishop34ae6002019-04-08 15:21:03 -0400141 if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then
142 install -d 0755 ${D}${sysconfdir}/rsyslog.d
143 echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf
144 fi
Brad Bishop19323692019-04-05 15:28:33 -0400145}
146
147FILES_${PN} += "${bindir}"
148
149INITSCRIPT_NAME = "syslog"
150INITSCRIPT_PARAMS = "defaults"
151
152CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
153
154RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng"
155
156RPROVIDES_${PN} += "${PN}-systemd"
157RREPLACES_${PN} += "${PN}-systemd"
158RCONFLICTS_${PN} += "${PN}-systemd"
159SYSTEMD_SERVICE_${PN} = "${BPN}.service"
160
161RDEPENDS_${PN} += "logrotate"
162
163# for rsyslog-ptest
164VALGRIND = "valgrind"
165VALGRIND_mips = ""
166VALGRIND_mips64 = ""
167VALGRIND_mips64n32 = ""
168VALGRIND_arm = ""
169VALGRIND_aarch64 = ""
170VALGRIND_riscv64 = ""
171RDEPENDS_${PN}-ptest += "\
172 make diffutils gzip bash gawk coreutils procps \
173 libgcc python-core python-io \
174 "
175RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"