Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [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/" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 14 | LICENSE = "GPL-3.0-only & LGPL-3.0-only & Apache-2.0" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 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://rsyslog.service \ |
| 25 | file://use-pkgconfig-to-check-libgcrypt.patch \ |
| 26 | file://run-ptest \ |
| 27 | file://0001-tests-disable-the-check-for-inotify.patch \ |
| 28 | " |
| 29 | |
| 30 | SRC_URI:append:libc-musl = " \ |
| 31 | file://0001-Include-sys-time-h.patch \ |
| 32 | " |
| 33 | |
| 34 | SRC_URI[sha256sum] = "e41308a5a171939b3cbc246e9d4bd30be44e801521e04cd95d051fa3867d6738" |
| 35 | |
| 36 | UPSTREAM_CHECK_URI = "https://github.com/rsyslog/rsyslog/releases" |
| 37 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)" |
| 38 | |
| 39 | inherit autotools pkgconfig systemd update-rc.d ptest |
| 40 | |
| 41 | EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes" |
| 42 | EXTRA_OECONF += "--enable-imfile-tests" |
| 43 | EXTRA_OECONF:remove:mipsarch = "ap_cv_atomic_builtins=yes" |
| 44 | EXTRA_OECONF:remove:powerpc = "ap_cv_atomic_builtins=yes" |
| 45 | EXTRA_OECONF:remove:riscv32 = "ap_cv_atomic_builtins=yes" |
| 46 | |
| 47 | # first line is default yes in configure |
| 48 | PACKAGECONFIG ??= " \ |
| 49 | rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ |
| 50 | fmhttp imdiag gnutls imfile \ |
| 51 | ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \ |
| 52 | ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \ |
| 53 | " |
| 54 | |
| 55 | # default yes in configure |
| 56 | PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp," |
| 57 | PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," |
| 58 | PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," |
| 59 | PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl," |
| 60 | PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," |
| 61 | PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," |
| 62 | PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," |
| 63 | PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," |
| 64 | PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," |
| 65 | PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,," |
| 66 | |
| 67 | # default no in configure |
| 68 | PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," |
| 69 | PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," |
| 70 | PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," |
| 71 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," |
| 72 | PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," |
| 73 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," |
| 74 | PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal," |
| 75 | PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse," |
| 76 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," |
| 77 | PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," |
| 78 | PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," |
| 79 | PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," |
| 80 | PACKAGECONFIG[valgrind] = ",--without-valgrind-testbench,valgrind," |
| 81 | PACKAGECONFIG[imhttp] = "--enable-imhttp,--disable-imhttp,civetweb," |
| 82 | |
| 83 | |
| 84 | TESTDIR = "tests" |
| 85 | do_compile_ptest() { |
| 86 | echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile |
| 87 | oe_runmake -C ${TESTDIR} buildtest-TESTS |
| 88 | } |
| 89 | |
| 90 | do_install_ptest() { |
| 91 | # install the tests |
| 92 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} |
| 93 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} |
| 94 | |
| 95 | # give permissions to all users |
| 96 | # some tests need to write to this directory as user 'daemon' |
| 97 | chmod 777 -R ${D}${PTEST_PATH}/tests |
| 98 | |
| 99 | # do NOT need to rebuild Makefile itself |
| 100 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 101 | # do NOT need to rebuild $(check_PROGRAMS) |
| 102 | sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 103 | |
| 104 | # fix the srcdir, top_srcdir |
| 105 | sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 106 | sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 107 | # fix the abs_top_builddir |
| 108 | sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 109 | |
| 110 | # install test-driver |
| 111 | install -m 644 ${S}/test-driver ${D}${PTEST_PATH} |
| 112 | |
| 113 | # install necessary links |
| 114 | install -d ${D}${PTEST_PATH}/tools |
| 115 | ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd |
| 116 | |
| 117 | install -d ${D}${PTEST_PATH}/runtime |
| 118 | install -d ${D}${PTEST_PATH}/runtime/.libs |
| 119 | ( |
| 120 | cd ${D}/${libdir}/rsyslog |
| 121 | allso="*.so" |
| 122 | for i in $allso; do |
| 123 | ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i |
| 124 | done |
| 125 | ) |
| 126 | |
| 127 | # fix the module load path with runtime/.libs |
| 128 | find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \ |
| 129 | sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g' |
| 130 | # fix the python3 path for tests/set-envar |
| 131 | sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/tests/set-envvars |
| 132 | } |
| 133 | |
| 134 | do_install:append() { |
| 135 | install -d "${D}${sysconfdir}/init.d" |
| 136 | install -d "${D}${sysconfdir}/logrotate.d" |
| 137 | install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog |
| 138 | install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf |
| 139 | install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog |
| 140 | sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog |
| 141 | |
| 142 | if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then |
| 143 | install -d 0755 ${D}${sysconfdir}/rsyslog.d |
| 144 | echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf |
| 145 | fi |
| 146 | if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then |
| 147 | install -d 0755 ${D}${sysconfdir}/rsyslog.d |
| 148 | echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf |
| 149 | fi |
| 150 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 151 | install -d ${D}${systemd_system_unitdir} |
| 152 | install -m 644 ${WORKDIR}/rsyslog.service ${D}${systemd_system_unitdir} |
| 153 | sed -i -e "s,@sbindir@,${sbindir},g" ${D}${systemd_system_unitdir}/rsyslog.service |
| 154 | fi |
| 155 | } |
| 156 | |
| 157 | FILES:${PN} += "${bindir}" |
| 158 | |
| 159 | INITSCRIPT_NAME = "syslog" |
| 160 | INITSCRIPT_PARAMS = "defaults" |
| 161 | |
| 162 | CONFFILES:${PN} = "${sysconfdir}/rsyslog.conf" |
| 163 | |
| 164 | RCONFLICTS:${PN} = "busybox-syslog sysklogd syslog-ng" |
| 165 | |
| 166 | RPROVIDES:${PN} += "${PN}-systemd" |
| 167 | RREPLACES:${PN} += "${PN}-systemd" |
| 168 | RCONFLICTS:${PN} += "${PN}-systemd" |
| 169 | SYSTEMD_SERVICE:${PN} = "${BPN}.service" |
| 170 | |
| 171 | RDEPENDS:${PN} += "logrotate" |
| 172 | |
| 173 | # for rsyslog-ptest |
| 174 | VALGRIND = "valgrind" |
| 175 | |
| 176 | # valgrind supports armv7 and above |
| 177 | VALGRIND:armv4 = '' |
| 178 | VALGRIND:armv5 = '' |
| 179 | VALGRIND:armv6 = '' |
| 180 | |
| 181 | # X32 isn't supported by valgrind at this time |
| 182 | VALGRIND:linux-gnux32 = '' |
| 183 | VALGRIND:linux-muslx32 = '' |
| 184 | |
| 185 | # Disable for some MIPS variants |
| 186 | VALGRIND:mipsarchr6 = '' |
| 187 | VALGRIND:linux-gnun32 = '' |
| 188 | |
| 189 | # Disable for powerpc64 with musl |
| 190 | VALGRIND:libc-musl:powerpc64 = '' |
| 191 | VALGRIND:libc-musl:powerpc64le = '' |
| 192 | |
| 193 | # RISC-V support for valgrind is not there yet |
| 194 | VALGRIND:riscv64 = "" |
| 195 | VALGRIND:riscv32 = "" |
| 196 | |
| 197 | # util-linux: logger needs the -d option |
| 198 | RDEPENDS:${PN}-ptest += "\ |
| 199 | make diffutils gzip bash gawk coreutils procps \ |
| 200 | libgcc python3-core python3-io python3-json \ |
| 201 | curl util-linux shadow \ |
| 202 | " |
| 203 | |
| 204 | RRECOMMENDS:${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" |