diff options
Diffstat (limited to 'external/meta-openembedded/meta-networking/recipes-connectivity/snort')
-rw-r--r-- | external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/configure.in-disable-tirpc-checking-for-fedora.patch | 60 | ||||
-rw-r--r-- | external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-run-test-program-while-cross-compiling.patch | 4 | ||||
-rw-r--r-- | external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init | 53 | ||||
-rw-r--r-- | external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/volatiles.99_snort | 2 | ||||
-rw-r--r-- | external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.16.bb (renamed from external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.11.1.bb) | 20 |
5 files changed, 106 insertions, 33 deletions
diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/configure.in-disable-tirpc-checking-for-fedora.patch b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/configure.in-disable-tirpc-checking-for-fedora.patch new file mode 100644 index 00000000..87fd05bf --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/configure.in-disable-tirpc-checking-for-fedora.patch @@ -0,0 +1,60 @@ +From 65463a7c5cb2514b1523a81911810effffb75a79 Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Fri, 28 Jun 2019 15:05:31 +0800 +Subject: [PATCH] configure.in: disable tirpc checking for fedora + +The Fedora 28+ does not have inbuilt SunRPC support in glibc and is +separately availble in tirpc package. So it enables tirpc checking for +fedora in configure. + +Drop this piece of code since we had specify '-ltirpc' in LDFLAGS +explicitly. Otherwise it will cause a compile-host-path QA issue if the +host is Fedora 28+: +cc1: warning: include location "/usr/include/tirpc" is unsafe for +cross-compilation [-Wpoison-system-directories] + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + configure.in | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/configure.in b/configure.in +index 8662cdd..0ff7e27 100644 +--- a/configure.in ++++ b/configure.in +@@ -895,30 +895,6 @@ if test "x$enable_dlclose" = "xno"; then + AC_DEFINE([DISABLE_DLCLOSE_FOR_VALGRIND_TESTING],[1],[Don't close opened shared objects for valgrind leak testing of dynamic libraries]) + fi + +-################################################## +-# Fedora 28+ does not have inbuilt SunRPC support# +-# in glibc and is separately availble in tirpc # +-# package. Make sure we've got the library and # +-# link it # +-################################################## +- +-if test -f /etc/fedora-release ; then +- DISTRO_VERSION=$(awk '{ print $3 }' /etc/fedora-release) +- if test $DISTRO_VERSION -ge 28 ; then +- TIRPC="" +- AC_CHECK_LIB(tirpc,bindresvport,, TIRPC="no") +- echo "$TIRPC" +- if test "x$TIRPC" = "xno"; then +- echo +- echo " ERROR! tirpc not found, get it by running " +- echo " yum install libtirpc-devel " +- exit +- fi +- LIBS="${LIBS} -ltirpc" +- extra_incl="-I/usr/include/tirpc" +- fi +-fi +- + Z_LIB="" + AC_CHECK_HEADERS(zlib.h,, Z_LIB="no") + if test "x$Z_LIB" = "xno"; then +-- +2.7.4 + diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-run-test-program-while-cross-compiling.patch b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-run-test-program-while-cross-compiling.patch index 037962fb..30ec1743 100644 --- a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-run-test-program-while-cross-compiling.patch +++ b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-run-test-program-while-cross-compiling.patch @@ -226,7 +226,7 @@ index 4b3a5db..a6c5498 100644 -]])], -[have_daq_packet_trace="yes"], -[have_daq_packet_trace="no"]) -+have_daq_packet_trace="yes" ++have_daq_packet_trace="no" AC_MSG_RESULT($have_daq_packet_trace) if test "x$have_daq_packet_trace" = "xyes"; then AC_DEFINE([HAVE_DAQ_PKT_TRACE],[1], @@ -245,7 +245,7 @@ index 4b3a5db..a6c5498 100644 -]])], -[have_daq_verdict_reason="yes"], -[have_daq_verdict_reason="no"]) -+have_daq_verdict_reason="yes" ++have_daq_verdict_reason="no" AC_MSG_RESULT($have_daq_verdict_reason) if test "x$have_daq_verdict_reason" = "xyes"; then AC_DEFINE([HAVE_DAQ_VERDICT_REASON],[1], diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init index d8a00c43..0d90c9af 100644 --- a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init +++ b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init @@ -1,6 +1,6 @@ #!/bin/sh # -# Snort Startup Script modified for OpenEmbedded +# Snort Startup Script modified for OpenEmbedded # # Script variables @@ -30,16 +30,16 @@ fi start() { - [ -n "$LAN_INTERFACE" ] || return 0 # Check if log diratory is present. Otherwise, create it. if [ ! -d $LOGDIR/$DATE ]; then - mkdir -d $LOGDIR/$DATE + mkdir -p $LOGDIR/$DATE /bin/chown -R $USER:$USER $LOGDIR/$DATE - /bin/chmod -R 700 $LOGDIR/$DATE + /bin/chmod -R 700 $LOGDIR/$DATE fi /bin/echo "Starting $PROG: " + # Snort parameters # -D Run Snort in background (daemon) mode # -i <if> Listen on interface <if> @@ -64,7 +64,7 @@ stop() RETURN_VAL=$? /bin/echo "$PROG shutdown complete." [ -e $DEL_PID ] && rm -f $DEL_PID - [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck + [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck else /bin/echo "ERROR: PID in $PID file not found." RETURN_VAL=1 @@ -72,12 +72,13 @@ stop() return $RETURN_VAL } -status() { - if [ -s $PID ]; then - echo "$PROG is running as pid `cat $PID`:" - else - echo "$PROG is not running." - fi +status() +{ + if [ -s $PID ]; then + echo "$PROG is running as pid `cat $PID`:" + else + echo "$PROG is not running." + fi } restart() @@ -89,21 +90,21 @@ restart() } case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart|reload) - restart - ;; - *) - /bin/echo "Usage: $0 {start|stop|status|restart|reload}" - RETURN_VAL=1 + start) + start + ;; + stop) + stop + ;; + status) + status + ;; + restart|reload) + restart + ;; + *) + /bin/echo "Usage: $0 {start|stop|status|restart|reload}" + RETURN_VAL=1 esac exit $RETURN_VAL diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/volatiles.99_snort b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/volatiles.99_snort new file mode 100644 index 00000000..acf5f61a --- /dev/null +++ b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/volatiles.99_snort @@ -0,0 +1,2 @@ +# <type> <owner> <group> <mode> <path> <linksource> +d root root 0755 /var/log/snort none diff --git a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.11.1.bb b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.16.bb index a99138d3..d8073d86 100644 --- a/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.11.1.bb +++ b/external/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.16.bb @@ -8,13 +8,15 @@ DEPENDS = "xz libpcap libpcre daq libdnet util-linux daq-native libtirpc bison-n SRC_URI = "https://www.snort.org/downloads/archive/snort/${BP}.tar.gz \ file://snort.init \ + file://volatiles.99_snort \ file://0001-libpcap-search-sysroot-for-headers.patch \ file://fix-host-contamination-when-enable-static-daq.patch \ file://disable-run-test-program-while-cross-compiling.patch \ + file://configure.in-disable-tirpc-checking-for-fedora.patch \ " -SRC_URI[md5sum] = "378e3938b2b5c8e358f942d0ffce18cc" -SRC_URI[sha256sum] = "9f6b3aeac5a109f55504bd370564ac431cb1773507929dc461626898f33f46cd" +SRC_URI[md5sum] = "1cec58babaea3420014d61a93e6e1545" +SRC_URI[sha256sum] = "9688d8edf1da09dec6574000fb3c0e62f99c56428587616e17c60103c0bcbad7" UPSTREAM_CHECK_URI = "https://www.snort.org/downloads" UPSTREAM_CHECK_REGEX = "snort-(?P<pver>\d+(\.\d+)+)\.tar" @@ -45,6 +47,7 @@ EXTRA_OECONF = " \ PACKAGECONFIG ?= "openssl lzma" PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl," PACKAGECONFIG[lzma] = "--with-lzma-includes=${STAGING_INCDIR} --with-lzma-libraries=${STAGING_LIBDIR}, --without-lzma-includes --without-lzma-libraries, xz," +PACKAGECONFIG[appid] = "--enable-open-appid, --disable-open-appid, luajit, bash" CFLAGS += "-I${STAGING_INCDIR}/tirpc" LDFLAGS += " -ltirpc" @@ -69,10 +72,17 @@ do_install_append() { cp ${S}/preproc_rules/*.rules ${D}${sysconfdir}/snort/preproc_rules/ install -m 755 ${WORKDIR}/snort.init ${D}${sysconfdir}/init.d/snort - mkdir -p ${D}${localstatedir}/log/snort - install -d ${D}/var/log/snort - sed -i 's/-fdebug-prefix-map[^ ]*//g; s#${STAGING_DIR_TARGET}##g' ${D}${libdir}/pkgconfig/*.pc + install -d ${D}${sysconfdir}/default/volatiles + install -m 0644 ${WORKDIR}/volatiles.99_snort ${D}${sysconfdir}/default/volatiles/99_snort + + sed -i -e 's|-fdebug-prefix-map[^ ]*||g; s|-fmacro-prefix-map[^ ]*||g; s|${STAGING_DIR_TARGET}||g' ${D}${libdir}/pkgconfig/*.pc +} + +pkg_postinst_${PN}() { + if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then + ${sysconfdir}/init.d/populate-volatile.sh update + fi } FILES_${PN} += " \ |