Add --pidfile option to init script for bug 123169. Thanks to Eric Brown <bigwhitecow...
authorMarcelo Góes <vanquirius@gentoo.org>
Fri, 17 Feb 2006 16:22:03 +0000 (16:22 +0000)
committerMarcelo Góes <vanquirius@gentoo.org>
Fri, 17 Feb 2006 16:22:03 +0000 (16:22 +0000)
Package-Manager: portage-2.0.54

net-analyzer/snort/ChangeLog
net-analyzer/snort/Manifest
net-analyzer/snort/files/digest-snort-2.4.3-r2 [new file with mode: 0644]
net-analyzer/snort/files/snort.rc7 [new file with mode: 0644]
net-analyzer/snort/snort-2.4.3-r2.ebuild [new file with mode: 0644]

index cef2fceb7a00258d468556ba8d5419ba32d135cd..9a93b76e2f1bc31cea1d14c271e451bd69447b0a 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for net-analyzer/snort
 # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/ChangeLog,v 1.91 2006/02/15 23:56:32 jokey Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/ChangeLog,v 1.92 2006/02/17 16:22:02 vanquirius Exp $
+
+*snort-2.4.3-r2 (17 Feb 2006)
+
+  17 Feb 2006; Marcelo Goes <vanquirius@gentoo.org> +files/snort.rc7,
+  +snort-2.4.3-r2.ebuild:
+  Add --pidfile option to init script for bug 123169. Thanks to Eric Brown
+  <bigwhitecow at hotmail dot com>.
 
   15 Feb 2006; Markus Ullmann <jokey@gentoo.org> snort-2.3.3.ebuild,
   snort-2.3.3-r1.ebuild, snort-2.4.3.ebuild, snort-2.4.3-r1.ebuild:
index 97b9aa341b80fedfc9cdef869356c4f498c0dee8..410b33791027f390fed2edb2dfdda0eb0f652014 100644 (file)
@@ -1,42 +1,17 @@
-MD5 f9e8a26f62e06e5251b192b8dfe4e878 ChangeLog 17140
-RMD160 ea4de5353a332d01d4a680c025241144b30f4fc9 ChangeLog 17140
-SHA256 97a4340fdc279a1ca688dc2f208f5c8bbddd0b2a3bca5e4a03126c1b017a6c7e ChangeLog 17140
+MD5 754936315581465cbed939fe25f8a490 ChangeLog 17384
 MD5 564bfdf90fe29f5924c68885ccfcddb8 files/2.3.0-libnet-1.0.patch 5424
-RMD160 dea7874b1ff0a99dec94cb4e537131042a994d23 files/2.3.0-libnet-1.0.patch 5424
-SHA256 63305e5785c393e62cffa2126584c146d1282d02108e58ddda182b24a56126c5 files/2.3.0-libnet-1.0.patch 5424
 MD5 24851ef65be2d80a70ba4bebe3e8c0ff files/digest-snort-2.3.3 287
-RMD160 1896969c5ed7e348592493bb75e03a6c924ae623 files/digest-snort-2.3.3 287
-SHA256 bd94b3c5a8348afdab2e24372706fa082d7f7d8f41d31f30b386d9a1814c8561 files/digest-snort-2.3.3 287
 MD5 04f9ed946469f7954b6bd27f8f1aca39 files/digest-snort-2.3.3-r1 284
-RMD160 9b8e5310ec09a450b589ecf91cb4c56cf7e3422e files/digest-snort-2.3.3-r1 284
-SHA256 6b7e4bd2e357726d7d14a7ab4bf1c9a0b865982440dd0166d22f394610c82fd1 files/digest-snort-2.3.3-r1 284
 MD5 6ac0e71e30f79ee3c5d01349111b58fe files/digest-snort-2.4.3 271
-RMD160 36a937a4a8204ff74a327af62bc9cf64a19a8f0b files/digest-snort-2.4.3 271
-SHA256 5aa88d025e7ed34d8b718587525e1396ad4bf9701f7add7bc7866ca522de9cc7 files/digest-snort-2.4.3 271
 MD5 5008d92cc4bf98a4c85f0e8eefc5e7de files/digest-snort-2.4.3-r1 340
