diff options
Diffstat (limited to 'recipes/snort/snort_2.8.5.3.bb')
-rw-r--r-- | recipes/snort/snort_2.8.5.3.bb | 73 |
1 files changed, 70 insertions, 3 deletions
diff --git a/recipes/snort/snort_2.8.5.3.bb b/recipes/snort/snort_2.8.5.3.bb index 5a34ce4470..ac73b70056 100644 --- a/recipes/snort/snort_2.8.5.3.bb +++ b/recipes/snort/snort_2.8.5.3.bb @@ -1,13 +1,16 @@ DESCRIPTION = "snort - a free lightweight network intrusion detection system for UNIX and Windows." HOMEPAGE = "http://www.snort.org/" LICENSE = "GPL" -DEPENDS = "libpcap libnet libpcre" -RDEPENDS_${PN} = "libpcap libnet libpcre barnyard" +DEPENDS = "libpcap libpcre libprelude" -PR = "r2" +PR = "r3" SRC_URI = " ${GENTOO_MIRROR}/${P}.tar.gz;name=tarball \ file://snort.fix.configure.in.HACK;apply=yes \ + file://snort.init \ + file://default \ + file://logrotate \ + file://volatiles \ " SRC_URI[tarball.md5sum] = "ef02aaad54746603f2cb3236fe962128" SRC_URI[tarball.sha256sum] = "a7d9eb16427514d00926e9892c4a92b6ff1fd0f79555d8f8dce91dfa14112e6a" @@ -16,6 +19,15 @@ S = "${WORKDIR}/${P}" #snort does not like parallel make! PARALLEL_MAKE = "" +EXTRA_OECONF = " \ + --enable-decoder-preprocessor-rules \ + --enable-gre \ + --enable-linux-smp-stats \ + --enable-prelude \ + --enable-reload \ + --enable-reload-error-restart \ + --enable-targetbased \ + " inherit autotools pkgconfig @@ -24,3 +36,58 @@ do_install_prepend() { sed -i -e 's:-Wl,-rpath-link,${STAGING_LIBDIR}::g' -e 's:-isystem${STAGING_INCDIR}::g' snort.pc } +do_install_append() { + install -d ${D}/${sysconfdir}/snort/rules + install -d ${D}/${sysconfdir}/snort/preproc_rules + install -d ${D}/${sysconfdir}/default/volatiles + mkdir -p ${D}/${sysconfdir}/init.d + for i in map config conf dtd; do + cp ${S}/etc/*.$i ${D}/${sysconfdir}/snort/ + done + cp ${S}/preproc_rules/*.rules ${D}/${sysconfdir}/snort/preproc_rules/ + install -m 0644 ${WORKDIR}/default ${D}/${sysconfdir}/default/snort + install -m 0644 ${WORKDIR}/volatiles ${D}/${sysconfdir}/default/volatiles/snort + install -m 0755 ${WORKDIR}/snort.init ${D}/${sysconfdir}/init.d/snort + mkdir -p ${D}/${localstatedir}/log/snort + install -d ${D}${sysconfdir}/logrotate.d + install -m 0644 ${WORKDIR}/logrotate ${D}${sysconfdir}/logrotate.d/snort +} + +pkg_postinst_${PN}() { + grep -q ^snort: /etc/group || addgroup snort + grep -q ^snort: /etc/passwd || \ + adduser --disabled-password --home=/var/log/snort/ --system \ + --ingroup snort --no-create-home -g "snort" snort + ${sysconfdir}/init.d/populate-volatile.sh update +} + +PACKAGES =+ "${PN}-logrotate" +FILES_${PN}-logrotate = "${sysconfdir}/logrotate.d/snort" +FILES_${PN} += " \ + ${libdir}/snort_dynamicengine/*.so.* \ + ${libdir}/snort_dynamicpreprocessor/*.so.* \ + ${libdir}/snort_dynamicrules/*.so.* \ + " +FILES_${PN}-dbg += " \ + ${libdir}/snort_dynamicengine/.debug \ + ${libdir}/snort_dynamicpreprocessor/.debug \ + ${libdir}/snort_dynamicrules/.debug \ + " +FILES_${PN}-static += " \ + ${libdir}/snort_dynamicengine/*.a \ + ${libdir}/snort_dynamicpreprocessor/*.a \ + ${libdir}/snort_dynamicrules/*.a \ + " +FILES_${PN}-dev += " \ + ${libdir}/snort_dynamicengine/*.la \ + ${libdir}/snort_dynamicpreprocessor/*.la \ + ${libdir}/snort_dynamicrules/*.la \ + ${libdir}/snort_dynamicengine/*.so \ + ${libdir}/snort_dynamicpreprocessor/*.so \ + ${libdir}/snort_dynamicrules/*.so \ + ${prefix}/src/snort_dynamicsrc \ + " + +RRECOMMENDS_${PN} += "${PN}-logrotate" +RRECOMMENDS_${PN} += "barnyard" +RSUGGESTS_${PN}-logrotate += "logrotate" |