# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/barnyard2/barnyard2-1.6.ebuild,v 1.8 2009/07/19 19:35:21 Neo2 Exp $ #WANT_AUTOMAKE="1.4" inherit eutils autotools DESCRIPTION="Rewritten version of a fast output system for Snort" HOMEPAGE="http://www.securixlive.com/barnyard2/index.php" SRC_URI="http://www.securixlive.com/download/barnyard2/${P}.tar.gz" SLOT="0" LICENSE="QPL" KEYWORDS="~amd64 -sparc ~x86" IUSE="aruba debug gre mpls mysql ipv6 postgres prelude sguil" DEPEND="net-libs/libpcap postgres? ( >=virtual/postgresql-server-7.2 ) mysql? ( virtual/mysql ) sguil? ( dev-lang/tcl ) prelude? ( >=dev-libs/libprelude-0.9.0 )" RDEPEND="${DEPEND} net-analyzer/snort" S="${WORKDIR}/${P/_/-}" src_unpack() { unpack "${A}" cd "${S}" epatch "${FILESDIR}/platypus-fix-inet_ntop.patch" } src_compile() { #Not needed anymore, probing is done automatically by configure, only needed if install path is not default one # local myconf # if use mysql ; then # myconf="${myconf} --with-mysql" # fi # if use postgres ; then # myconf="${myconf} --with-postgresql" # fi # if use sguil ; then # myconf="${myconf} --with-tcl" # fi econf \ --sysconfdir=/etc/snort \ $(use_enable aruba) \ $(use_enable debug) \ $(use_enable gre) \ $(use_enable mpls) \ $(use_enable prelude) \ $(use_enable ipv6) # ${myconf} emake || die "compile problem" } src_install () { make DESTDIR="${D}" install || die dodoc doc/* dodoc RELEASE.NOTES keepdir /var/log/snort keepdir /var/log/snort/archive insinto /etc/snort newins etc/barnyard2.conf barnyard2.conf.distrib 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}"/barnyard2.confd barnyard2 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}"/barnyard2.rc6 barnyard2 if use sguil ; then sed -i -e "/start-stop-daemon --start/s:--exec:-c sguil --exec:" \ "${D}/etc/init.d/barnyard2" || die "sed failed" fi } pkg_postinst() { if use sguil ; then elog elog "Make sure to edit /etc/snort/barnyard2.conf and uncomment the" elog "sguil section along with supplying the appropriate database" elog "information." elog "Make sure to edit /etc/conf.d/barnyard2 to set the necessary" elog "commandline options for the rc script." elog fi }