diff options
Diffstat (limited to 'meta-oe/recipes-extended/rsyslog/rsyslog_8.2006.0.bb')
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/rsyslog_8.2006.0.bb | 201 |
1 files changed, 201 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_8.2006.0.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_8.2006.0.bb new file mode 100644 index 0000000000..ff6699509f --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog_8.2006.0.bb | |||
| @@ -0,0 +1,201 @@ | |||
| 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 | |||
| 32 | SRC_URI[md5sum] = "33de768941953ceeca9d1a437b47891b" | ||
| 33 | SRC_URI[sha256sum] = "d9589e64866f2fdc5636af4cae9d60ebf1e3257bb84b81ee953ede6a05878e97" | ||
| 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 | EXTRA_OECONF += "--enable-imfile-tests" | ||
| 42 | EXTRA_OECONF_remove_mipsarch = "ap_cv_atomic_builtins=yes" | ||
| 43 | EXTRA_OECONF_remove_powerpc = "ap_cv_atomic_builtins=yes" | ||
| 44 | EXTRA_OECONF_remove_riscv32 = "ap_cv_atomic_builtins=yes" | ||
| 45 | |||
| 46 | # first line is default yes in configure | ||
| 47 | PACKAGECONFIG ??= " \ | ||
| 48 | rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ | ||
| 49 | fmhttp imdiag gnutls imfile \ | ||
| 50 | ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \ | ||
| 51 | ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \ | ||
| 52 | " | ||
| 53 | |||
| 54 | # default yes in configure | ||
| 55 | PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp," | ||
| 56 | PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," | ||
| 57 | PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," | ||
| 58 | PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl," | ||
| 59 | PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," | ||
| 60 | PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," | ||
| 61 | PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," | ||
| 62 | PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," | ||
| 63 | PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," | ||
| 64 | PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,," | ||
| 65 | |||
| 66 | # default no in configure | ||
| 67 | PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," | ||
| 68 | PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," | ||
| 69 | PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," | ||
| 70 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," | ||
| 71 | PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," | ||
| 72 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," | ||
| 73 | PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal," | ||
| 74 | PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse," | ||
| 75 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," | ||
| 76 | PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," | ||
| 77 | PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," | ||
| 78 | PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," | ||
| 79 | PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," | ||
| 80 | |||
| 81 | do_configure_prepend() { | ||
| 82 | sed -i -e 's|python |python3 |g' ${S}/tests/*.sh | ||
| 83 | sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/*.py | ||
| 84 | sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/testsuites/*.py | ||
| 85 | } | ||
| 86 | |||
| 87 | TESTDIR = "tests" | ||
| 88 | do_compile_ptest() { | ||
| 89 | echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile | ||
| 90 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
| 91 | } | ||
| 92 | |||
| 93 | do_install_ptest() { | ||
| 94 | # install the tests | ||
| 95 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} | ||
| 96 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
| 97 | |||
| 98 | # do NOT need to rebuild Makefile itself | ||
| 99 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 100 | # do NOT need to rebuild $(check_PROGRAMS) | ||
| 101 | sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 102 | |||
| 103 | # fix the srcdir, top_srcdir | ||
| 104 | sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 105 | sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 106 | # fix the abs_top_builddir | ||
| 107 | sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 108 | |||
| 109 | # valgrind is not compatible with arm and mips, | ||
| 110 | # so remove related test cases if there is no valgrind. | ||
| 111 | if [ x${VALGRIND} = x ]; then | ||
| 112 | sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 113 | fi | ||
| 114 | |||
| 115 | # install test-driver | ||
| 116 | install -m 644 ${S}/test-driver ${D}${PTEST_PATH} | ||
| 117 | |||
| 118 | # install necessary links | ||
| 119 | install -d ${D}${PTEST_PATH}/tools | ||
| 120 | ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd | ||
| 121 | |||
| 122 | install -d ${D}${PTEST_PATH}/runtime | ||
| 123 | install -d ${D}${PTEST_PATH}/runtime/.libs | ||
| 124 | ( | ||
| 125 | cd ${D}/${libdir}/rsyslog | ||
| 126 | allso="*.so" | ||
| 127 | for i in $allso; do | ||
| 128 | ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i | ||
| 129 | done | ||
| 130 | ) | ||
| 131 | |||
| 132 | # fix the module load path with runtime/.libs | ||
| 133 | find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \ | ||
| 134 | sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g' | ||
| 135 | # fix the python3 path for tests/set-envar | ||
| 136 | sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/tests/set-envvars | ||
| 137 | } | ||
| 138 | |||
| 139 | do_install_append() { | ||
| 140 | install -d "${D}${sysconfdir}/init.d" | ||
| 141 | install -d "${D}${sysconfdir}/logrotate.d" | ||
| 142 | install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog | ||
| 143 | install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf | ||
| 144 | install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog | ||
| 145 | sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog | ||
| 146 | |||
| 147 | if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then | ||
| 148 | install -d 0755 ${D}${sysconfdir}/rsyslog.d | ||
| 149 | echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf | ||
| 150 | fi | ||
| 151 | if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then | ||
| 152 | install -d 0755 ${D}${sysconfdir}/rsyslog.d | ||
| 153 | echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf | ||
| 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 | RDEPENDS_${PN}-ptest += "\ | ||
| 198 | make diffutils gzip bash gawk coreutils procps \ | ||
| 199 | libgcc python3-core python3-io \ | ||
| 200 | " | ||
| 201 | RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" | ||
