diff options
Diffstat (limited to 'meta-networking/recipes-connectivity/snort/snort_2.9.14.bb')
-rw-r--r-- | meta-networking/recipes-connectivity/snort/snort_2.9.14.bb | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/snort/snort_2.9.14.bb b/meta-networking/recipes-connectivity/snort/snort_2.9.14.bb new file mode 100644 index 000000000..b11890c49 --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort_2.9.14.bb | |||
@@ -0,0 +1,105 @@ | |||
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://0001-libpcap-search-sysroot-for-headers.patch \ | ||
12 | file://fix-host-contamination-when-enable-static-daq.patch \ | ||
13 | file://disable-run-test-program-while-cross-compiling.patch \ | ||
14 | file://configure.in-disable-tirpc-checking-for-fedora.patch \ | ||
15 | " | ||
16 | |||
17 | SRC_URI[md5sum] = "d1689c7ccaaa7bfcfa83b5bff6b8f9b8" | ||
18 | SRC_URI[sha256sum] = "c0306db9ce64f45cc7c64c9afc70abe9689daa860020345ec3ba099928b7464b" | ||
19 | |||
20 | UPSTREAM_CHECK_URI = "https://www.snort.org/downloads" | ||
21 | UPSTREAM_CHECK_REGEX = "snort-(?P<pver>\d+(\.\d+)+)\.tar" | ||
22 | |||
23 | inherit autotools gettext update-rc.d pkgconfig | ||
24 | |||
25 | INITSCRIPT_NAME = "snort" | ||
26 | INITSCRIPT_PARAMS = "defaults" | ||
27 | |||
28 | EXTRA_OECONF = " \ | ||
29 | --enable-gre \ | ||
30 | --enable-linux-smp-stats \ | ||
31 | --enable-reload \ | ||
32 | --enable-reload-error-restart \ | ||
33 | --enable-targetbased \ | ||
34 | --enable-static-daq \ | ||
35 | --with-dnet-includes=${STAGING_INCDIR} \ | ||
36 | --with-dnet-libraries=${STAGING_LIBDIR} \ | ||
37 | --with-libpcre-includes=${STAGING_INCDIR} \ | ||
38 | --with-libpcre-libraries=${STAGING_LIBDIR} \ | ||
39 | --with-daq-includes=${STAGING_INCDIR} \ | ||
40 | --with-daq-libraries=${STAGING_LIBDIR} \ | ||
41 | " | ||
42 | |||
43 | # if you want to disable it, you need to patch configure.in first | ||
44 | # AC_CHECK_HEADERS([openssl/sha.h],, SHA_H="no") | ||
45 | # is called even with --without-openssl-includes | ||
46 | PACKAGECONFIG ?= "openssl lzma" | ||
47 | PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl," | ||
48 | PACKAGECONFIG[lzma] = "--with-lzma-includes=${STAGING_INCDIR} --with-lzma-libraries=${STAGING_LIBDIR}, --without-lzma-includes --without-lzma-libraries, xz," | ||
49 | PACKAGECONFIG[appid] = "--enable-open-appid, --disable-open-appid, luajit, bash" | ||
50 | |||
51 | CFLAGS += "-I${STAGING_INCDIR}/tirpc" | ||
52 | LDFLAGS += " -ltirpc" | ||
53 | |||
54 | do_install_append() { | ||
55 | install -d ${D}${sysconfdir}/snort/rules | ||
56 | install -d ${D}${sysconfdir}/snort/preproc_rules | ||
57 | install -d ${D}${sysconfdir}/init.d | ||
58 | for i in map config conf dtd; do | ||
59 | cp ${S}/etc/*.$i ${D}${sysconfdir}/snort/ | ||
60 | done | ||
61 | |||
62 | # fix the hardcoded path and lib name | ||
63 | # comment out the rules that are not provided | ||
64 | sed -i -e 's#/usr/local/lib#${libdir}#' \ | ||
65 | -e 's#\.\./\(.*rules\)#${sysconfdir}/snort/\1#' \ | ||
66 | -e 's#\(libsf_engine.so\)#\1.0#' \ | ||
67 | -e 's/^\(include $RULE_PATH\)/#\1/' \ | ||
68 | -e 's/^\(dynamicdetection\)/#\1/' \ | ||
69 | -e '/preprocessor reputation/,/blacklist/ s/^/#/' \ | ||
70 | ${D}${sysconfdir}/snort/snort.conf | ||
71 | |||
72 | cp ${S}/preproc_rules/*.rules ${D}${sysconfdir}/snort/preproc_rules/ | ||
73 | install -m 755 ${WORKDIR}/snort.init ${D}${sysconfdir}/init.d/snort | ||
74 | mkdir -p ${D}${localstatedir}/log/snort | ||
75 | install -d ${D}/var/log/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 | FILES_${PN} += " \ | ||
81 | ${libdir}/snort_dynamicengine/*.so.* \ | ||
82 | ${libdir}/snort_dynamicpreprocessor/*.so.* \ | ||
83 | ${libdir}/snort_dynamicrules/*.so.* \ | ||
84 | " | ||
85 | FILES_${PN}-dbg += " \ | ||
86 | ${libdir}/snort_dynamicengine/.debug \ | ||
87 | ${libdir}/snort_dynamicpreprocessor/.debug \ | ||
88 | ${libdir}/snort_dynamicrules/.debug \ | ||
89 | " | ||
90 | FILES_${PN}-staticdev += " \ | ||
91 | ${libdir}/snort_dynamicengine/*.a \ | ||
92 | ${libdir}/snort_dynamicpreprocessor/*.a \ | ||
93 | ${libdir}/snort_dynamicrules/*.a \ | ||
94 | ${libdir}/snort/dynamic_preproc/*.a \ | ||
95 | ${libdir}/snort/dynamic_output/*.a \ | ||
96 | " | ||
97 | FILES_${PN}-dev += " \ | ||
98 | ${libdir}/snort_dynamicengine/*.la \ | ||
99 | ${libdir}/snort_dynamicpreprocessor/*.la \ | ||
100 | ${libdir}/snort_dynamicrules/*.la \ | ||
101 | ${libdir}/snort_dynamicengine/*.so \ | ||
102 | ${libdir}/snort_dynamicpreprocessor/*.so \ | ||
103 | ${libdir}/snort_dynamicrules/*.so \ | ||
104 | ${prefix}/src/snort_dynamicsrc \ | ||
105 | " | ||