rsyslog_8.22.0.bb 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. file://rsyslog-fix-ptest-not-finish.patch \
  25. "
  26. SRC_URI[md5sum] = "ad0f25f429aa2daa326732950a5eeb6c"
  27. SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caae640ca"
  28. inherit autotools pkgconfig systemd update-rc.d ptest
  29. EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"
  30. # first line is default yes in configure
  31. PACKAGECONFIG ??= " \
  32. rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \
  33. imdiag gnutls imfile \
  34. ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \
  35. ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \
  36. "
  37. # default yes in configure
  38. PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp,"
  39. PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,,"
  40. PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,,"
  41. PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,,"
  42. PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,,"
  43. PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,,"
  44. PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
  45. PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt,"
  46. PACKAGECONFIG[testbench] = "--enable-testbench,--disable-testbench,,"
  47. # default no in configure
  48. PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,,"
  49. PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,,"
  50. PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,,"
  51. PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp,"
  52. PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
  53. PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
  54. PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
  55. PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql,"
  56. PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
  57. PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,,"
  58. PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
  59. TESTDIR = "tests"
  60. do_compile_ptest() {
  61. echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
  62. oe_runmake -C ${TESTDIR} buildtest-TESTS
  63. }
  64. do_install_ptest() {
  65. # install the tests
  66. cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
  67. cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
  68. # do NOT need to rebuild Makefile itself
  69. sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
  70. # fix the srcdir, top_srcdir
  71. sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
  72. sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
  73. # valgrind is not compatible with arm and mips,
  74. # so remove related test cases if there is no valgrind.
  75. if [ x${VALGRIND} = x ]; then
  76. sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
  77. fi
  78. # install test-driver
  79. install -m 644 ${S}/test-driver ${D}${PTEST_PATH}
  80. # install necessary links
  81. install -d ${D}${PTEST_PATH}/tools
  82. ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd
  83. install -d ${D}${PTEST_PATH}/runtime
  84. install -d ${D}${PTEST_PATH}/runtime/.libs
  85. (
  86. cd ${D}/${libdir}/rsyslog
  87. allso="*.so"
  88. for i in $allso; do
  89. ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i
  90. done
  91. )
  92. # fix the module load path with runtime/.libs
  93. find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \
  94. sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g'
  95. }
  96. do_install_append() {
  97. install -d "${D}${sysconfdir}/init.d"
  98. install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
  99. install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
  100. install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog
  101. }
  102. FILES_${PN} += "${bindir}"
  103. INITSCRIPT_NAME = "syslog"
  104. INITSCRIPT_PARAMS = "defaults"
  105. CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
  106. RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng"
  107. RPROVIDES_${PN} += "${PN}-systemd"
  108. RREPLACES_${PN} += "${PN}-systemd"
  109. RCONFLICTS_${PN} += "${PN}-systemd"
  110. SYSTEMD_SERVICE_${PN} = "${BPN}.service"
  111. RDEPENDS_${PN} += "logrotate"
  112. # for rsyslog-ptest
  113. VALGRIND = "valgrind"
  114. VALGRIND_mips = ""
  115. VALGRIND_mips64 = ""
  116. VALGRIND_mips64n32 = ""
  117. VALGRIND_arm = ""
  118. VALGRIND_aarch64 = ""
  119. RDEPENDS_${PN}-ptest += "make diffutils gzip bash gawk coreutils procps"
  120. RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"