-RMD160 2e4ef32b6eda573054d3f2aae37cee0e0bbad477 files/digest-snort-2.4.3-r1 340
-SHA256 c24f0b0539d30848d85b5245c6e07b833d5e0497bc40fb0d528fbeb4e10b8415 files/digest-snort-2.4.3-r1 340
+MD5 5008d92cc4bf98a4c85f0e8eefc5e7de files/digest-snort-2.4.3-r2 340
 MD5 d212aff92317ccfae4c2228de5f9e5cb files/snort-2.3.3-log.c.diff 4781
-RMD160 f6c20f02a041a577b3606c7f17ff0db3ab7784aa files/snort-2.3.3-log.c.diff 4781
-SHA256 56420bf76f6dafba6e6d00db5d2409a9eb34bec9f2b383df08344e180ebde2fc files/snort-2.3.3-log.c.diff 4781
 MD5 446f8d2b3435b8a6be738da978670605 files/snort.confd 423
-RMD160 8312bad7b271cc20a9eeb8f08f0cba5cd330eb2f files/snort.confd 423
-SHA256 d504cb31ffcce9acc8fc7b68123a31a53b491444c52730339ea9a4e986521f71 files/snort.confd 423
 MD5 9c325479975ea9fcb4f62c01407e8194 files/snort.rc6 712
-RMD160 f273546696a13cf5cc38170af0fa806e932d86a9 files/snort.rc6 712
-SHA256 6bbd8ea3852d2cfeef600e17bb86aefd40b3558cdf3e227adc8a7b816626cd87 files/snort.rc6 712
+MD5 cbbb4b70707fd563ba56143897b3d371 files/snort.rc7 739
 MD5 53edc4328d9adeaf087c65ea94b1594b metadata.xml 246
-RMD160 427cf3e9767d777650d905a7b4fcad57259908bb metadata.xml 246
-SHA256 843ac8d26d6f2f01b254d963268d1b4dc7ec515e5ce16daf47f7c68f2c47584e metadata.xml 246
 MD5 24799d4ba7d72d78e284cfbaa6549e71 snort-2.3.3-r1.ebuild 4036
-RMD160 a0a474b4d04ceef191c4547bb1945adef86ca09f snort-2.3.3-r1.ebuild 4036
-SHA256 61232e4924a4ccdcb469c14ec317175a011694b89a65532df298cac46ee784b5 snort-2.3.3-r1.ebuild 4036
 MD5 07e21fc103de54abc76b35aa1336fa5f snort-2.3.3.ebuild 3974
-RMD160 7bb1f9e2a85b6372764f96af588613ce2ea53bf3 snort-2.3.3.ebuild 3974
-SHA256 2aeff8f1fefbf38c71305746956f0dd31a3e3e99d6bb10dffe15c9bf10e11146 snort-2.3.3.ebuild 3974
 MD5 ad3736da1cf3f1413009090fc453ddb8 snort-2.4.3-r1.ebuild 4398
-RMD160 e211751e599011a0919534a79d6e24df6827bdf8 snort-2.4.3-r1.ebuild 4398
-SHA256 a127a2565cfcfcb4732d9f5537c08f433152c02cbc709c72fde653e8d486d05a snort-2.4.3-r1.ebuild 4398
+MD5 469eeaafbf98036877a7fa8f2563ee9c snort-2.4.3-r2.ebuild 4346
 MD5 a8bd0014fdd6385b3d99077e993998a3 snort-2.4.3.ebuild 4317
