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