Initial import. Ebuild by Jason Wallace based on work by Fabio Scaccabarozzi and...
authorPatrick Lauer <patrick@gentoo.org>
Tue, 16 Mar 2010 21:25:54 +0000 (21:25 +0000)
committerPatrick Lauer <patrick@gentoo.org>
Tue, 16 Mar 2010 21:25:54 +0000 (21:25 +0000)
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64

net-analyzer/barnyard2/ChangeLog [new file with mode: 0644]
net-analyzer/barnyard2/Manifest [new file with mode: 0644]
net-analyzer/barnyard2/barnyard2-1.8.ebuild [new file with mode: 0644]
net-analyzer/barnyard2/files/barnyard2.confd [new file with mode: 0644]
net-analyzer/barnyard2/files/barnyard2.initd [new file with mode: 0644]
net-analyzer/barnyard2/metadata.xml [new file with mode: 0644]

diff --git a/net-analyzer/barnyard2/ChangeLog b/net-analyzer/barnyard2/ChangeLog
new file mode 100644 (file)
index 0000000..097e3d4
--- /dev/null
@@ -0,0 +1,11 @@
+# ChangeLog for net-analyzer/barnyard2
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/barnyard2/ChangeLog,v 1.1 2010/03/16 21:25:53 patrick Exp $
+
+*barnyard2-1.8 (16 Mar 2010)
+
+  16 Mar 2010; Patrick Lauer <patrick@gentoo.org> +files/barnyard2.confd,
+  +files/barnyard2.initd, +barnyard2-1.8.ebuild, +metadata.xml:
+  Initial import. Ebuild by Jason Wallace based on work by Fabio
+  Scaccabarozzi and Han Boetes . Closes #279019 and #307783
+
diff --git a/net-analyzer/barnyard2/Manifest b/net-analyzer/barnyard2/Manifest
new file mode 100644 (file)
index 0000000..54db7e2
--- /dev/null
@@ -0,0 +1,6 @@
+AUX barnyard2.confd 1485 RMD160 8b0bac1a3f5177a825e890bc3e92af0068b80d6a SHA1 10a56df83f0c58f075a3dd16a80c585883b7e39b SHA256 4ff02a3d3de3641eccc3deddba255ecd7ac95ae3ad1382442413d103c9712c04
+AUX barnyard2.initd 799 RMD160 a0d505b088fa7e7fa7b7b3b1a63a81ee7d5d5959 SHA1 79f2c37101351ef54b8cb40a93a5264dc9a2fd74 SHA256 d471bfb90ab80150ebb29b82959df3cf60ee3f533cb89c6c294a4c5522668666
+DIST barnyard2-1.8.tar.gz 654290 RMD160 a50d7e771204e0a885bf3e079dd37fbb737e8306 SHA1 44bab5a3a3c35bd4c172aefe4bcd69c16658904e SHA256 1abfe6530d721debd98921421722b02c844c289564730b1e85729e4915b2bb7a
+EBUILD barnyard2-1.8.ebuild 3622 RMD160 79ec5c53342c0560e9f5a0ad4fe3ea94c3a3ba68 SHA1 408e24d3af9e42fbfea92a93cac4dc3a12915c3b SHA256 b01770742766d88b2c240f0063123bf7a8c785d330ee7afa166487ffc696add0
+MISC ChangeLog 512 RMD160 3dbf2255fe21643d1edcf829bccc28a0c91de71a SHA1 1dca787cdb50fe8bf427e3cb5cdbd8d05f642f8f SHA256 25969a837fd2ebbc8daa350e544be4dcc16890fc8bc6c8dec838be0d8dfa738c
+MISC metadata.xml 605 RMD160 e7fc000b5215fb9230e40cd2fa1b65e6e212053e SHA1 f91c160edfcdf4ba320ad378bff93cdec50f90f3 SHA256 583c24ed0e8cd2139f60f626259738ba147761b44eb6f46c96e3501e1a82cdb6
diff --git a/net-analyzer/barnyard2/barnyard2-1.8.ebuild b/net-analyzer/barnyard2/barnyard2-1.8.ebuild
new file mode 100644 (file)
index 0000000..e4457a6
--- /dev/null
@@ -0,0 +1,134 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/barnyard2/barnyard2-1.8.ebuild,v 1.1 2010/03/16 21:25:53 patrick Exp $
+
+inherit eutils
+
+DESCRIPTION="Parser for Snort unified/unified2 files"
+HOMEPAGE="http://www.securixlive.com/barnyard2/"
+SRC_URI="http://www.securixlive.com/download/barnyard2/${P}.tar.gz"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE="static debug aruba gre mpls prelude ipv6 mysql odbc postgres"
+
+DEPEND="virtual/libpcap
+           mysql? ( virtual/mysql )
+               postgres? ( >=virtual/postgresql-server-7.2 )
+               prelude? ( >=dev-libs/libprelude-0.9.0 )
+               sguil? ( dev-lang/tcl )
+               odbc? ( dev-db/unixODBC )"
+
+src_unpack() {
+
+       unpack ${A}
+       cd "${S}"
+
+}
+
+src_compile() {
+
+       local myconf
+
+       econf \
+               $(use_enable !static shared) \
+               $(use_enable static) \
+               $(use_enable debug) \
+               $(use_enable aruba) \
+               $(use_enable gre) \
+               $(use_enable mpls) \
+               $(use_enable prelude) \
+               $(use_enable ipv6) \
+               $(use_with mysql) \
+               $(use_with odbc) \
+               $(use_with postgres postgresql) \
+               --without-oracle \
+               ${myconf}
+
+       emake || die "make failed"
+
+}
+
+src_install () {
+
+       make DESTDIR="${D}" install || die "make install failed"
+
+       dodir /etc/barnyard2
+
+       # A spool dir is needed to start BY2 and this is the most likely choice.
+       dodir /var/log/snort
+
+       # BY2 doesn't write logs to this dir unless a logging type output plugin
+       # is chosen, but BY2 will not start without a log dir defined.
+       dodir /var/log/barnyard2
+
+       dodoc doc/INSTALL \
+                 doc/README \
+                 doc/README.aruba \
+             doc/README.database \
+                 doc/README.sguil \
+                 LICENSE \
+                 RELEASE.NOTES
+
+       dodoc schemas/create_db2 \
+             schemas/create_mssql \
+                 schemas/create_mysql \
+                 schemas/create_oracle.sql \
+                 schemas/create_postgresql
+
+       insinto /etc/barnyard2
+       newins etc/barnyard2.conf barnyard2.conf.distrib
+
+       einfo "Making changes to barnyard2.conf.distrib."
+       sed -i -e "s:^#config interface:config interface:" \
+               "${D}etc/barnyard2/barnyard2.conf.distrib" \
+               || die "Failed to update barnyard2.conf.distrib"
+
+       sed -i -e "s:^output alert_fast:#output alert_fast:" \
+               "${D}etc/barnyard2/barnyard2.conf.distrib" \
+               || die "Failed to update barnyard2.conf.distrib"
+
+       newconfd "${FILESDIR}/barnyard2.confd" barnyard2 \
+               || die "Failed to add barnyard2.confd"
+
+       newinitd "${FILESDIR}/barnyard2.initd" barnyard2 \
+               || die "Failed to add barnyard2.initd"
+
+}
+
+pkg_postinst() {
+
+       einfo
+       einfo "Barnyard2 is a fork of the original barnyard project "
+       einfo "(which is no longer under development)."
+       einfo
+       einfo "Barnyard2 is designed specifically for Snort's new unified2"
+       einfo "file format. Barnyard2 is under active development and continues"
+       einfo "to adapt based on user feedback."
+       elog
+       elog "For confiuration options, take a look at..."
+       elog
+       elog "/etc/barnyard2/barnyard2.conf.distrib"
+       elog
+       ewarn "The following output plugins are considered 'beta' for ${P}"
+       ewarn "So your milage may very if you use them."
+       ewarn
+       ewarn "alert_arrubaaction"
+       ewarn "alert_cef"
+       ewarn "alert_prelude"
+       ewarn "alert_unixsock"
+       ewarn
+       ewarn "For a list of stable output plugins see..."
+       ewarn
+       ewarn "http://www.securixlive.com/barnyard2/index.php"
+       ewarn
+       ewarn "IMPORTANT:"
+       ewarn
+       ewarn "The settings for 'INTERFACE=' in /etc/conf.d/barnyard2 and"
+       ewarn "for 'config interface' in /etc/barnyard2/barnyard2.conf"
+       ewarn "must be the same!! The PID file for barnyard2 takes the form of"
+       ewarn "barnyard2_<interface>.pid. If conf.d and barnyard2.conf"
+       ewarn "do not match then doing '/etc/init.d/barnyard2 stop' will not work."
+       ewarn
+
+}
diff --git a/net-analyzer/barnyard2/files/barnyard2.confd b/net-analyzer/barnyard2/files/barnyard2.confd
new file mode 100644 (file)
index 0000000..d114f82
--- /dev/null
@@ -0,0 +1,36 @@
+# Config file for /etc/init.d/barnyard2
+
+# This file only contains variables needed by the init.d script.
+# All other configuration options are located in the barnyard2.conf file
+
+# This should be the first part of the unified/unified2 log file name (without the time stamp)
+# Ex. If you log files look like this 'snort.unified2.1239801645' then you would use 'snort.unified2'
+SPOOL_FILE="snort.unified2"
+
+# Location of your unified/unified2 log files
+SPOOL_DIR="/var/log/snort"
+
+# Directory to log to
+LOG_DIR="/var/log/barnyard2"
+
+# This MUST match what you set for "config interface:" in your barnyard2.conf
+# If you do not set this correctly then Barnyard2 will not stop when you do a 
+# "/etc/init.d/barnyard2 stop"
+INTERFACE="eth0"
+
+# You probably don't want to change this, but in case you do
+PID_FILE="barnyard2_${INTERFACE}.pid"
+PID_PATH="/var/run"
+
+# The waldo file is located in the SPOOL_DIR to support multipule instances of barnyard2
+WALDO_FILE="${SPOOL_DIR}/barnyard2.waldo"
+CONF="/etc/barnyard2/barnyard2.conf"
+
+# Location of the archive directory if you choose to use it.
+# The ARCHIVE_DIR is located in the SPOOL_DIR to support multipule instances of barnyard2
+#ARCHIVE_DIR="${SPOOL_DIR}/archive"
+
+# This pulls in the options above
+BARNYARD_OPTS="-D -c ${CONF} -d ${SPOOL_DIR} -w ${WALDO_FILE} -f ${SPOOL_FILE} -l ${LOG_DIR}"
+# Or with an archive directory
+#BARNYARD_OPTS="-D -c ${CONF} -d ${SPOOL_DIR} -w ${WALDO_FILE} -f ${LOG_FILE} -l ${LOG_DIR} -a ${ARCHIVE_DIR}"
diff --git a/net-analyzer/barnyard2/files/barnyard2.initd b/net-analyzer/barnyard2/files/barnyard2.initd
new file mode 100644 (file)
index 0000000..4d0a338
--- /dev/null
@@ -0,0 +1,30 @@
+#!/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/barnyard2/files/barnyard2.initd,v 1.1 2010/03/16 21:25:54 patrick Exp $
+
+depend() {
+       need net
+}
+
+checkconfig() {
+       if [ ! -e ${CONF} ] ; then
+               eerror "You need a configuration file to run barnyard2"
+               eerror "There is an example config in /etc/snort/barnyard2.conf.distrib"
+               return 1
+       fi
+}
+
+start() {
+       checkconfig || return 1
+       ebegin "Starting barnyard2"
+       start-stop-daemon --start --quiet --exec /usr/bin/barnyard2 \
+               -- --pid-path ${PID_PATH} --nolock-pidfile ${BARNYARD_OPTS} >/dev/null 2>&1
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping barnyard2"
+       start-stop-daemon --stop --quiet --pidfile ${PID_PATH}/${PID_FILE}
+       eend $?
+}
diff --git a/net-analyzer/barnyard2/metadata.xml b/net-analyzer/barnyard2/metadata.xml
new file mode 100644 (file)
index 0000000..dda471b
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">\r
+<pkgmetadata>\r
+<maintainer>\r
+  <email>patrick@gentoo.org</email>\r
+  <name>Patrick Lauer</name>\r
+</maintainer>\r
+<maintainer>\r
+  <email>jason.r.wallace@gmail.com</email>\r
+  <name>Jason Wallace</name>\r
+</maintainer>\r
+<herd>netmon</herd>\r
+<longdescription>Parser for Snort unified/unified2 files</longdescription>\r
+<use>\r
+<flag name='aruba'>Enable Aruba support</flag>\r
+<flag name='gre'>Enable GRE support</flag>\r
+<flag name='mpls'>Enable support for mpls networks</flag>\r
+</use>\r
+</pkgmetadata>\r