-RMD160 b74d0adfa87ef2a5cf77e8a3587fd9ca2643fcc7 snort-2.4.3.ebuild 4317
-SHA256 506313896d69be075efdfc2f29e24d1af4485e76bbdd7e1e91f020a553a1d216 snort-2.4.3.ebuild 4317
diff --git a/net-analyzer/snort/files/digest-snort-2.4.3-r2 b/net-analyzer/snort/files/digest-snort-2.4.3-r2
new file mode 100644 (file)
index 0000000..6495838
--- /dev/null
@@ -0,0 +1,5 @@
+MD5 39d8250f47a33aaec4712e29c0dcd1d0 Community-Rules.tar.gz 11678
+MD5 316f28cf52efeddfd899552f3b26cd8d snort-2.4.0-genpatches.tar.bz2 6475
+MD5 5c3c8c69f2459bbe0c1f2057966c88a7 snort-2.4.3.tar.gz 2733590
+MD5 35d9a2486f8c0280bb493aa03c011927 snortrules-pr-2.4.tar.gz 789097
+MD5 2eeef1a7a040d67c3afaf9d749905e47 snortsam-20050110.tar.gz 29395
diff --git a/net-analyzer/snort/files/snort.rc7 b/net-analyzer/snort/files/snort.rc7
new file mode 100644 (file)
index 0000000..668b807
--- /dev/null
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/files/snort.rc7,v 1.1 2006/02/17 16:22:03 vanquirius Exp $
+
+depend() {
+       need net
+}
+
+checkconfig() {
+       if [ ! -e $CONF ] ; then
+               eerror "You need a configuration file to run snort"
+               eerror "There is an example config in /etc/snort/snort.conf.distrib"
+               return 1
+       fi
+}
+
+start() {
+       checkconfig || return 1
+       ebegin "Starting snort"
+       start-stop-daemon --start --quiet --exec /usr/bin/snort \
+               --pidfile ${PIDFILE} \
+               -- ${SNORT_OPTS} >/dev/null 2>&1
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping snort"
+       start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+       eend $?
+}
diff --git a/net-analyzer/snort/snort-2.4.3-r2.ebuild b/net-analyzer/snort/snort-2.4.3-r2.ebuild
new file mode 100644 (file)
index 0000000..2a5184e
--- /dev/null
@@ -0,0 +1,151 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/snort-2.4.3-r2.ebuild,v 1.1 2006/02/17 16:22:02 vanquirius Exp $
+
+inherit eutils flag-o-matic autotools
+
+DESCRIPTION="Libpcap-based packet sniffer/logger/lightweight IDS"
+HOMEPAGE="http://www.snort.org/"
+SRC_URI="http://www.snort.org/dl/current/${P}.tar.gz
+       mirror://gentoo/snort-2.4.0-genpatches.tar.bz2
+       http://www.snort.org/pub-bin/downloads.cgi/Download/comm_rules/Community-Rules.tar.gz
+       http://www.snort.org/pub-bin/downloads.cgi/Download/vrt_pr/snortrules-pr-2.4.tar.gz
+       snortsam? ( mirror://gentoo/snortsam-20050110.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-alpha ~amd64 ~ppc ~ppc64 -sparc ~x86"
+IUSE="ssl postgres mysql flexresp selinux snortsam odbc prelude inline sguil"
+
+DEPEND="virtual/libc
+       >=dev-libs/libpcre-4.2-r1
+       net-libs/libpcap
+       flexresp? ( ~net-libs/libnet-1.0.2a )
+       postgres? ( >=dev-db/postgresql-7.2 )
+       mysql? ( >=dev-db/mysql-3.23.26 )
+       ssl? ( >=dev-libs/openssl-0.9.6b )
+       prelude? ( >=dev-libs/libprelude-0.9.0 )
+       odbc? ( dev-db/unixODBC )
+       inline? (
+               ~net-libs/libnet-1.0.2a
+               net-firewall/iptables
+               )"
+
+RDEPEND="${DEPEND}
+       dev-lang/perl
+       selinux? ( sec-policy/selinux-snort )
+       snortsam? ( net-analyzer/snortsam )"
+
+pkg_setup() {
+       enewgroup snort
+       enewuser snort -1 -1 /dev/null snort
+}
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       if use flexresp || use inline ; then
+               epatch "${WORKDIR}/2.4.0-libnet-1.0.patch"
+       fi
+
+       sed -i "s:var RULE_PATH ../rules:var RULE_PATH /etc/snort/rules:" \
+               etc/snort.conf || die "sed snort.conf failed"
+
+       if use prelude ; then
+               sed -i -e "s:AC_PROG_RANLIB:AC_PROG_LIBTOOL:" configure.in \
+                       || die "sed configure.in failed"
+       fi
+
+       if use sguil ; then
+               epatch "${WORKDIR}/2.4.0-spp_portscan_sguil.patch"
+               epatch "${WORKDIR}/2.4.0-spp_stream4_sguil.patch"
+       fi
+
+       if use snortsam ; then
+               cd ..
+               einfo "Applying snortsam patch"
+               ./patchsnort.sh "${S}" || die "snortsam patch failed"
+               cd "${S}"
+       fi
+
+       einfo "Regenerating autoconf/automake files"
+       AT_M4DIR=m4 eautoreconf
+}
+
+src_compile() {
+       local myconf
+
+       # There is no --disable-flexresp, cannot use use_enable
+       use flexresp && myconf="${myconf} --enable-flexresp"
+
+       use inline && append-flags -I/usr/include/libipq
+
+       econf \
+               $(use_with postgres postgresql) \
+               $(use_with mysql) \
+               $(use_with ssl openssl) \
+               $(use_with odbc) \
+               --without-oracle \
+               $(use_enable prelude) \
+               $(use_with sguil) \
+               $(use_enable inline) \
+               ${myconf} || die "bad ./configure"
+
+       emake || die "compile problem"
+}
+
+src_install() {
+       make DESTDIR="${D}" install || die "make install failed"
+
+       keepdir /var/log/snort/
+
+       dodoc doc/*
+       docinto schemas ; dodoc schemas/*
+
+       insinto /etc/snort
+       doins etc/reference.config etc/classification.config \
+               etc/*.map etc/threshold.conf
+       newins etc/snort.conf snort.conf
+       if use sguil ; then
+               sed -i -e "/^# output log_unified/s:# ::" \
+                       -e "s:snort.log:snort_unified.log:" \
+               "${D}/etc/snort/snort.conf" || die "sed failed"
+       fi
+
+       newinitd "${FILESDIR}/snort.rc7" snort
+       newconfd "${FILESDIR}/snort.confd" snort
+       if use sguil ; then
+               sed -i -e "s:/var/log/snort:/var/lib/sguil/$(hostname):" \
+               -e "/^SNORT_OPTS/s%-u snort%-m 122 -u sguil -g sguil -A none%" \
+                       "${D}/etc/conf.d/snort" || die "sed failed"
+       fi
+
+       fowners snort:snort /var/log/snort
+       fperms 0770 /var/log/snort
+
+       # install rules
+       dodir /etc/snort/rules
+       mv "${WORKDIR}"/rules/* "${D}/etc/snort/rules/"
+}
+
+pkg_postinst() {
+       if use mysql || use postgres || use odbc ; then
+               einfo "To use a database as a backend for snort you will have to"
+               einfo "import the correct tables to the database."
+               einfo "You will have to setup a database called snort first."
+               einfo
+               use mysql && \
+                       einfo "  MySQL: zcat /usr/share/doc/${PF}/schemas/create_mysql.gz | mysql -p snort"
+               use postgres && \
+                       einfo "  PostgreSQL: import /usr/share/doc/${PF}/schemas/create_postgresql.gz"
+               use odbc && einfo "SQL tables need to be created - look at /usr/share/doc/${PF}/schemas/"
+               einfo
+               einfo "Also, read the following Gentoo forums article:"
+               einfo '   http://forums.gentoo.org/viewtopic-t-399801.html'
+       fi
+       einfo
+       ewarn "Only a basic set of rules was installed."
+       ewarn "Please add your other sets of rules to /etc/snort/rules."
+       ewarn "For more information on rules, visit ${HOMEPAGE}."
+}