# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Libpcap-based Packet Logger and Soft Tap" HOMEPAGE="http://www.snort.org/users/roesch/Site/Daemonlogger/Daemonlogger.html" SRC_URI="http://www.snort.org/users/roesch/code/${P}.tar.gz" SLOT="0" LICENSE="GPL-2" KEYWORDS="~amd64 ~x86" IUSE="" DEPEND="dev-libs/libdnet net-libs/libpcap" RDEPEND="" pkg_setup() { # pre_inst() is a better place to put this # but we need it here for the 'fowners' statements in src_install() enewgroup daemonlogger enewuser daemonlogger -1 -1 /dev/null snort } src_unpack() { unpack ${A} cd "${S}" } src_compile() { local myconf econf ${myconf} emake || die "make failed" } src_install () { emake DESTDIR="${D}" install || die "make install failed" keepdir /etc/daemonlogger/ fowners daemonlogger:daemonlogger /etc/daemonlogger/ touch "${D}"/etc/daemonlogger/daemonlogger.bpf fowners daemonlogger:daemonlogger /etc/daemonlogger/daemonlogger.bpf keepdir /var/log/daemonlogger/ fowners daemonlogger:daemonlogger /var/log/daemonlogger/ keepdir /var/run/daemonlogger/ fowners daemonlogger:daemonlogger /var/run/daemonlogger/ dodoc ./AUTHORS \ ./ChangeLog \ ./COPYING \ ./INSTALL \ ./README newconfd "${FILESDIR}/daemonlogger.confd.1" daemonlogger || die "Failed to add confd file" newinitd "${FILESDIR}/daemonlogger.rc.1" daemonlogger || die "Failed to add init file" } pkg_postinst() { einfo einfo "This is a libpcap-based program. It has two runtime modes:" einfo einfo "1)It sniffs packets and spools them straight to the disk and can" einfo " daemonize itself for background packet logging. By default the" einfo "file rolls over when 1 GB of data is logged." einfo einfo "2)It sniffs packets and rewrites them to a second interface," einfo "essentially acting as a soft tap. It can also do this in" einfo "daemon mode." einfo einfo "These two runtime modes are mutually exclusive, if the program is" einfo "placed in tap mode then logging to disk is disabled." einfo }