rsyslog_8.1911.0.bb 7.4 KB

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