diff options
author | Peter Volkov <pva@gentoo.org> | 2007-11-03 17:33:26 +0000 |
---|---|---|
committer | Peter Volkov <pva@gentoo.org> | 2007-11-03 17:33:26 +0000 |
commit | 24cd8d8ef4f0cdebc5318e1cb5cd72e389a95207 (patch) | |
tree | 3e9d2db930a313b56f4d693246bb445a7ba6c660 /net-analyzer | |
parent | Fix to add -fPIC to EXTRAFLAGS from upstream Subversion. Fix also building wi... (diff) | |
download | gentoo-2-24cd8d8ef4f0cdebc5318e1cb5cd72e389a95207.tar.gz gentoo-2-24cd8d8ef4f0cdebc5318e1cb5cd72e389a95207.tar.bz2 gentoo-2-24cd8d8ef4f0cdebc5318e1cb5cd72e389a95207.zip |
Fixes init script and ebuild cleanups. Fixes bug #194650, thank Tiger <marchaldoneway AT hotmail.fr> for report and help.
(Portage version: 2.1.3.16)
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/darkstat/ChangeLog | 9 | ||||
-rw-r--r-- | net-analyzer/darkstat/darkstat-3.0.707-r1.ebuild | 59 | ||||
-rw-r--r-- | net-analyzer/darkstat/files/darkstat-confd.new | 27 | ||||
-rw-r--r-- | net-analyzer/darkstat/files/darkstat-init.new | 59 | ||||
-rw-r--r-- | net-analyzer/darkstat/files/digest-darkstat-3.0.707-r1 | 3 |
5 files changed, 156 insertions, 1 deletions
diff --git a/net-analyzer/darkstat/ChangeLog b/net-analyzer/darkstat/ChangeLog index c0b0b447465a..7618898c6507 100644 --- a/net-analyzer/darkstat/ChangeLog +++ b/net-analyzer/darkstat/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-analyzer/darkstat # Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/ChangeLog,v 1.26 2007/11/01 13:29:39 jokey Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/ChangeLog,v 1.27 2007/11/03 17:33:26 pva Exp $ + +*darkstat-3.0.707-r1 (03 Nov 2007) + + 03 Nov 2007; <pva@gentoo.org> +files/darkstat-confd.new, + +files/darkstat-init.new, +darkstat-3.0.707-r1.ebuild: + Fixes init script and ebuild cleanups. Fixes bug #194650, thank Tiger + <marchaldoneway AT hotmail.fr> for report and help. *darkstat-3.0.707 (01 Nov 2007) diff --git a/net-analyzer/darkstat/darkstat-3.0.707-r1.ebuild b/net-analyzer/darkstat/darkstat-3.0.707-r1.ebuild new file mode 100644 index 000000000000..4f285c071fc9 --- /dev/null +++ b/net-analyzer/darkstat/darkstat-3.0.707-r1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/darkstat-3.0.707-r1.ebuild,v 1.1 2007/11/03 17:33:26 pva Exp $ + +inherit eutils + +DESCRIPTION="darkstat is a network traffic analyzer" +HOMEPAGE="http://dmr.ath.cx/net/darkstat/" +SRC_URI="http://dmr.ath.cx/net/darkstat/${P}.tar.bz2" + +KEYWORDS="~amd64 ~ppc ~ppc-macos ~x86" +IUSE="" +LICENSE="GPL-2" +SLOT="0" + +DEPEND="net-libs/libpcap" + +DARKSTAT_CHROOT_DIR=${DARKSTAT_CHROOT_DIR:-/var/lib/darkstat} + +src_compile() { + econf --with-privdrop-user=darkstat \ + --with-chroot-dir="${DARKSTAT_CHROOT_DIR}" || die "./configure failed" + emake || die "compilation failed." +} + +src_install() { + emake DESTDIR="${D}" install || die "installation failed." + + dodoc AUTHORS README THANKS NEWS + + newinitd "${FILESDIR}"/darkstat-init.new darkstat + newconfd "${FILESDIR}"/darkstat-confd.new darkstat + + sed -i -e "s:__CHROOT__:${DARKSTAT_CHROOT_DIR}:g" "${D}"/etc/conf.d/darkstat + sed -i -e "s:__CHROOT__:${DARKSTAT_CHROOT_DIR}:g" "${D}"/etc/init.d/darkstat + + keepdir "${DARKSTAT_CHROOT_DIR}" + chown darkstat:0 "${D}${DARKSTAT_CHROOT_DIR}" +} + +pkg_preinst() { + enewuser darkstat || die "Failed to add user darkstat" +} + +pkg_postinst() { + # Workaround bug #141619 + DARKSTAT_CHROOT_DIR=`sed -n 's/^#CHROOT=\(.*\)/\1/p' /etc/conf.d/darkstat` + chown darkstat:0 "${DARKSTAT_CHROOT_DIR}" + + elog "WARNING: the darkstat init script has changed" + elog "To start different darkstat instances which will listen on a different" + elog "interfaces create in /etc/init.d directory the 'darkstat.if' symlink to" + elog "darkstat script where 'if' is the name of the interface." + elog "Also in /etc/conf.d directory copy darkstat to darkstat.if" + elog "and edit it to change default values." + elog + elog "darkstat's default chroot directory is: ${DARKSTAT_CHROOT_DIR}" +} + diff --git a/net-analyzer/darkstat/files/darkstat-confd.new b/net-analyzer/darkstat/files/darkstat-confd.new new file mode 100644 index 000000000000..3d95a0461a06 --- /dev/null +++ b/net-analyzer/darkstat/files/darkstat-confd.new @@ -0,0 +1,27 @@ +# The interface to listen on +# Use only with /etc/init.d/darkstat init script. If you use +# /etc/init.d/darkstat.if init script, then this option should be ignored. +#INTERFACE="eth0" + +# The port for the embedded webserver +#PORT="667" + +# The address embedded webserver should bind to +#ADDRESS="0.0.0.0" + +# Set the filter. See tcpdump documenation for details. +#FILTER="" + +# Log daily traffic statistics into the named file, relative to the +# chroot directory (see, below). +#DAYLOGFILE="darkstat.log" + +# Other options: +DARKSTAT_OPTS="--no-promisc --no-dns --user darkstat" + +# The directory to which the program chroots after initialization. +# If you change this, please note the variable below and adjust +# the permissions accordingly. Note that if you want to use the +# --daylog option in EXTRAOPTS, the files are logged relative +# to the chroot-directory; see the man-page for details. +#CHROOT=__CHROOT__ diff --git a/net-analyzer/darkstat/files/darkstat-init.new b/net-analyzer/darkstat/files/darkstat-init.new new file mode 100644 index 000000000000..c25a1174dae0 --- /dev/null +++ b/net-analyzer/darkstat/files/darkstat-init.new @@ -0,0 +1,59 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/darkstat/files/darkstat-init.new,v 1.1 2007/11/03 17:33:26 pva Exp $ + +IF=${SVCNAME##*.} + +if [ -n "${IF}" -a "${SVCNAME}" != "darkstat" ] ; then + PIDFILE=/var/run/darkstat.${IF}.pid +else + PIDFILE=/var/run/darkstat.pid +fi + +depend() { + need net +} + +chkconfig() { + if [ -n "${IF}" -a "${SVCNAME}" != "darkstat" ] ; then + if [ ! -f "/etc/conf.d/darkstat.${IF}" ] ; then + einfo "It's possible to have distinct config in /etc/conf.d/darkstat.${IF}." + fi + INTERFACE=${IF} + else + if [ ! -f "/etc/conf.d/darkstat" ] ; then + ewarn "/etc/conf.d/darkstat does not exist. Falling on defaults." + fi + fi + + if [ -z "${INTERFACE}" ]; then + ewarn "No interface specified. Trying to use eth0." + INTERFACE="eth0" + fi + + DARK_OPTS="-i ${INTERFACE}" + [ -n "${PORT}" ] && DARK_OPTS="${DARK_OPTS} -p ${PORT}" + [ -n "${ADDRESS}" ] && DARK_OPTS="${DARK_OPTS} -b ${ADDRESS}" + [ -n "${DAYLOGFILE}" ] && DARK_OPTS="${DARK_OPTS} --daylog ${DAYLOGFILE}" + + return 0 +} + +start() { + chkconfig || return 1 + + # If ${PIDFILE} exist darkstat fails to start + [ -f ${PIDFILE} ] && rm ${PIDFILE} + ebegin "Starting darkstat on ${INTERFACE}" + /sbin/start-stop-daemon --start --exec /usr/sbin/darkstat -- \ + --chroot "${CHROOT:-__CHROOT__}" --pidfile ${PIDFILE} \ + ${DARKSTAT_OPTS} ${DARK_OPTS} -f "${FILTER}" + eend $? +} + +stop() { + ebegin "Stopping darkstat on ${INTERFACE}" + /sbin/start-stop-daemon --stop --pidfile ${PIDFILE} + eend $? +} diff --git a/net-analyzer/darkstat/files/digest-darkstat-3.0.707-r1 b/net-analyzer/darkstat/files/digest-darkstat-3.0.707-r1 new file mode 100644 index 000000000000..4c88a03f54d0 --- /dev/null +++ b/net-analyzer/darkstat/files/digest-darkstat-3.0.707-r1 @@ -0,0 +1,3 @@ +MD5 91c70f96498dd679b21330214361e4dc darkstat-3.0.707.tar.bz2 90459 +RMD160 91a19ef837a58f6b464cc24c4dc34bcb8ef15a59 darkstat-3.0.707.tar.bz2 90459 +SHA256 243bd77f93acbb6832f5ef1cc4b03abe823006c129f88fe5724697e1c0857644 darkstat-3.0.707.tar.bz2 90459 |