blob: 7056e1c6ad5ca1a58a5b41b4f31f876fbbd2a006 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -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 file://rsyslog-fix-ptest-not-finish.patch \
27"
28
29SRC_URI_append_libc-musl = " \
30 file://0001-Undefine-GLOB_BRACE.patch \
31 file://0001-Include-sys-time-h.patch \
32"
33
34SRC_URI[md5sum] = "3805617f65a4b4bea34606487a5255a0"
35SRC_URI[sha256sum] = "220ba30b5afb0f3ddb328613fea7aa3966b01e4d0c52d6de9ab27b0858f19738"
36
37inherit autotools pkgconfig systemd update-rc.d ptest
38
39EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"
40
41# first line is default yes in configure
42PACKAGECONFIG ??= " \
43 rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \
44 imdiag gnutls imfile \
45 ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \
46 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \
47"
48
49# default yes in configure
50PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp,"
51PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,,"
52PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,,"
53PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,,"
54PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,,"
55PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,,"
56PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
57PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt,"
58PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,,"
59
60# default no in configure
61PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,,"
62PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,,"
63PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,,"
64PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp,"
65PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
66PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
67PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
68PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql,"
69PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
70PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,,"
71PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
72
73TESTDIR = "tests"
74do_compile_ptest() {
75 echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
76 oe_runmake -C ${TESTDIR} buildtest-TESTS
77}
78
79do_install_ptest() {
80 # install the tests
81 cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
82 cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
83
84 # do NOT need to rebuild Makefile itself
85 sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
86
87 # fix the srcdir, top_srcdir
88 sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
89 sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
90
91 # valgrind is not compatible with arm and mips,
92 # so remove related test cases if there is no valgrind.
93 if [ x${VALGRIND} = x ]; then
94 sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
95 fi
96
97 # install test-driver
98 install -m 644 ${S}/test-driver ${D}${PTEST_PATH}
99
100 # install necessary links
101 install -d ${D}${PTEST_PATH}/tools
102 ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd
103
104 install -d ${D}${PTEST_PATH}/runtime
105 install -d ${D}${PTEST_PATH}/runtime/.libs
106 (
107 cd ${D}/${libdir}/rsyslog
108 allso="*.so"
109 for i in $allso; do
110 ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i
111 done
112 )
113
114 # fix the module load path with runtime/.libs
115 find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \
116 sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g'
117}
118
119do_install_append() {
120 install -d "${D}${sysconfdir}/init.d"
121 install -d "${D}${sysconfdir}/logrotate.d"
122 install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
123 install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
124 install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog
125}
126
127FILES_${PN} += "${bindir}"
128
129INITSCRIPT_NAME = "syslog"
130INITSCRIPT_PARAMS = "defaults"
131
132CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
133
134RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng"
135
136RPROVIDES_${PN} += "${PN}-systemd"
137RREPLACES_${PN} += "${PN}-systemd"
138RCONFLICTS_${PN} += "${PN}-systemd"
139SYSTEMD_SERVICE_${PN} = "${BPN}.service"
140
141RDEPENDS_${PN} += "logrotate"
142
143# for rsyslog-ptest
144VALGRIND = "valgrind"
145VALGRIND_mips = ""
146VALGRIND_mips64 = ""
147VALGRIND_mips64n32 = ""
148VALGRIND_arm = ""
149VALGRIND_aarch64 = ""
150RDEPENDS_${PN}-ptest += "make diffutils gzip bash gawk coreutils procps"
151RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"