diff options
| author | zangrc <zangrc.fnst@cn.fujitsu.com> | 2020-11-27 10:05:26 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-11-27 11:54:04 -0800 |
| commit | 2bbb303b72912473a76f773ad35feb9974afb536 (patch) | |
| tree | 4c9006d135157cbf12a0cc3c636e54e793f94b93 /meta-networking/recipes-connectivity/snort/snort_2.9.17.bb | |
| parent | bb64362db7928ca07d8ee70b3e9d51d9b7662b4f (diff) | |
| download | meta-openembedded-2bbb303b72912473a76f773ad35feb9974afb536.tar.gz | |
snort: upgrade 2.9.16.1 -> 2.9.17
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-connectivity/snort/snort_2.9.17.bb')
| -rw-r--r-- | meta-networking/recipes-connectivity/snort/snort_2.9.17.bb | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/snort/snort_2.9.17.bb b/meta-networking/recipes-connectivity/snort/snort_2.9.17.bb new file mode 100644 index 0000000000..324114f63d --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort_2.9.17.bb | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | DESCRIPTION = "snort - a free lightweight network intrusion detection system for UNIX and Windows." | ||
| 2 | HOMEPAGE = "http://www.snort.org/" | ||
| 3 | SECTION = "net" | ||
| 4 | LICENSE = "GPL-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5" | ||
| 6 | |||
| 7 | DEPENDS = "xz libpcap libpcre daq libdnet util-linux daq-native libtirpc bison-native" | ||
| 8 | |||
| 9 | SRC_URI = "https://www.snort.org/downloads/archive/snort/${BP}.tar.gz \ | ||
| 10 | file://snort.init \ | ||
| 11 | file://volatiles.99_snort \ | ||
| 12 | file://0001-libpcap-search-sysroot-for-headers.patch \ | ||
| 13 | file://fix-host-contamination-when-enable-static-daq.patch \ | ||
| 14 | file://disable-run-test-program-while-cross-compiling.patch \ | ||
| 15 | file://configure.in-disable-tirpc-checking-for-fedora.patch \ | ||
| 16 | " | ||
| 17 | SRC_URI[sha256sum] = "c3b234c3922a09b0368b847ddb8d1fa371b741f032f42aa9ab53d67b428dc648" | ||
| 18 | |||
| 19 | UPSTREAM_CHECK_URI = "https://www.snort.org/downloads" | ||
| 20 | UPSTREAM_CHECK_REGEX = "snort-(?P<pver>\d+(\.\d+)+)\.tar" | ||
| 21 | |||
| 22 | inherit autotools gettext update-rc.d pkgconfig | ||
| 23 | |||
| 24 | INITSCRIPT_NAME = "snort" | ||
| 25 | INITSCRIPT_PARAMS = "defaults" | ||
| 26 | |||
| 27 | EXTRA_OECONF = " \ | ||
| 28 | --enable-gre \ | ||
| 29 | --enable-linux-smp-stats \ | ||
| 30 | --enable-reload \ | ||
| 31 | --enable-reload-error-restart \ | ||
| 32 | --enable-targetbased \ | ||
| 33 | --enable-static-daq \ | ||
| 34 | --with-dnet-includes=${STAGING_INCDIR} \ | ||
| 35 | --with-dnet-libraries=${STAGING_LIBDIR} \ | ||
| 36 | --with-libpcre-includes=${STAGING_INCDIR} \ | ||
| 37 | --with-libpcre-libraries=${STAGING_LIBDIR} \ | ||
| 38 | --with-daq-includes=${STAGING_INCDIR} \ | ||
| 39 | --with-daq-libraries=${STAGING_LIBDIR} \ | ||
| 40 | " | ||
| 41 | |||
| 42 | # if you want to disable it, you need to patch configure.in first | ||
| 43 | # AC_CHECK_HEADERS([openssl/sha.h],, SHA_H="no") | ||
| 44 | # is called even with --without-openssl-includes | ||
| 45 | PACKAGECONFIG ?= "openssl lzma" | ||
| 46 | PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl," | ||
| 47 | PACKAGECONFIG[lzma] = "--with-lzma-includes=${STAGING_INCDIR} --with-lzma-libraries=${STAGING_LIBDIR}, --without-lzma-includes --without-lzma-libraries, xz," | ||
| 48 | PACKAGECONFIG[appid] = "--enable-open-appid, --disable-open-appid, luajit, bash" | ||
| 49 | |||
| 50 | CFLAGS += "-I${STAGING_INCDIR}/tirpc" | ||
| 51 | LDFLAGS += " -ltirpc" | ||
| 52 | |||
| 53 | do_install_append() { | ||
| 54 | install -d ${D}${sysconfdir}/snort/rules | ||
| 55 | install -d ${D}${sysconfdir}/snort/preproc_rules | ||
| 56 | install -d ${D}${sysconfdir}/init.d | ||
| 57 | for i in map config conf dtd; do | ||
| 58 | cp ${S}/etc/*.$i ${D}${sysconfdir}/snort/ | ||
| 59 | done | ||
| 60 | |||
| 61 | # fix the hardcoded path and lib name | ||
| 62 | # comment out the rules that are not provided | ||
| 63 | sed -i -e 's#/usr/local/lib#${libdir}#' \ | ||
| 64 | -e 's#\.\./\(.*rules\)#${sysconfdir}/snort/\1#' \ | ||
| 65 | -e 's#\(libsf_engine.so\)#\1.0#' \ | ||
| 66 | -e 's/^\(include $RULE_PATH\)/#\1/' \ | ||
| 67 | -e 's/^\(dynamicdetection\)/#\1/' \ | ||
| 68 | -e '/preprocessor reputation/,/blacklist/ s/^/#/' \ | ||
| 69 | ${D}${sysconfdir}/snort/snort.conf | ||
| 70 | |||
| 71 | cp ${S}/preproc_rules/*.rules ${D}${sysconfdir}/snort/preproc_rules/ | ||
| 72 | install -m 755 ${WORKDIR}/snort.init ${D}${sysconfdir}/init.d/snort | ||
| 73 | |||
| 74 | install -d ${D}${sysconfdir}/default/volatiles | ||
| 75 | install -m 0644 ${WORKDIR}/volatiles.99_snort ${D}${sysconfdir}/default/volatiles/99_snort | ||
| 76 | |||
| 77 | sed -i -e 's|-fdebug-prefix-map[^ ]*||g; s|-fmacro-prefix-map[^ ]*||g; s|${STAGING_DIR_TARGET}||g' ${D}${libdir}/pkgconfig/*.pc | ||
| 78 | } | ||
| 79 | |||
| 80 | pkg_postinst_${PN}() { | ||
| 81 | if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
| 82 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
| 83 | fi | ||
| 84 | } | ||
| 85 | |||
| 86 | FILES_${PN} += " \ | ||
| 87 | ${libdir}/snort_dynamicengine/*.so.* \ | ||
| 88 | ${libdir}/snort_dynamicpreprocessor/*.so.* \ | ||
| 89 | ${libdir}/snort_dynamicrules/*.so.* \ | ||
| 90 | " | ||
| 91 | FILES_${PN}-dbg += " \ | ||
| 92 | ${libdir}/snort_dynamicengine/.debug \ | ||
| 93 | ${libdir}/snort_dynamicpreprocessor/.debug \ | ||
| 94 | ${libdir}/snort_dynamicrules/.debug \ | ||
| 95 | " | ||
| 96 | FILES_${PN}-staticdev += " \ | ||
| 97 | ${libdir}/snort_dynamicengine/*.a \ | ||
| 98 | ${libdir}/snort_dynamicpreprocessor/*.a \ | ||
| 99 | ${libdir}/snort_dynamicrules/*.a \ | ||
| 100 | ${libdir}/snort/dynamic_preproc/*.a \ | ||
| 101 | ${libdir}/snort/dynamic_output/*.a \ | ||
| 102 | " | ||
| 103 | FILES_${PN}-dev += " \ | ||
| 104 | ${libdir}/snort_dynamicengine/*.la \ | ||
| 105 | ${libdir}/snort_dynamicpreprocessor/*.la \ | ||
| 106 | ${libdir}/snort_dynamicrules/*.la \ | ||
| 107 | ${libdir}/snort_dynamicengine/*.so \ | ||
| 108 | ${libdir}/snort_dynamicpreprocessor/*.so \ | ||
| 109 | ${libdir}/snort_dynamicrules/*.so \ | ||
| 110 | ${prefix}/src/snort_dynamicsrc \ | ||
| 111 | " | ||
