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 libfastjson bison-native flex-native liblogging curl" 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://fix-race-in-parallel-builds.patch \ " SRC_URI_append_libc-musl = " \ file://0001-Include-sys-time-h.patch \ " SRC_URI[md5sum] = "6846bb6d37af3ce067988dd2460d3a5d" SRC_URI[sha256sum] = "8a4b5beb92c6b308c3d14de2364c2788f62ef5d37ca0448144619edfe508ee70" UPSTREAM_CHECK_URI = "https://github.com/rsyslog/rsyslog/releases" UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)" inherit autotools pkgconfig systemd update-rc.d ptest EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes" # first line is default yes in configure PACKAGECONFIG ??= " \ rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \ imdiag gnutls imfile \ ${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \ " # default yes in configure PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp," 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 --enable-omstdout,--disable-testbench --disable-omstdout,," # 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[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} # 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" -o -name "*.sh" -o -name "*.c" | xargs \ sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g' } do_install_append() { install -d "${D}${sysconfdir}/init.d" install -d "${D}${sysconfdir}/logrotate.d" install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog } FILES_<#!/bin/bash # SCP Test Case for Sanity Test # The case boot up the Qemu target with `runqemu qemuxxx`. # Then check if file can be copied into target with scp command. # # Author: Jiajun Xu <jiajun.xu@intel.com> # # This file is licensed under the GNU General Public License, # Version 2. # . $POKYBASE/scripts/qemuimage-testlib TIMEOUT=400 RET=1 SPID=0 i=0 # Start qemu and check its network Test_Create_Qemu ${TIMEOUT} # If qemu network is up, check ssh service in qemu if [ $? -eq 0 ]; then Test_Info "Begin to Test SSH Service in Qemu" Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} RET=$? else RET=1 fi # Check if file can be copied from host into target # For qemu target, the file is 5M if [ $RET -eq 0 ]; then echo $QEMUARCH | grep -q "qemu" if [ $? -eq 0 ]; then dd if=/dev/zero of=${TEST_TMP}/scp_test_file bs=512k count=10 Test_SCP ${TARGET_IPADDR} ${TEST_TMP}/scp_test_file /home/root & SPID=$! fi # Check if scp finished or not while [ $i -lt $TIMEOUT ] do ps -fp $SPID > /dev/null if [ $? -ne 0 ]; then RET=0 break fi i=$((i+5)) sleep 5 done # Kill scp process if scp is not finished in time if [ $i -ge $TIMEOUT ]; then RET=1 kill $SPID fi fi if [ ${RET} -eq 0 ]; then Test_Info "SCP Test PASS" Test_Kill_Qemu Test_Print_Result "SCP" 0 exit 0 else Test_Info "SCP Test FAIL" Test_Kill_Qemu Test_Print_Result "SCP" 1 exit 1 fi
#!/bin/bash # SCP Test Case for Sanity Test # The case boot up the Qemu target with `runqemu qemuxxx`. # Then check if file can be copied into target with scp command. # # Author: Jiajun Xu <jiajun.xu@intel.com> # # This file is licensed under the GNU General Public License, # Version 2. # . $POKYBASE/scripts/qemuimage-testlib TIMEOUT=400 RET=1 SPID=0 i=0 # Start qemu and check its network Test_Create_Qemu ${TIMEOUT} # If qemu network is up, check ssh service in qemu if [ $? -eq 0 ]; then Test_Info "Begin to Test SSH Service in Qemu" Test_SSH_UP ${TARGET_IPADDR} ${TIMEOUT} RET=$? else RET=1 fi # Check if file can be copied from host into target # For qemu target, the file is 5M if [ $RET -eq 0 ]; then echo $QEMUARCH | grep -q "qemu" if [ $? -eq 0 ]; then dd if=/dev/zero of=${TEST_TMP}/scp_test_file bs=512k count=10 Test_SCP ${TARGET_IPADDR} ${TEST_TMP}/scp_test_file /home/root & SPID=$! fi # Check if scp finished or not while [ $i -lt $TIMEOUT ] do ps -fp $SPID > /dev/null if [ $? -ne 0 ]; then RET=0 break fi i=$((i+5)) sleep 5 done # Kill scp process if scp is not finished in time if [ $i -ge $TIMEOUT ]; then RET=1 kill $SPID fi fi if [ ${RET} -eq 0 ]; then Test_Info "SCP Test PASS" Test_Kill_Qemu Test_Print_Result "SCP" 0 exit 0 else Test_Info "SCP Test FAIL" Test_Kill_Qemu Test_Print_Result "SCP" 1 exit 1 fi