summaryrefslogtreecommitdiff
path: root/net-analyzer/darkstat
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/darkstat
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/darkstat')
-rw-r--r--net-analyzer/darkstat/Manifest7
-rw-r--r--net-analyzer/darkstat/darkstat-3.0.719.ebuild69
-rw-r--r--net-analyzer/darkstat/files/darkstat-confd27
-rw-r--r--net-analyzer/darkstat/files/darkstat-initd58
-rw-r--r--net-analyzer/darkstat/metadata.xml13
5 files changed, 174 insertions, 0 deletions
diff --git a/net-analyzer/darkstat/Manifest b/net-analyzer/darkstat/Manifest
new file mode 100644
index 000000000000..d3ee26560ddc
--- /dev/null
+++ b/net-analyzer/darkstat/Manifest
@@ -0,0 +1,7 @@
+AUX darkstat-confd 906 SHA256 428e5570b02cd3515949a65bee4d92b22e492435e7833b108fd67aab218eaeed SHA512 7cde9c8637ba34688f6da846017ace8feb832b90264a07d5a9f232b8edd0006aec5cee1c609f3a3489a7942fe0ea5666070ea9827a0818bb15c705b865035377 WHIRLPOOL 1b2030bceb88ea6ed6c7e37fe76bd95b4e7cac71f6b5447b25d914f09607c969e65a928a2b9e0f9898aa60755489a2619cd61bb9e8d6e88e7462a627fcb5a050
+AUX darkstat-initd 1461 SHA256 f2a02312602a18d27f9f9e11844fc26b75bb23728dc3c0ffd7302cc171bf6bcc SHA512 2441b9c7dfa0c3ddb8a5ab6fd396d42a1ae4cb84ac15477c932f719ccfae53179ae5bd3ac947f6a98ee14728c7f31bbc176887c144ed4f5053632aad262d8226 WHIRLPOOL 22906d9edb5dc109b0975d6df61e228de48ebd730e57f84cb3a89c8663841616e910015fbf308cbc7059da9748117add7f58dad1ced6fe986a3f85fc3d937795
+DIST darkstat-3.0.719.tar.bz2 117695 SHA256 aeaf909585f7f43dc032a75328fdb62114e58405b06a92a13c0d3653236dedd7 SHA512 264f6c5f862745fbfb5d125aae5a319369f028fd7be96cfb12775147f528a36b7f5a42bcd6434f2d376933292364641f2ec9cd9bdb1fe105f5a905e331181f98 WHIRLPOOL 95fc7c383bd814bbf6ff022d97df839eeaeafffb75b2c9bdb5b833d9bc7abfabaded5a1c5d145f5f1c5a4f45566e442f060a91ee4366a20ac096ad6fb4e09520
+EBUILD darkstat-3.0.719.ebuild 1716 SHA256 c2f387356726b47686e3a41c259bc996a4c6442f1c3ab5d070749af1b2b62a1a SHA512 4d87e77b8970c3d1458278904fcae84ed4c350f077b18a7a4ccc341c52ada60a60728e68f426d30d796bfc533faca21ec7a00ef7aee38d0b9de75c215db5b1f1 WHIRLPOOL 6c7caf10c820fff5daef5f77abec7d02e3f65018df41e3f603e247d7e7dd00e856e89cfcd0f6e5410776a35d87d9d9c9f84bca347ffdab83779d773e00205258
+MISC ChangeLog 2675 SHA256 f95fe2b7f96b2208b0d4e6576b01d7e3649506e1d6c3b08aff403458072bff19 SHA512 9d4079de27fffd61f7be5079eef1e8d79c49be7f24cae98cbba8351c47ea5adfd7ea6a07ca8c29b775279469aa39638f2e6f8c1da7e0052753b8cf61c5a70aed WHIRLPOOL 9fdf338df44e90efd86287826f8acdd572a5abf56d0081f2b759fa8a6905e932380475284f3f6ce6fb0f38d5a2815bed53fed1ffa7d85c3a0c7d09b8d0a86998
+MISC ChangeLog-2015 9724 SHA256 da3bf063c83450d56976cd861b10c58283bd447ad6f105aa81711113537d43c7 SHA512 df8f6dde3d8dbf000e3c3bad867e709839d25117a7aa4862a50550bbb205e1e0adc97620986a02019aa68b4af0d95ceb6755342f4ae571c36367d41f147e74b2 WHIRLPOOL 1694b7c9904f11129cddab9d473dbe6d35cc61003114610684beae191ffe327fe8485ec5859582b4af760964d89c7a8961c1510363d4f4d41720bda4df34a154
+MISC metadata.xml 536 SHA256 942031dd73b55af835b0c44adea00eb267e5a762c39cb7c61da5750d8cd31b0f SHA512 5950789030e76ea0a95fbf8cd53e702ee8d55af96ed12aef4d6e6ae658ba01e949f875283a2f5c0c12f15fe7beec18704bf14bea1d89c5321df505cd2ae3d5bb WHIRLPOOL 32f5c29a5016dbc6542f53d5b99b69e91ee40f94b52b38b620c0c3165af6bff17dd3be7ee4fc859eae6acf233b4c6bf367e4f22025f1cb60e333180c8c09ea99
diff --git a/net-analyzer/darkstat/darkstat-3.0.719.ebuild b/net-analyzer/darkstat/darkstat-3.0.719.ebuild
new file mode 100644
index 000000000000..f5aeaed6f71a
--- /dev/null
+++ b/net-analyzer/darkstat/darkstat-3.0.719.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools user
+
+DESCRIPTION="Network traffic analyzer with cute web interface"
+HOMEPAGE="http://unix4lyfe.org/darkstat/"
+SRC_URI="http://unix4lyfe.org/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+
+DEPEND="
+ dev-libs/libbsd
+ net-libs/libpcap
+ sys-libs/zlib
+"
+RDEPEND="
+ ${DEPEND}
+"
+
+DARKSTAT_CHROOT_DIR=${DARKSTAT_CHROOT_DIR:-/var/lib/darkstat}
+
+DOCS=( AUTHORS ChangeLog README NEWS )
+
+src_prepare() {
+ default
+
+ sed -i -e 's|-flto||g' configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-debug --with-privdrop-user=darkstat
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/darkstat-initd darkstat
+ newconfd "${FILESDIR}"/darkstat-confd darkstat
+
+ sed -i -e "s:__CHROOT__:${DARKSTAT_CHROOT_DIR}:g" "${D}"/etc/conf.d/darkstat || die
+ sed -i -e "s:__CHROOT__:${DARKSTAT_CHROOT_DIR}:g" "${D}"/etc/init.d/darkstat || die
+
+ keepdir "${DARKSTAT_CHROOT_DIR}"
+ chown darkstat:0 "${D}${DARKSTAT_CHROOT_DIR}"
+}
+
+pkg_preinst() {
+ enewuser darkstat
+}
+
+pkg_postinst() {
+ # Workaround bug #141619
+ DARKSTAT_CHROOT_DIR=`sed -n 's/^#CHROOT=\(.*\)/\1/p' "${ROOT}"etc/conf.d/darkstat`
+ chown darkstat:0 "${ROOT}${DARKSTAT_CHROOT_DIR}"
+
+ 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: \"${ROOT}${DARKSTAT_CHROOT_DIR}\""
+}
diff --git a/net-analyzer/darkstat/files/darkstat-confd b/net-analyzer/darkstat/files/darkstat-confd
new file mode 100644
index 000000000000..3d95a0461a06
--- /dev/null
+++ b/net-analyzer/darkstat/files/darkstat-confd
@@ -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-initd b/net-analyzer/darkstat/files/darkstat-initd
new file mode 100644
index 000000000000..c362251dadc8
--- /dev/null
+++ b/net-analyzer/darkstat/files/darkstat-initd
@@ -0,0 +1,58 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+IF=${SVCNAME##*.}
+
+if [ -n "${IF}" -a "${SVCNAME}" != "darkstat" ] ; then
+ PIDFILE=/run/darkstat.${IF}.pid
+else
+ PIDFILE=/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/metadata.xml b/net-analyzer/darkstat/metadata.xml
new file mode 100644
index 000000000000..c289cc9010db
--- /dev/null
+++ b/net-analyzer/darkstat/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>netmon@gentoo.org</email>
+ <name>Gentoo network monitoring and analysis project</name>
+ </maintainer>
+ <longdescription lang="en">
+ darkstat is a network statistics gatherer. It's a packet sniffer that
+ runs as a background process on a cable/DSL router, gathers all sorts of
+ statistics about network usage, and serves them over HTTP.
+ </longdescription>
+</pkgmetadata>