# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="NeTAMS stands for Network Traffic Accounting and Monitoring Software" HOMEPAGE="http://www.netams.com" SRC_URI="http://www.netams.com/files/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~x86" IUSE="mysql postgres frontend" DEPEND="sys-libs/db net-firewall/iptables net-libs/libpcap mysql? ( >=dev-db/mysql-3.23.51 ) postgres? ( dev-db/postgresql ) frontend? ( net-www/apache)" src_unpack() { if (( ! use mysql ) && ( ! use postgres)) then eerror "Selected mysql or postgresql database" die "No select database" fi unpack ${A} || die cd ${P} || die epatch ${FILESDIR}/${PV}/${P}-configure.patch epatch ${FILESDIR}/${PV}/${P}-makefile.patch if ( ! use mysql ) then epatch ${FILESDIR}/${PV/}${P}-mysql.patch fi if ( ! use postgres ) then epatch ${FILESDIR}/${PV}/${P}-postgres.patch fi } src_compile() { emake || die "Make failed" } src_install() { dodir /etc/netams /usr/share/doc/netams /var/www/localhost/netams exeinto /etc/init.d doexe ${FILESDIR}/${PV}/init.d/netams exeinto /usr/bin dobin src/netams src/netamsctl src/flowprobe src/ulog2netflow insinto /usr/share/man/man8 doins doc/netams.8 doc/flowprobe.8 doc/netamsctl.8 insinto /etc/netams insopts -m 644 doins addon/netams.cfg insinto /usr/share/doc/netams doins -r addon/* if (use frontend) then insinto /var/www/localhost/netams doins -r cgi-bin/* fi }