summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2010-01-16 00:07:41 +0000
committerPatrick Lauer <patrick@gentoo.org>2010-01-16 00:07:41 +0000
commitac05c8668f3338ad183048159f316bb5d94ff9d8 (patch)
tree8f21693e39377be796f488b36e7918a64c058ee5 /net-analyzer/barnyard
parentAdd boost detection patch to fix bug 295474 (diff)
downloadgentoo-2-ac05c8668f3338ad183048159f316bb5d94ff9d8.tar.gz
gentoo-2-ac05c8668f3338ad183048159f316bb5d94ff9d8.tar.bz2
gentoo-2-ac05c8668f3338ad183048159f316bb5d94ff9d8.zip
Fix for #296249
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer/barnyard')
-rw-r--r--net-analyzer/barnyard/ChangeLog10
-rw-r--r--net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild100
-rw-r--r--net-analyzer/barnyard/files/barnyard.64bit.diff81
3 files changed, 189 insertions, 2 deletions
diff --git a/net-analyzer/barnyard/ChangeLog b/net-analyzer/barnyard/ChangeLog
index 48b754f78c8d..32a08239733c 100644
--- a/net-analyzer/barnyard/ChangeLog
+++ b/net-analyzer/barnyard/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-analyzer/barnyard
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/barnyard/ChangeLog,v 1.22 2009/09/23 18:17:22 patrick Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/barnyard/ChangeLog,v 1.23 2010/01/16 00:07:40 patrick Exp $
+
+*barnyard-0.2.0-r3 (16 Jan 2010)
+
+ 16 Jan 2010; Patrick Lauer <pal@gentoo.org> +barnyard-0.2.0-r3.ebuild,
+ +files/barnyard.64bit.diff:
+ Fix for #296249
23 Sep 2009; Patrick Lauer <patrick@gentoo.org> barnyard-0.2.0-r1.ebuild:
Remove virtual/libc
diff --git a/net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild b/net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild
new file mode 100644
index 000000000000..c682c8ad76c1
--- /dev/null
+++ b/net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild,v 1.1 2010/01/16 00:07:40 patrick Exp $
+
+EAPI=2
+
+WANT_AUTOMAKE="1.4"
+inherit eutils autotools
+
+DESCRIPTION="Fast output system for Snort"
+HOMEPAGE="http://www.snort.org/dl/barnyard/"
+SRC_URI="mirror://sourceforge/barnyard/barnyard-${PV/_/-}.tar.gz
+ mirror://gentoo/${P}-patches.tar.bz2"
+
+SLOT="0"
+LICENSE="QPL"
+KEYWORDS="~amd64 -sparc ~x86"
+IUSE="mysql postgres sguil"
+
+DEPEND="net-libs/libpcap
+ postgres? ( >=virtual/postgresql-server-7.2 )
+ mysql? ( virtual/mysql )
+ sguil? ( dev-lang/tcl )"
+
+RDEPEND="${DEPEND}
+ net-analyzer/snort"
+
+S="${WORKDIR}/${P/_/-}"
+
+src_prepare() {
+ epatch "${FILESDIR}/barnyard.64bit.diff"
+ if use sguil ; then
+ epatch "${WORKDIR}/${PV}-sguil_files.patch"
+ epatch "${WORKDIR}/${PV}-configure-in.patch"
+ cd "${S}/src/output-plugins"
+ epatch "${WORKDIR}/${PV}-op_plugbase.c.patch"
+ cd "${S}"
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ local myconf
+ if use sguil ; then
+ myconf="--enable-tcl"
+ fi
+
+ econf \
+ ${myconf} \
+ --sysconfdir=/etc/snort \
+ $(use_enable postgres) \
+ $(use_enable mysql)
+}
+src_compile() {
+ emake || die "compile problem"
+}
+
+src_install () {
+
+ make DESTDIR="${D}" install || die
+
+ dodoc docs/*
+ dodoc AUTHORS README
+
+ keepdir /var/log/snort
+ keepdir /var/log/snort/archive
+
+ insinto /etc/snort
+ newins etc/barnyard.conf barnyard.conf
+ if use sguil ; then
+ sed -i -e "/config hostname:/s%snorthost%$(hostname)%" \
+ -e "/config interface/s:fxp0:eth0:" \
+ -e "s:output alert_fast:#output alert_fast:" \
+ -e "s:output log_dump:#output log_dump:" \
+ "${D}/etc/snort/barnyard.conf" || die "sed failed"
+ fi
+
+ newconfd "${FILESDIR}"/barnyard.confd barnyard
+ if use sguil ; then
+ sed -i -e s:/var/log/snort:/var/lib/sguil/$(hostname): \
+ -e s:/var/run/barnyard.pid:/var/run/sguil/barnyard.pid: \
+ "${D}/etc/conf.d/barnyard" || die "sed failed"
+ fi
+
+ newinitd "${FILESDIR}"/barnyard.rc6 barnyard
+ if use sguil ; then
+ sed -i -e "/start-stop-daemon --start/s:--exec:-c sguil --exec:" \
+ "${D}/etc/init.d/barnyard" || die "sed failed"
+ fi
+}
+
+pkg_postinst() {
+ if use sguil ; then
+ elog
+ elog "Make sure to edit /etc/snort/barnyard.conf and uncomment the"
+ elog "sguil section along with supplying the appropriate database"
+ elog "information."
+ elog
+ fi
+}
diff --git a/net-analyzer/barnyard/files/barnyard.64bit.diff b/net-analyzer/barnyard/files/barnyard.64bit.diff
new file mode 100644
index 000000000000..f338d291ff1c
--- /dev/null
+++ b/net-analyzer/barnyard/files/barnyard.64bit.diff
@@ -0,0 +1,81 @@
+diff -ur barnyard-0.2.0/src/barnyard.h barnyard-0.2.0.64bit/src/barnyard.h
+--- barnyard-0.2.0/src/barnyard.h 2004-05-01 12:43:29.000000000 -0400
++++ barnyard-0.2.0.64bit/src/barnyard.h 2007-08-11 23:22:53.000000000 -0400
+@@ -34,7 +34,8 @@
+
+ typedef struct _SnortPktHeader
+ {
+- struct timeval ts; /* packet timestamp */
++ // struct timeval ts; /* packet timestamp */
++ struct pcap_timeval ts; /* packet timestamp */
+ u_int32_t caplen; /* packet capture length */
+ u_int32_t pktlen; /* packet "real" length */
+ } SnortPktHeader;
+Only in barnyard-0.2.0.64bit/src: barnyard.h~
+diff -ur barnyard-0.2.0/src/event.h barnyard-0.2.0.64bit/src/event.h
+--- barnyard-0.2.0/src/event.h 2003-05-02 22:44:12.000000000 -0400
++++ barnyard-0.2.0.64bit/src/event.h 2007-08-12 00:13:44.000000000 -0400
+@@ -19,6 +19,11 @@
+ #include <sys/types.h>
+ #include <sys/time.h>
+
++struct pcap_timeval {
++ u_int32_t tv_sec; /* seconds */
++ u_int32_t tv_usec; /* microseconds */
++};
++
+ typedef struct _Event
+ {
+ u_int32_t sig_generator; /* which part of snort generated the alert? */
+@@ -30,6 +35,7 @@
+ u_int32_t event_reference; /* reference to other events that have gone off,
+ * such as in the case of tagged packets...
+ */
+- struct timeval ref_time; /* reference time for the event reference */
++ // struct timeval ref_time; /* reference time for the event reference */
++ struct pcap_timeval ref_time; /* reference time for the event reference */
+ } Event;
+ #endif /* __EVENT_H__ */
+Only in barnyard-0.2.0.64bit/src: event.h~
+diff -ur barnyard-0.2.0/src/input-plugins/dp_alert.h barnyard-0.2.0.64bit/src/input-plugins/dp_alert.h
+--- barnyard-0.2.0/src/input-plugins/dp_alert.h 2004-02-19 20:59:48.000000000 -0500
++++ barnyard-0.2.0.64bit/src/input-plugins/dp_alert.h 2007-08-11 23:24:25.000000000 -0400
+@@ -34,7 +34,8 @@
+ typedef struct _UnifiedAlertRecord
+ {
+ Event event;
+- struct timeval ts; /* event timestamp */
++ // struct timeval ts; /* event timestamp */
++ struct pcap_timeval ts; /* event timestamp */
+ u_int32_t sip; /* src ip */
+ u_int32_t dip; /* dest ip */
+ u_int16_t sp; /* src port */
+Only in barnyard-0.2.0.64bit/src/input-plugins: dp_alert.h~
+diff -ur barnyard-0.2.0/src/util.c barnyard-0.2.0.64bit/src/util.c
+--- barnyard-0.2.0/src/util.c 2004-03-06 17:30:15.000000000 -0500
++++ barnyard-0.2.0.64bit/src/util.c 2007-08-12 00:14:52.000000000 -0400
+@@ -514,7 +514,8 @@
+
+ static char tmpbuf[256];
+
+-int RenderTimeval(struct timeval *tv, char *timebuf, size_t len)
++// int RenderTimeval(struct timeval *tv, char *timebuf, size_t len)
++int RenderTimeval(struct pcap_timeval *tv, char *timebuf, size_t len)
+ {
+ struct tm *lt;
+ time_t timet;
+Only in barnyard-0.2.0.64bit/src: util.c~
+diff -ur barnyard-0.2.0/src/util.h barnyard-0.2.0.64bit/src/util.h
+--- barnyard-0.2.0/src/util.h 2004-03-06 19:23:50.000000000 -0500
++++ barnyard-0.2.0.64bit/src/util.h 2007-08-11 23:23:46.000000000 -0400
+@@ -39,7 +39,8 @@
+ void ClearDumpBuf();
+ void GoDaemon();
+ size_t RenderTimestamp(time_t timet, char *timebuf, size_t len);
+-int RenderTimeval(struct timeval *tv, char *timebuf, size_t len);
++// int RenderTimeval(struct timeval *tv, char *timebuf, size_t len);
++int RenderTimeval(struct pcap_timeval *tv, char *timebuf, size_t len);
+ int CreatePidFile(char *filename);
+ int String2Long(char *string, long *result);
+ int String2ULong(char *string, unsigned long *result);
+Only in barnyard-0.2.0.64bit/src: util.h~