Readding last 2.8.5 release by popular request
authorPatrick Lauer <patrick@gentoo.org>
Sun, 11 Jul 2010 12:09:42 +0000 (12:09 +0000)
committerPatrick Lauer <patrick@gentoo.org>
Sun, 11 Jul 2010 12:09:42 +0000 (12:09 +0000)
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64

net-analyzer/snort/ChangeLog
net-analyzer/snort/Manifest
net-analyzer/snort/snort-2.8.5.3.ebuild [new file with mode: 0644]

index 783f01c0c1bf2a66e69136e6dd66dd267dbd09ef..2bfd390bd763b4183e3bbf1962cb4554d8153adf 100644 (file)
@@ -1,6 +1,9 @@
 # ChangeLog for net-analyzer/snort
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/ChangeLog,v 1.164 2010/06/18 07:20:43 patrick Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/ChangeLog,v 1.165 2010/07/11 12:09:42 patrick Exp $
+
+  11 Jul 2010; Patrick Lauer <patrick@gentoo.org> +snort-2.8.5.3.ebuild:
+  Readding last 2.8.5 release by popular request
 
   18 Jun 2010; Patrick Lauer <patrick@gentoo.org> -snort-2.8.4.1.ebuild,
   -snort-2.8.5.2.ebuild, -snort-2.8.5.3.ebuild:
index 920fda4e4dee8942e50f1edaeec70ecb9aec80e6..63bb3baddca616bbc197448c5509db873fa022a7 100644 (file)
@@ -4,8 +4,10 @@ AUX snort.confd 442 RMD160 439e885d43aacc474c41eeed5217a498b2917aac SHA1 87a3de6
 AUX snort.rc9 849 RMD160 d031761fff4cf8f7bc28a465d3b5ecc740579e21 SHA1 8c16b1f7f064ebf962ad469b55e5a6738939b8e4 SHA256 585c6e96fc2265861436347ddf52d44c1c049fe7083825e16253f7717c968ec4
 AUX snort.reload.rc1 1190 RMD160 cbe18ddc93f3091f0faef317d96211b8d7d3798d SHA1 f7b4aff2b7b25b1c8d5886e1fab63856e1ccfe06 SHA256 c6af6ff89034872a7192af360a24de811aeba7fb06704ebe758eea9dcde933e9
 DIST snort-2.8.5.1.tar.gz 4715078 RMD160 fbfab45f1d7d815516043592eab8cf1cc6ec93d0 SHA1 b971052cdd4b3527a0603854953103fe9ad8a45b SHA256 ade1b0f4ae74fd623c633d28b6f1429187751b35b36a3f8a0c197d2104b5e5ae
+DIST snort-2.8.5.3.tar.gz 4730637 RMD160 57e897b90cb177c2ef2c0cb2ad3b7494c92c6d99 SHA1 e376f546977c695b21b9a5253e5d7c69cd53c63c SHA256 a7d9eb16427514d00926e9892c4a92b6ff1fd0f79555d8f8dce91dfa14112e6a
 DIST snort-2.8.6.tar.gz 4960740 RMD160 5b549eab39a6e0a0f182f6d2ee46fd60995c822e SHA1 e463c99994e52171439623e1b05b9e1bcf01ac8f SHA256 6064d7bb78d6438b455ff349b93d52f40d3977f1fecb1d7958c87881b0030358
 EBUILD snort-2.8.5.1.ebuild 10250 RMD160 9b608cdf3c04ac3099fa9f4825a567e9fcd1f22e SHA1 8da5d7002564121c2a786d98c204022e97ad3ea2 SHA256 fa24db38ba95feb58c67a5a3befc278f0ac19f4beaaa0a0be34bb3289a0500a5
+EBUILD snort-2.8.5.3.ebuild 10252 RMD160 2e2441d222c10a27d273ca38961529035acb48a3 SHA1 27b27bf104c9d42813be1df397653b2e109cedda SHA256 67ff9ad9aa392748361d0ab6da671a5a48e09538024cf1ef01f5d1fcb21de6a7
 EBUILD snort-2.8.6.ebuild 10122 RMD160 25180169094ad9c235ce50505ae4e4acffd7a3ff SHA1 087f8fdc2b3bbe08bedd7d0ac772f136d47a390b SHA256 c09ee98069384be4ee20b1743be83d091d2ca31342acaa47aab690d53d285f34
