Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "Rsyslog is an enhanced multi-threaded syslogd" |
| 2 | DESCRIPTION = "\ |
| 3 | Rsyslog 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 | |
| 12 | DEPENDS = "zlib libestr libfastjson bison-native flex-native liblogging" |
| 13 | HOMEPAGE = "http://www.rsyslog.com/" |
| 14 | LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" |
| 15 | LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \ |
| 16 | file://COPYING.LESSER;md5=cb7903f1e5c39ae838209e130dca270a \ |
| 17 | file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\ |
| 18 | " |
| 19 | |
| 20 | SRC_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 | |
| 28 | SRC_URI_append_libc-musl = " \ |
| 29 | file://0001-Include-sys-time-h.patch \ |
| 30 | " |
| 31 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 32 | SRC_URI[md5sum] = "97682af2b1d87f903458cfb41725fba6" |
| 33 | SRC_URI[sha256sum] = "eb27535ece93174ef6b551c88467d2c9cd826b62479625bb881a53d50b079fb5" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 34 | |
| 35 | UPSTREAM_CHECK_URI = "https://github.com/rsyslog/rsyslog/releases" |
| 36 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)" |
| 37 | |
| 38 | inherit autotools pkgconfig systemd update-rc.d ptest |
| 39 | |
| 40 | EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes" |
| 41 | |
| 42 | # first line is default yes in configure |
| 43 | PACKAGECONFIG ??= " \ |
| 44 | rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ |
| 45 | fmhttp imdiag gnutls imfile \ |
| 46 | ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \ |
| 47 | ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \ |
| 48 | " |
| 49 | |
| 50 | # default yes in configure |
| 51 | PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp," |
| 52 | PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," |
| 53 | PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," |
| 54 | PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl," |
| 55 | PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," |
| 56 | PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," |
| 57 | PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," |
| 58 | PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," |
| 59 | PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," |
| 60 | PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,," |
| 61 | |
| 62 | # default no in configure |
| 63 | PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," |
| 64 | PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," |
| 65 | PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," |
| 66 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," |
| 67 | PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," |
| 68 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," |
| 69 | PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal," |
Brad Bishop | 34ae600 | 2019-04-08 15:21:03 -0400 | [diff] [blame] | 70 | PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse," |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 71 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," |
| 72 | PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," |
| 73 | PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," |
| 74 | PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," |
| 75 | PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," |
| 76 | |
| 77 | TESTDIR = "tests" |
| 78 | do_compile_ptest() { |
| 79 | echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile |
| 80 | oe_runmake -C ${TESTDIR} buildtest-TESTS |
| 81 | } |
| 82 | |
| 83 | do_install_ptest() { |
| 84 | # install the tests |
| 85 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} |
| 86 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} |
| 87 | |
| 88 | # do NOT need to rebuild Makefile itself |
| 89 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 90 | # do NOT need to rebuild $(check_PROGRAMS) |
| 91 | sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 92 | |
| 93 | # fix the srcdir, top_srcdir |
| 94 | sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 95 | sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 96 | # fix the abs_top_builddir |
| 97 | sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 98 | |
| 99 | # valgrind is not compatible with arm and mips, |
| 100 | # so remove related test cases if there is no valgrind. |
| 101 | if [ x${VALGRIND} = x ]; then |
| 102 | sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 103 | fi |
| 104 | |
| 105 | # install test-driver |
| 106 | install -m 644 ${S}/test-driver ${D}${PTEST_PATH} |
| 107 | |
| 108 | # install necessary links |
| 109 | install -d ${D}${PTEST_PATH}/tools |
| 110 | ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd |
| 111 | |
| 112 | install -d ${D}${PTEST_PATH}/runtime |
| 113 | install -d ${D}${PTEST_PATH}/runtime/.libs |
| 114 | ( |
| 115 | cd ${D}/${libdir}/rsyslog |
| 116 | allso="*.so" |
| 117 | for i in $allso; do |
| 118 | ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i |
| 119 | done |
| 120 | ) |
| 121 | |
| 122 | # fix the module load path with runtime/.libs |
| 123 | find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \ |
| 124 | sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g' |
| 125 | } |
| 126 | |
| 127 | do_install_append() { |
| 128 | install -d "${D}${sysconfdir}/init.d" |
| 129 | install -d "${D}${sysconfdir}/logrotate.d" |
| 130 | install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog |
| 131 | install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf |
| 132 | install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog |
| 133 | sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog |
| 134 | |
| 135 | if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then |
| 136 | install -d 0755 ${D}${sysconfdir}/rsyslog.d |
| 137 | echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf |
| 138 | fi |
Brad Bishop | 34ae600 | 2019-04-08 15:21:03 -0400 | [diff] [blame] | 139 | if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then |
| 140 | install -d 0755 ${D}${sysconfdir}/rsyslog.d |
| 141 | echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf |
| 142 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | FILES_${PN} += "${bindir}" |
| 146 | |
| 147 | INITSCRIPT_NAME = "syslog" |
| 148 | INITSCRIPT_PARAMS = "defaults" |
| 149 | |
| 150 | CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" |
| 151 | |
| 152 | RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng" |
| 153 | |
| 154 | RPROVIDES_${PN} += "${PN}-systemd" |
| 155 | RREPLACES_${PN} += "${PN}-systemd" |
| 156 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 157 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" |
| 158 | |
| 159 | RDEPENDS_${PN} += "logrotate" |
| 160 | |
| 161 | # for rsyslog-ptest |
| 162 | VALGRIND = "valgrind" |
| 163 | VALGRIND_mips = "" |
| 164 | VALGRIND_mips64 = "" |
| 165 | VALGRIND_mips64n32 = "" |
| 166 | VALGRIND_arm = "" |
| 167 | VALGRIND_aarch64 = "" |
| 168 | VALGRIND_riscv64 = "" |
| 169 | RDEPENDS_${PN}-ptest += "\ |
| 170 | make diffutils gzip bash gawk coreutils procps \ |
| 171 | libgcc python-core python-io \ |
| 172 | " |
| 173 | RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" |