Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [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 json-c 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 | file://rsyslog-fix-ptest-not-finish.patch \ |
| 27 | file://json-0.12-fix.patch \ |
| 28 | file://replace_deprecated_GnuTLS_functions.patch \ |
| 29 | file://use_gnutls_certificate_type_set_priority_only_if_available.patch \ |
| 30 | file://enable_tls_ptests.patch \ |
| 31 | " |
| 32 | |
| 33 | SRC_URI[md5sum] = "093c462a5245012bd9e7b82dd8aedffb" |
| 34 | SRC_URI[sha256sum] = "357f089d866c351d5fe5b7139fa85b010223d77b3c21f29b2a1baa8688926111" |
| 35 | |
| 36 | inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest |
| 37 | |
| 38 | EXTRA_OECONF += "--enable-cached-man-pages" |
| 39 | |
| 40 | # first line is default yes in configure |
| 41 | PACKAGECONFIG ??= " \ |
| 42 | zlib rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ |
| 43 | imdiag gnutls imfile \ |
| 44 | ${@bb.utils.contains('DISTRO_FEATURES', 'snmp', 'snmp', '', d)} \ |
| 45 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
| 46 | ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench ${VALGRIND}', '', d)} \ |
| 47 | " |
| 48 | |
| 49 | # default yes in configure |
| 50 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib," |
| 51 | PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," |
| 52 | PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," |
| 53 | PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," |
| 54 | PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," |
| 55 | PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," |
| 56 | PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," |
| 57 | PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," |
| 58 | PACKAGECONFIG[testbench] = "--enable-testbench,--disable-testbench,," |
| 59 | |
| 60 | # default no in configure |
| 61 | PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," |
| 62 | PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," |
| 63 | PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," |
| 64 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," |
| 65 | PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," |
| 66 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," |
| 67 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," |
| 68 | PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," |
| 69 | PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," |
| 70 | PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," |
| 71 | PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," |
| 72 | PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," |
| 73 | |
| 74 | TESTDIR = "tests" |
| 75 | do_compile_ptest() { |
| 76 | echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile |
| 77 | oe_runmake -C ${TESTDIR} buildtest-TESTS |
| 78 | } |
| 79 | |
| 80 | do_install_ptest() { |
| 81 | # install the tests |
| 82 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} |
| 83 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} |
| 84 | |
| 85 | # do NOT need to rebuild Makefile itself |
| 86 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 87 | |
| 88 | # fix the srcdir, top_srcdir |
| 89 | sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 90 | sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 91 | |
| 92 | # valgrind is not compatible with arm and mips, |
| 93 | # so remove related test cases if there is no valgrind. |
| 94 | if [ x${VALGRIND} = x ]; then |
| 95 | sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 96 | fi |
| 97 | |
| 98 | # install test-driver |
| 99 | install -m 644 ${S}/test-driver ${D}${PTEST_PATH}/${TESTDIR} |
| 100 | |
| 101 | # install necessary links |
| 102 | install -d ${D}${PTEST_PATH}/tools |
| 103 | ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd |
| 104 | |
| 105 | install -d ${D}${PTEST_PATH}/runtime |
| 106 | install -d ${D}${PTEST_PATH}/runtime/.libs |
| 107 | ( |
| 108 | cd ${D}/${libdir}/rsyslog |
| 109 | allso="*.so" |
| 110 | for i in $allso; do |
| 111 | ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i |
| 112 | done |
| 113 | ) |
| 114 | |
| 115 | # fix the module load path with runtime/.libs |
| 116 | find ${D}${PTEST_PATH}/${TESTDIR} -name \*.conf -exec \ |
| 117 | sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:' \ |
| 118 | '{}' \; |
| 119 | } |
| 120 | |
| 121 | do_install_append() { |
| 122 | install -d "${D}${sysconfdir}/init.d" |
| 123 | install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog.${BPN} |
| 124 | install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf |
| 125 | install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog |
| 126 | } |
| 127 | |
| 128 | FILES_${PN} += "${bindir}" |
| 129 | |
| 130 | INITSCRIPT_NAME = "syslog" |
| 131 | INITSCRIPT_PARAMS = "defaults" |
| 132 | |
| 133 | # higher than sysklogd's 100 |
| 134 | ALTERNATIVE_PRIORITY = "110" |
| 135 | |
| 136 | ALTERNATIVE_${PN} = "syslogd syslog-conf syslog-logrotate" |
| 137 | |
| 138 | ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" |
| 139 | ALTERNATIVE_TARGET[syslogd] = "${sbindir}/rsyslogd" |
| 140 | ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" |
| 141 | ALTERNATIVE_TARGET[syslog-conf] = "${sysconfdir}/rsyslog.conf" |
| 142 | ALTERNATIVE_LINK_NAME[syslog-logrotate] = "${sysconfdir}/logrotate.d/syslog" |
| 143 | ALTERNATIVE_TARGET[syslog-logrotate] = "${sysconfdir}/logrotate.rsyslog" |
| 144 | |
| 145 | CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" |
| 146 | |
| 147 | RPROVIDES_${PN} += "${PN}-systemd" |
| 148 | RREPLACES_${PN} += "${PN}-systemd" |
| 149 | RCONFLICTS_${PN} += "${PN}-systemd" |
| 150 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" |
| 151 | |
| 152 | RDEPENDS_${PN} += "logrotate" |
| 153 | |
| 154 | # for rsyslog-ptest |
| 155 | VALGRIND = "valgrind" |
| 156 | VALGRIND_mips = "" |
| 157 | VALGRIND_mips64 = "" |
| 158 | VALGRIND_mips64n32 = "" |
| 159 | VALGRIND_arm = "" |
| 160 | VALGRIND_aarch64 = "" |
| 161 | RDEPENDS_${PN}-ptest += "make diffutils gzip" |
| 162 | RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" |
| 163 | |
| 164 | # no syslog-init for systemd |
| 165 | python () { |
| 166 | if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 167 | pn = d.getVar('PN', True) |
| 168 | sysconfdir = d.getVar('sysconfdir', True) |
| 169 | d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init') |
| 170 | d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir)) |
| 171 | d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True))) |
| 172 | |
| 173 | if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d): |
| 174 | pn = d.getVar('PN', True) |
| 175 | d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service') |
| 176 | d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True))) |
| 177 | d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True))) |
| 178 | } |