-MISC ChangeLog 28857 RMD160 93cd960284b5a230badedd876c9e38295a021b29 SHA1 767259da90eeb4ca388dd34f839aa955a9c085ae SHA256 1b9d16236d9b5868130cb4686eadbfc7ed71f34d01186bdf3dafb4fa27bcd219
+MISC ChangeLog 28980 RMD160 30c8b4c1f7d239512e0e28f5419c7b3aa78e3ab4 SHA1 1f6bcf0bd41ef98db2ace54a59741a5505293ae8 SHA256 698f2890cfb6672062c108391268d0c7d58bbc5bab51069b41ace15cdc20e773
 MISC metadata.xml 1839 RMD160 b7331fb2b64fe348c875d9a8239a23cf8ab22eba SHA1 cd684fc20f56c2f5305c489be18010633eaac1b0 SHA256 e9f59e49d6cec549879ccab88c50403bb0882a016d3cc2772c58b566b0b3b13b
diff --git a/net-analyzer/snort/snort-2.8.5.3.ebuild b/net-analyzer/snort/snort-2.8.5.3.ebuild
new file mode 100644 (file)
index 0000000..94fc6e0
--- /dev/null
@@ -0,0 +1,316 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/snort-2.8.5.3.ebuild,v 1.4 2010/07/11 12:09:42 patrick Exp $
+
+inherit eutils autotools multilib
+
+DESCRIPTION="The de facto standard for intrusion detection/prevention"
+HOMEPAGE="http://www.snort.org/"
+#SRC_URI="http://dl.snort.org/snort-current/${P}.tar.gz"
+SRC_URI="http://download.openpkg.org/components/cache/snort/snort-2.8.5.3.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="static dynamicplugin ipv6 gre mpls targetbased decoder-preprocessor-rules ppm timestats perfprofiling linux-smp-stats inline inline-init-failopen prelude threads debug reload reload-error-restart flexresp flexresp2 react aruba mysql odbc postgres selinux"
+
+#flexresp, react, and inline _ONLY_ work with net-libs/libnet-1.0.2a
+DEPEND="virtual/libpcap
+       >=dev-libs/libpcre-6.0
+       flexresp2? ( dev-libs/libdnet )
+       flexresp? ( ~net-libs/libnet-1.0.2a )
+       react? ( ~net-libs/libnet-1.0.2a )
+       postgres? ( dev-db/postgresql-base )
+       mysql? ( virtual/mysql )
+       odbc? ( dev-db/unixODBC )
+       prelude? ( >=dev-libs/libprelude-0.9.0 )
+       inline? ( ~net-libs/libnet-1.0.2a net-firewall/iptables )"
+
+RDEPEND="${DEPEND}
+       dev-lang/perl
+       selinux? ( sec-policy/selinux-snort )"
+
+pkg_setup() {
+
+       if use flexresp && use flexresp2; then
+               eerror
+               eerror "You have both the 'flexresp' and 'flexresp2' USE flags set."
+               eerror "You can use 'flexresp' OR 'flexresp2' but not both."
+               eerror "flexresp2 is recommended."
+               die
+       elif use flexresp && use react; then
+               eerror
+               eerror "You have both the 'react' and 'flexresp' USE flags set."
+               eerror "'react' is enabled automaticly when the 'flexresp'"
+               eerror "USE flag is set, but ./configure will fail if both are enabled."
+               eerror
+               eerror "This is an upstream issue and not a problem with this ebuild."
+               eerror
+               eerror "To enable both 'flexresp' and 'react' set USE="flexresp -react""
+               die
+       elif use flexresp2 && use react; then
+               eerror
+               eerror "You have both the 'react' and 'flexresp2' USE flags set."
+               eerror "You can use 'react' OR 'flexresp2' but not both."
+               die
+       elif use inline-init-failopen && ! use inline; then
+               eerror
+               eerror "You have enabled the 'inline-init-failopen' USE flag"
+               eerror "but not the 'inline' USE flag."
+               eerror "'inline-init-failopen' requires 'inline' be enabled."
+               die
+       elif use reload-error-restart && ! use reload; then
+               eerror
+               eerror "You have enabled the 'reload-error-restart' USE flag"
+               eerror "but not the 'reload' USE flag."
+               eerror "'reload-error-restart' requires 'reload' be enabled."
+               die
+       fi
+
+       # pre_inst() is a better place to put this
+       # but we need it here for the 'fowners' statements in src_install()
+       enewgroup snort
+       enewuser snort -1 -1 /dev/null snort
+
+}
+
+src_unpack() {
+
+       unpack ${A}
+       cd "${S}"
+
+       # Fix to prevent the docs Makefile from being used.
+       # Fixes #297190.
+       einfo "Applying documentation fix."
+       sed -i -e 's:src doc etc:src etc:g' \
+               "${WORKDIR}/${P}/Makefile.am" || die "Doc fix Failed"
+
+       # Fix to allow parallel building.
+       # Thanks to Natanael Copa #291558
+       einfo "Applying parallel building fix."
+       sed -i -e 's/^all-local:.*/all-local: $(LTLIBRARIES)/' \
+                       src/dynamic-preprocessors/*/Makefile.am \
+                                       || die "parallel builds fix Failed"
+
+       #Replaces the libnet-1.0 patch for inline, flexresp, and react
+       if use flexresp || use react || use inline; then
+
+               einfo "Applying libnet-1.0 fix."
+               sed -i -e 's:libnet.h:libnet-1.0.h:g' \
+                       "${WORKDIR}/${P}/configure.in" \
+                       "${WORKDIR}/${P}/src/detection-plugins/sp_react.c" \
+                       "${WORKDIR}/${P}/src/detection-plugins/sp_respond.c" \
+                       "${WORKDIR}/${P}/src/inline.c" || die "sed for libnet-1.0.h failed"
+
+               sed -i -e 's:libnet-config:libnet-1.0-config:g' \
+                       "${WORKDIR}/${P}/configure.in" || die "sed for libnet-1.0-config failed"
+
+               sed -i -e 's:-lnet:-lnet-1.0:g' \
+                       "${WORKDIR}/${P}/configure.in" || die "sed for -lnet-1.0 failed"
+
+               sed -i -e 's:AC_CHECK_LIB(net:AC_CHECK_LIB(net-1.0:g' \
+                       "${WORKDIR}/${P}/configure.in" || die "sed for net-1.0 failed"
+
+       fi
+
+       #Multilib fix for the sf_engine
+       einfo "Applying multilib fix."
+       sed -i -e 's:${exec_prefix}/lib:${exec_prefix}/'$(get_libdir)':g' \
+               "${WORKDIR}/${P}/src/dynamic-plugins/sf_engine/Makefile.am" \
+               || die "sed for sf_engine failed"
+
+       #Multilib fix for the curent set of dynamic-preprocessors
+       for i in ftptelnet smtp ssh dcerpc dns ssl dcerpc2; do
+               sed -i -e 's:${exec_prefix}/lib:${exec_prefix}/'$(get_libdir)':g' \
+                       "${WORKDIR}/${P}/src/dynamic-preprocessors/$i/Makefile.am" \
+                       || die "sed for $i failed."
+       done
+
+       #This sed will prevent the example dynamic code from being compiled/installed
+       einfo "Disabling sample code."
+       sed -i -e 's:$(EXAMPLES_DIR)::g' "${WORKDIR}/${P}/src/Makefile.am"
+
+       if use prelude; then
+               einfo "Applying prelude fix."
+               sed -i -e "s:AC_PROG_RANLIB:AC_PROG_LIBTOOL:" configure.in
+       fi
+
+       AT_M4DIR=m4 eautoreconf
+}
+
+src_compile() {
+
+       local myconf
+
+       #targetbased and inline-init-failopen automaticly enable pthread
+       if use threads || use targetbased || use inline-init-failopen; then
+               myconf="${myconf} --enable-pthread"
+       fi
+
+       #Tell flexresp, react, and inline where libipq is
+       if use flexresp || use react || use inline; then
+               myconf="${myconf} --with-libipq-includes=/usr/include/libipq"
+       fi
+
+       econf \
+               $(use_enable !static shared) \
+               $(use_enable static) \
+               $(use_enable dynamicplugin) \
+               $(use_enable ipv6) \
+               $(use_enable gre) \
+               $(use_enable mpls) \
+               $(use_enable targetbased) \
+               $(use_enable decoder-preprocessor-rules) \
+               $(use_enable ppm) \
+               $(use_enable timestats) \
+               $(use_enable perfprofiling) \
+               $(use_enable linux-smp-stats) \
+               $(use_enable inline) \
+               $(use_enable inline-init-failopen) \
+               $(use_enable prelude) \
+               $(use_enable debug) \
+               $(use_enable reload) \
+               $(use_enable reload-error-restart) \
+               $(use_enable flexresp) \
+               $(use_enable flexresp2) \
+               $(use_enable react) \
+               $(use_enable aruba) \
+               $(use_with mysql) \
+               $(use_with odbc) \
+               $(use_with postgres postgresql) \
+               --disable-ipfw \
+               --disable-profile \
+               --disable-ppm-test \
+               --without-oracle \
+               ${myconf}
+
+       emake || die "make failed"
+
+}
+
+src_install() {
+
+       emake DESTDIR="${D}" install || die "make install failed"
+
+       keepdir /var/log/snort/
+       fowners snort:snort /var/log/snort
+
+       keepdir /var/run/snort/
+       fowners snort:snort /var/run/snort/
+
+       dodoc doc/*
+       dodoc ./RELEASE.NOTES
+       docinto schemas
+       dodoc schemas/*
+
+       insinto /etc/snort
+       doins etc/attribute_table.dtd \
+               etc/classification.config \
+               etc/gen-msg.map \
+               etc/reference.config \
+               etc/sid-msg.map \
+               etc/threshold.conf \
+               etc/unicode.map \
+               || die "Failed to add files in /etc/snort"
+
+       newins etc/snort.conf snort.conf.distrib
+
+       insinto /etc/snort/preproc_rules
+       doins preproc_rules/decoder.rules \
+               preproc_rules/preprocessor.rules \
+               || die "Failed to add files in /etc/snort/preproc_rules"
+
+       keepdir /etc/snort/rules/
+
+       keepdir /usr/$(get_libdir)/snort_dynamicrule
+
+       fowners -R snort:snort /etc/snort/
+
+       if use reload; then
+               newinitd "${FILESDIR}/snort.reload.rc1" snort \
+                       || die "Failed to add snort.reload.rc1"
+       else
+               newinitd "${FILESDIR}/snort.rc9" snort || die "Failed to add snort.rc9"
+       fi
+
+       newconfd "${FILESDIR}/snort.confd" snort || die "Failed to add snort.confd"
+
+       # Set the correct lib path for dynamicengine, dynamicpreprocessor, and dynamicdetection
+       sed -i -e 's:/usr/local/lib:/usr/'$(get_libdir)':g' \
+               "${D}etc/snort/snort.conf.distrib"
+
+       #Set the correct rule location in the config
+       sed -i -e 's:RULE_PATH ../rules:RULE_PATH /etc/snort/rules:g' \
+               "${D}etc/snort/snort.conf.distrib"
+
+       #Set the correct preprocessor/decoder rule location in the config
+       sed -i -e 's:PREPROC_RULE_PATH ../preproc_rules:PREPROC_RULE_PATH /etc/snort/preproc_rules:g' \
+               "${D}etc/snort/snort.conf.distrib"
+
+       #Enable the preprocessor/decoder rules
+       sed -i -e 's:^# include $PREPROC_RULE_PATH:include $PREPROC_RULE_PATH:g' \
+               "${D}etc/snort/snort.conf.distrib"
+       sed -i -e 's:^# dynamicdetection directory:dynamicdetection directory:g' \
+               "${D}etc/snort/snort.conf.distrib"
+
+       #Just some clean up of trailing /'s in the config
+       sed -i -e 's:snort_dynamicpreprocessor/$:snort_dynamicpreprocessor:g' \
+               "${D}etc/snort/snort.conf.distrib"
+       sed -i -e 's:snort_dynamicrule/$:snort_dynamicrule:g' \
+               "${D}etc/snort/snort.conf.distrib"
+
+       #Make it clear in the config where these are...
+       sed -i -e 's:^include classification.config:include /etc/snort/classification.config:g' \
+               "${D}etc/snort/snort.conf.distrib"
+       sed -i -e 's:^include reference.config:include /etc/snort/reference.config:g' \
+               "${D}etc/snort/snort.conf.distrib"
+
+       #Disable all rule files by default.
+       #Users need to choose what they want enabled.
+       sed -i -e 's:^include $RULE_PATH:# include $RULE_PATH:g' \
+               "${D}etc/snort/snort.conf.distrib"
+
+}
+
+pkg_postinst() {
+       einfo
+       einfo "Snort is a libpcap based packet capture tool which can be used in"
+       einfo "three modes Sniffer Mode, Packet Logger Mode, or Network Intrusion"
+       einfo "Detection/Prevention System Mode."
+       einfo
+       einfo "To learn more about these modes review the Snort User Manual at..."
+       einfo
+       einfo "http://www.snort.org/docs/"
+       einfo
+       einfo "See /usr/share/doc/${PF} and /etc/snort/snort.conf.distrib for"
+       einfo "information on configuring snort."
+       einfo
+       einfo "Joining the Snort-Users and Snort-Sigs mailing list is highly"
+       einfo "recommended for all users..."
+       einfo
+       einfo "http://www.snort.org/community/mailing-lists/"
+       einfo
+       einfo "To download rules for use with Snort please, see the following"
+       einfo
+       einfo "Sourcefire's VRT Rules and older Community Rules:"
+       einfo "http://www.snort.org/pub-bin/downloads.cgi"
+       einfo
+       einfo "Emerging Threats Rules:"
+       einfo "http://www.emergingthreats.net/"
+       einfo
+       einfo "To manage updates to your rules please visit..."
+       einfo
+       einfo "http://oinkmaster.sourceforge.net/"
+       einfo
+       einfo "and then 'emerge oinkmaster'."
+       elog
+       elog "Snort-2.8.5.3 Notes:"
+       elog
+       elog "Ebuild Notes"
+       elog "The USE flags 'prelude' and 'ipv6' now work when used together."
+       elog
+       elog "Snort Release Notes:"
+       elog "http://dl.snort.org/snort-current/release_notes_2853.txt"
+       elog
+       elog "Make sure to check snort.conf.distrib for new features/options."
+       elog
+}