From b2d3dacc5e56de23195a98929cb21e5abf1e2812 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Tue, 20 Sep 2016 01:57:25 -0400 Subject: rsyslog: upgrade to 7.6.7 * fix CVEs CVE-2014-3634, CVE-2014-3683 * rebase the patch use-pkgconfig-to-check-libgcrypt.patch * backport fixes for build error: lexer.l:34:14: error: expected identifier or '(' before '__extension__' * replace the old configure option '--enable-cached-man-pages' with '--disable-generate-man-pages' Signed-off-by: Wenzong Fan Signed-off-by: Martin Jansa --- ...include-config.h-before-any-other-headers.patch | 51 ++++++ .../rsyslog/use-pkgconfig-to-check-libgcrypt.patch | 25 ++- meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb | 178 -------------------- meta-oe/recipes-extended/rsyslog/rsyslog_7.6.7.bb | 179 +++++++++++++++++++++ 4 files changed, 241 insertions(+), 192 deletions(-) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/bugfix-include-config.h-before-any-other-headers.patch delete mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog_7.6.7.bb (limited to 'meta-oe/recipes-extended') diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/bugfix-include-config.h-before-any-other-headers.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/bugfix-include-config.h-before-any-other-headers.patch new file mode 100644 index 000000000..1048b423d --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog/bugfix-include-config.h-before-any-other-headers.patch @@ -0,0 +1,51 @@ +Backport below commit for fixing: + +lexer.l:34:14: error: expected identifier or '(' before '__extension__' + +From 876bdd1c85353f7e254f4b4c3e228484860cea57 Mon Sep 17 00:00:00 2001 +From: Tomas Heinrich +Date: Mon, 17 Nov 2014 20:53:22 +0100 +Subject: [PATCH] bugfix: include config.h before any other headers + +For some reason, flex used to prepend several standard headers before +config.h. This prevented some conditional extension in these headers +from being defined. + +The explicit prototype for strdup() shouldn't be required anymore as +it should be provided by string.h. + +Upstream-Status: Backport +--- + grammar/lexer.l | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/grammar/lexer.l b/grammar/lexer.l +index 359cf9f..c834ef7 100644 +--- a/grammar/lexer.l ++++ b/grammar/lexer.l +@@ -28,10 +28,12 @@ + * limitations under the License. + */ + +-%{ ++%top{ + #include "config.h" ++} ++ ++%{ + #include "parserif.h" +-extern char *strdup(__const char*); /* somehow we may not get this from string.h... */ + %} + + %option noyywrap nodefault case-insensitive yylineno +@@ -67,6 +69,7 @@ extern char *strdup(__const char*); /* somehow we may not get this from string.h + #include + #include + #include ++#include + #include + #include + #include "rainerscript.h" +-- +2.7.4 + diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch index ebc10707c..46eddd604 100644 --- a/meta-oe/recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch +++ b/meta-oe/recipes-extended/rsyslog/rsyslog/use-pkgconfig-to-check-libgcrypt.patch @@ -9,34 +9,31 @@ libgcrypt does no longer provide libgcrypt-config, and provide *.pc, so we should use pkgconfig to check Signed-off-by: Roy Li +Signed-off-by: Wenzong Fan --- - configure.ac | 19 +------------------ - 1 file changed, 1 insertion(+), 18 deletions(-) + configure.ac | 15 +-------------- + 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac -index 017116e..1b880f8 100644 +index 0f31869..d35db42 100644 --- a/configure.ac +++ b/configure.ac -@@ -784,24 +784,7 @@ AC_ARG_ENABLE(libgcrypt, +@@ -777,20 +777,7 @@ AC_ARG_ENABLE(libgcrypt, [enable_libgcrypt=yes] ) if test "x$enable_libgcrypt" = "xyes"; then -- AC_CHECK_PROG( -- [HAVE_LIBGCRYPT_CONFIG], -- [libgcrypt-config], -- [yes],,, -- ) -- if test "x${HAVE_LIBGCRYPT_CONFIG}" != "xyes"; then +- AC_PATH_PROG([LIBGCRYPT_CONFIG],[libgcrypt-config],[no]) +- if test "x${LIBGCRYPT_CONFIG}" = "xno"; then - AC_MSG_FAILURE([libgcrypt-config not found in PATH]) - fi - AC_CHECK_LIB( - [gcrypt], - [gcry_cipher_open], -- [LIBGCRYPT_CFLAGS="`libgcrypt-config --cflags`" -- LIBGCRYPT_LIBS="`libgcrypt-config --libs`" +- [LIBGCRYPT_CFLAGS="`${LIBGCRYPT_CONFIG} --cflags`" +- LIBGCRYPT_LIBS="`${LIBGCRYPT_CONFIG} --libs`" - ], - [AC_MSG_FAILURE([libgcrypt is missing])], -- [`libgcrypt-config --libs --cflags`] +- [`${LIBGCRYPT_CONFIG} --libs --cflags`] - ) - AC_DEFINE([ENABLE_LIBGCRYPT], [1], [Indicator that LIBGCRYPT is present]) + PKG_CHECK_MODULES(LIBGCRYPT, libgcrypt) @@ -44,5 +41,5 @@ index 017116e..1b880f8 100644 AM_CONDITIONAL(ENABLE_LIBGCRYPT, test x$enable_libgcrypt = xyes) AC_SUBST(LIBGCRYPT_CFLAGS) -- -1.7.9.5 +2.8.1 diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb deleted file mode 100644 index c1d923c75..000000000 --- a/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb +++ /dev/null @@ -1,178 +0,0 @@ -SUMMARY = "Rsyslog is an enhanced multi-threaded syslogd" -DESCRIPTION = "\ -Rsyslog is an enhanced syslogd supporting, among others, MySQL,\ - PostgreSQL, failover log destinations, syslog/tcp, fine grain\ - output format control, high precision timestamps, queued operations\ - and the ability to filter on any message part. It is quite\ - compatible to stock sysklogd and can be used as a drop-in replacement.\ - Its advanced features make it suitable for enterprise-class,\ - encryption protected syslog relay chains while at the same time being\ - very easy to setup for the novice user." - -DEPENDS = "zlib libestr json-c bison-native flex-native liblogging" -HOMEPAGE = "http://www.rsyslog.com/" -LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" -LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \ - file://COPYING.LESSER;md5=cb7903f1e5c39ae838209e130dca270a \ - file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\ -" - -SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.tar.gz \ - file://initscript \ - file://rsyslog.conf \ - file://rsyslog.logrotate \ - file://use-pkgconfig-to-check-libgcrypt.patch \ - file://run-ptest \ - file://rsyslog-fix-ptest-not-finish.patch \ - file://json-0.12-fix.patch \ - file://replace_deprecated_GnuTLS_functions.patch \ - file://use_gnutls_certificate_type_set_priority_only_if_available.patch \ - file://enable_tls_ptests.patch \ -" - -SRC_URI[md5sum] = "093c462a5245012bd9e7b82dd8aedffb" -SRC_URI[sha256sum] = "357f089d866c351d5fe5b7139fa85b010223d77b3c21f29b2a1baa8688926111" - -inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest - -EXTRA_OECONF += "--enable-cached-man-pages" - -# first line is default yes in configure -PACKAGECONFIG ??= " \ - zlib rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ - imdiag gnutls imfile \ - ${@bb.utils.contains('DISTRO_FEATURES', 'snmp', 'snmp', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench ${VALGRIND}', '', d)} \ -" - -# default yes in configure -PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib," -PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," -PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," -PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," -PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," -PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," -PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," -PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," -PACKAGECONFIG[testbench] = "--enable-testbench,--disable-testbench,," - -# default no in configure -PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," -PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," -PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," -PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," -PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," -PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," -PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," -PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," -PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," -PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," -PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," -PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," - -TESTDIR = "tests" -do_compile_ptest() { - echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile - oe_runmake -C ${TESTDIR} buildtest-TESTS -} - -do_install_ptest() { - # install the tests - cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} - cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} - - # do NOT need to rebuild Makefile itself - sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile - - # fix the srcdir, top_srcdir - sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile - sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile - - # valgrind is not compatible with arm and mips, - # so remove related test cases if there is no valgrind. - if [ x${VALGRIND} = x ]; then - sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile - fi - - # install test-driver - install -m 644 ${S}/test-driver ${D}${PTEST_PATH}/${TESTDIR} - - # install necessary links - install -d ${D}${PTEST_PATH}/tools - ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd - - install -d ${D}${PTEST_PATH}/runtime - install -d ${D}${PTEST_PATH}/runtime/.libs - ( - cd ${D}/${libdir}/rsyslog - allso="*.so" - for i in $allso; do - ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i - done - ) - - # fix the module load path with runtime/.libs - find ${D}${PTEST_PATH}/${TESTDIR} -name \*.conf -exec \ - sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:' \ - '{}' \; -} - -do_install_append() { - install -d "${D}${sysconfdir}/init.d" - install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog.${BPN} - install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf - install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog -} - -FILES_${PN} += "${bindir}" - -INITSCRIPT_NAME = "syslog" -INITSCRIPT_PARAMS = "defaults" - -# higher than sysklogd's 100 -ALTERNATIVE_PRIORITY = "110" - -ALTERNATIVE_${PN} = "syslogd syslog-conf syslog-logrotate" - -ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" -ALTERNATIVE_TARGET[syslogd] = "${sbindir}/rsyslogd" -ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" -ALTERNATIVE_TARGET[syslog-conf] = "${sysconfdir}/rsyslog.conf" -ALTERNATIVE_LINK_NAME[syslog-logrotate] = "${sysconfdir}/logrotate.d/syslog" -ALTERNATIVE_TARGET[syslog-logrotate] = "${sysconfdir}/logrotate.rsyslog" - -CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" - -RPROVIDES_${PN} += "${PN}-systemd" -RREPLACES_${PN} += "${PN}-systemd" -RCONFLICTS_${PN} += "${PN}-systemd" -SYSTEMD_SERVICE_${PN} = "${BPN}.service" - -RDEPENDS_${PN} += "logrotate" - -# for rsyslog-ptest -VALGRIND = "valgrind" -VALGRIND_mips = "" -VALGRIND_mips64 = "" -VALGRIND_mips64n32 = "" -VALGRIND_arm = "" -VALGRIND_aarch64 = "" -RDEPENDS_${PN}-ptest += "make diffutils gzip" -RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" - -# no syslog-init for systemd -python () { - if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): - pn = d.getVar('PN', True) - sysconfdir = d.getVar('sysconfdir', True) - d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init') - d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir)) - d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True))) - - if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d): - pn = d.getVar('PN', True) - d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service') - d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True))) - d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True))) -} diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.7.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.7.bb new file mode 100644 index 000000000..664ab9ff7 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog_7.6.7.bb @@ -0,0 +1,179 @@ +SUMMARY = "Rsyslog is an enhanced multi-threaded syslogd" +DESCRIPTION = "\ +Rsyslog is an enhanced syslogd supporting, among others, MySQL,\ + PostgreSQL, failover log destinations, syslog/tcp, fine grain\ + output format control, high precision timestamps, queued operations\ + and the ability to filter on any message part. It is quite\ + compatible to stock sysklogd and can be used as a drop-in replacement.\ + Its advanced features make it suitable for enterprise-class,\ + encryption protected syslog relay chains while at the same time being\ + very easy to setup for the novice user." + +DEPENDS = "zlib libestr json-c bison-native flex-native liblogging" +HOMEPAGE = "http://www.rsyslog.com/" +LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \ + file://COPYING.LESSER;md5=cb7903f1e5c39ae838209e130dca270a \ + file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\ +" + +SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.tar.gz \ + file://initscript \ + file://rsyslog.conf \ + file://rsyslog.logrotate \ + file://use-pkgconfig-to-check-libgcrypt.patch \ + file://run-ptest \ + file://rsyslog-fix-ptest-not-finish.patch \ + file://json-0.12-fix.patch \ + file://replace_deprecated_GnuTLS_functions.patch \ + file://use_gnutls_certificate_type_set_priority_only_if_available.patch \ + file://bugfix-include-config.h-before-any-other-headers.patch \ + file://enable_tls_ptests.patch \ +" + +SRC_URI[md5sum] = "fa78a6e675fe78a811edcdf7eb6f1975" +SRC_URI[sha256sum] = "fc29d2d9cbf3396091dd0bab2eb6f847aed4a44ef73138a97ddf9447446125ee" + +inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest + +EXTRA_OECONF += "--disable-generate-man-pages" + +# first line is default yes in configure +PACKAGECONFIG ??= " \ + zlib rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ + imdiag gnutls imfile \ + ${@bb.utils.contains('DISTRO_FEATURES', 'snmp', 'snmp', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench ${VALGRIND}', '', d)} \ +" + +# default yes in configure +PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib," +PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," +PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," +PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," +PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," +PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," +PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," +PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," +PACKAGECONFIG[testbench] = "--enable-testbench,--disable-testbench,," + +# default no in configure +PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," +PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," +PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," +PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," +PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," +PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," +PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," +PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," +PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," +PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," +PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," +PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," + +TESTDIR = "tests" +do_compile_ptest() { + echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile + oe_runmake -C ${TESTDIR} buildtest-TESTS +} + +do_install_ptest() { + # install the tests + cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} + cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} + + # do NOT need to rebuild Makefile itself + sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile + + # fix the srcdir, top_srcdir + sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile + sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile + + # valgrind is not compatible with arm and mips, + # so remove related test cases if there is no valgrind. + if [ x${VALGRIND} = x ]; then + sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile + fi + + # install test-driver + install -m 644 ${S}/test-driver ${D}${PTEST_PATH}/${TESTDIR} + + # install necessary links + install -d ${D}${PTEST_PATH}/tools + ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd + + install -d ${D}${PTEST_PATH}/runtime + install -d ${D}${PTEST_PATH}/runtime/.libs + ( + cd ${D}/${libdir}/rsyslog + allso="*.so" + for i in $allso; do + ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i + done + ) + + # fix the module load path with runtime/.libs + find ${D}${PTEST_PATH}/${TESTDIR} -name \*.conf -exec \ + sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:' \ + '{}' \; +} + +do_install_append() { + install -d "${D}${sysconfdir}/init.d" + install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog.${BPN} + install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf + install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog +} + +FILES_${PN} += "${bindir}" + +INITSCRIPT_NAME = "syslog" +INITSCRIPT_PARAMS = "defaults" + +# higher than sysklogd's 100 +ALTERNATIVE_PRIORITY = "110" + +ALTERNATIVE_${PN} = "syslogd syslog-conf syslog-logrotate" + +ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" +ALTERNATIVE_TARGET[syslogd] = "${sbindir}/rsyslogd" +ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf" +ALTERNATIVE_TARGET[syslog-conf] = "${sysconfdir}/rsyslog.conf" +ALTERNATIVE_LINK_NAME[syslog-logrotate] = "${sysconfdir}/logrotate.d/syslog" +ALTERNATIVE_TARGET[syslog-logrotate] = "${sysconfdir}/logrotate.rsyslog" + +CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" + +RPROVIDES_${PN} += "${PN}-systemd" +RREPLACES_${PN} += "${PN}-systemd" +RCONFLICTS_${PN} += "${PN}-systemd" +SYSTEMD_SERVICE_${PN} = "${BPN}.service" + +RDEPENDS_${PN} += "logrotate" + +# for rsyslog-ptest +VALGRIND = "valgrind" +VALGRIND_mips = "" +VALGRIND_mips64 = "" +VALGRIND_mips64n32 = "" +VALGRIND_arm = "" +VALGRIND_aarch64 = "" +RDEPENDS_${PN}-ptest += "make diffutils gzip" +RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" + +# no syslog-init for systemd +python () { + if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + pn = d.getVar('PN', True) + sysconfdir = d.getVar('sysconfdir', True) + d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init') + d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir)) + d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True))) + + if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d): + pn = d.getVar('PN', True) + d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service') + d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True))) + d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True))) +} -- cgit v1.2.3-54-g00ecf