summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2020-07-03 11:17:32 +0200
committerJeroen Roovers <jer@gentoo.org>2020-07-03 11:55:02 +0200
commit77ef284cc14f41f8cf32cb1122822d2c8cad7716 (patch)
tree743c9243a27a80dcd37664a8713a132b1a3b65f1
parentnet-analyzer/darkstat: Really disable debug (diff)
downloadgentoo-77ef284cc14f41f8cf32cb1122822d2c8cad7716.tar.gz
gentoo-77ef284cc14f41f8cf32cb1122822d2c8cad7716.tar.bz2
gentoo-77ef284cc14f41f8cf32cb1122822d2c8cad7716.zip
net-analyzer/darkstat: Add live ebuild
Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Jeroen Roovers <jer@gentoo.org>
-rw-r--r--net-analyzer/darkstat/darkstat-9999999.ebuild73
1 files changed, 73 insertions, 0 deletions
diff --git a/net-analyzer/darkstat/darkstat-9999999.ebuild b/net-analyzer/darkstat/darkstat-9999999.ebuild
new file mode 100644
index 00000000000..a22c4018efb
--- /dev/null
+++ b/net-analyzer/darkstat/darkstat-9999999.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools git-r3 user
+
+DESCRIPTION="Network traffic analyzer with cute web interface"
+HOMEPAGE="https://unix4lyfe.org/darkstat/"
+EGIT_REPO_URI="https://www.unix4lyfe.org/git/darkstat"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+
+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 )
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.719-strncpy-off-by-one.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e '/-DNDEBUG/d' \
+ -e 's|-flto||g' \
+ configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --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}\""
+}