summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Walker <ka0ttic@gentoo.org>2005-01-26 10:35:05 +0000
committerAaron Walker <ka0ttic@gentoo.org>2005-01-26 10:35:05 +0000
commit1b23835cc7141c3114ba21c90435e258345c67e2 (patch)
treea177167784e5888cec1386ef4aa9f53f485285fa /net-analyzer/mrtg
parentadded local use flag ffmpeg for media-video/kino (diff)
downloadgentoo-2-1b23835cc7141c3114ba21c90435e258345c67e2.tar.gz
gentoo-2-1b23835cc7141c3114ba21c90435e258345c67e2.tar.bz2
gentoo-2-1b23835cc7141c3114ba21c90435e258345c67e2.zip
New and improved init script with conf.d config.
(Portage version: 2.0.51-r15)
Diffstat (limited to 'net-analyzer/mrtg')
-rw-r--r--net-analyzer/mrtg/ChangeLog7
-rw-r--r--net-analyzer/mrtg/Manifest13
-rw-r--r--net-analyzer/mrtg/files/mrtg.confd17
-rw-r--r--net-analyzer/mrtg/files/mrtg.rc65
-rw-r--r--net-analyzer/mrtg/mrtg-2.10.14.ebuild5
-rw-r--r--net-analyzer/mrtg/mrtg-2.10.15.ebuild5
-rw-r--r--net-analyzer/mrtg/mrtg-2.11.0.ebuild5
-rw-r--r--net-analyzer/mrtg/mrtg-2.11.1.ebuild33
8 files changed, 91 insertions, 59 deletions
diff --git a/net-analyzer/mrtg/ChangeLog b/net-analyzer/mrtg/ChangeLog
index dcbda60a1413..4c1040d66ca2 100644
--- a/net-analyzer/mrtg/ChangeLog
+++ b/net-analyzer/mrtg/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-analyzer/mrtg
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/ChangeLog,v 1.32 2005/01/05 23:25:01 swtaylor Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/ChangeLog,v 1.33 2005/01/26 10:35:05 ka0ttic Exp $
+
+ 26 Jan 2005; Aaron Walker <ka0ttic@gentoo.org> +files/mrtg.confd,
+ files/mrtg.rc, mrtg-2.10.14.ebuild, mrtg-2.10.15.ebuild,
+ mrtg-2.11.0.ebuild, mrtg-2.11.1.ebuild:
+ New and improved init script with conf.d config.
*mrtg-2.11.1 (05 Jan 2005)
diff --git a/net-analyzer/mrtg/Manifest b/net-analyzer/mrtg/Manifest
index 81454e281136..be32c225ea81 100644
--- a/net-analyzer/mrtg/Manifest
+++ b/net-analyzer/mrtg/Manifest
@@ -1,13 +1,14 @@
MD5 2a638f1afd9ac1de2201d52898ba34ea mrtg-2.9.22.ebuild 1003
-MD5 6cbbbf387c2e06bc8569636d09a7de3a mrtg-2.10.15.ebuild 1048
-MD5 cba36dd2c738431d3750471fd0061fdb mrtg-2.11.0.ebuild 1051
-MD5 47c2ebd48ba10097c4fa099098bb1320 mrtg-2.10.14.ebuild 1034
-MD5 3b6522906bd95f08c980b8661daf407c ChangeLog 3944
+MD5 bea84668fcb0ee2a61e432725275a1ce mrtg-2.10.15.ebuild 1068
+MD5 6cbd983a0a045ee78d9fe2f552f5ab6e mrtg-2.11.0.ebuild 1071
+MD5 a9bc82ece003306b2672f5a73c43f92f mrtg-2.10.14.ebuild 1054
+MD5 965aa448f460a05d328dd434151ef700 ChangeLog 4165
MD5 9683bb7323c40d69b48d54ad0eb169ed metadata.xml 221
-MD5 dc4d0a127e39bbb6976e7978b76b9511 mrtg-2.11.1.ebuild 1051
+MD5 cd3fee8e76941a3842d18b0bb708a536 mrtg-2.11.1.ebuild 994
MD5 600205c986160fe48cd6053e39f74644 files/digest-mrtg-2.11.0 64
MD5 892b30d2bab4ab965453b5bef89cfecb files/digest-mrtg-2.11.1 64
MD5 b984863c1e7c00e4a0829e901c6cc492 files/digest-mrtg-2.9.22 64
MD5 85c2c5bcbc07346b4d167bc4ebe4ba9a files/digest-mrtg-2.10.14 65
MD5 99d47668bd56ffee8a76da73dfcdf81c files/digest-mrtg-2.10.15 65
-MD5 351ec1843842936c6540a80df17546c3 files/mrtg.rc 1202
+MD5 9d9b600f92587a4f94f30410a95a28b0 files/mrtg.rc 1282
+MD5 0ad895310585fe18aabcfb5a0a605aac files/mrtg.confd 415
diff --git a/net-analyzer/mrtg/files/mrtg.confd b/net-analyzer/mrtg/files/mrtg.confd
new file mode 100644
index 000000000000..f3be157baf08
--- /dev/null
+++ b/net-analyzer/mrtg/files/mrtg.confd
@@ -0,0 +1,17 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/files/mrtg.confd,v 1.1 2005/01/26 10:35:05 ka0ttic Exp $
+
+MRTG_CONF="/etc/mrtg.conf"
+MRTG_PID="/var/run/mrtg.pid"
+
+# uncomment and set the following, if you'd like to run mrtg as a
+# different user/group
+#MRTG_USER=""
+#MRTG_GROUP=""
+
+# uncomment if you'd like to enable logging
+#MRTG_LOG="/var/log/mrtg.log"
+
+# set any extra options here
+MRTG_OPTS=""
diff --git a/net-analyzer/mrtg/files/mrtg.rc b/net-analyzer/mrtg/files/mrtg.rc
index c04ef8741d9f..820f22a5bb37 100644
--- a/net-analyzer/mrtg/files/mrtg.rc
+++ b/net-analyzer/mrtg/files/mrtg.rc
@@ -1,20 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2003 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/files/mrtg.rc,v 1.1 2004/07/03 03:29:25 squinky86 Exp $
-
-# This runscript is for those who want to use the RunAsDaemon:Yes
-# option for MRTG instead of launching it from a cron job.
-
-
-# Set the following variables for your setup
-
-MRTGPREFIX=/usr/bin
-MRTGCONF=/etc/mrtg.conf
-# pid file defaults to same dir as config file (edit $MRTGPREFIX/mrtg)
-# if you don't like it.
-MRTGPID=/etc/mrtg.pid
-
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/files/mrtg.rc,v 1.2 2005/01/26 10:35:05 ka0ttic Exp $
depend() {
need net
@@ -24,24 +11,42 @@ depend() {
}
checkconfig() {
- if [ ! -f $MRTGCONF ] ; then
- eerror "Please create $MRTGCONF (try man cfgmaker)"
- eerror "Make sure you use RunAsDaemon:Yes"
- return 1
- fi
- return 0
+ if [[ ! -f ${MRTG_CONF} ]] ; then
+ eerror "Please create ${MRTG_CONF} (try man cfgmaker)"
+ return 1
+ fi
+
+ mrtg --check ${MRTG_CONF}
+ return $?
}
start() {
- checkconfig || return $?
- ebegin "Starting mrtg"
- start-stop-daemon --start --quiet --pidfile $MRTGPID \
- --startas $MRTGPREFIX/mrtg $MRTGCONF
- eend $? "Failed to start mrtg"
+ # mrtg will not run if LANG=*utf8
+ [[ "${LANG}" == *[uU][tT][fF]8 ]] && LANG='C'
+
+ checkconfig || return $?
+
+ # enable logging?
+ [[ -n "${MRTG_LOG}" ]] && \
+ MRTG_OPTS="${MRTG_OPTS} --logging ${MRTG_LOG}"
+
+ # run as a different user?
+ [[ -n "${MRTG_USER}" ]] && \
+ MRTG_OPTS="${MRTG_OPTS} --user ${MRTG_USER}"
+
+ # run as a different group?
+ [[ -n "${MRTG_GROUP}" ]] && \
+ MRTG_OPTS="${MRTG_OPTS} --group ${MRTG_GROUP}"
+
+ ebegin "Starting mrtg"
+ start-stop-daemon --start --quiet --pidfile ${MRTG_PID} \
+ --exec /usr/bin/mrtg -- --daemon --pid-file=${MRTG_PID} \
+ ${MRTG_OPTS} ${MRTG_CONF} >/dev/null
+ eend $? "Failed to start mrtg"
}
-
+
stop() {
- ebegin "Stopping mrtg"
- start-stop-daemon --stop --quiet --pidfile $MRTGPID
- eend $? "Failed to stop mrtg"
+ ebegin "Stopping mrtg"
+ start-stop-daemon --stop --quiet --pidfile ${MRTG_PID}
+ eend $? "Failed to stop mrtg"
}
diff --git a/net-analyzer/mrtg/mrtg-2.10.14.ebuild b/net-analyzer/mrtg/mrtg-2.10.14.ebuild
index 182e4b7aba6a..738b6973db48 100644
--- a/net-analyzer/mrtg/mrtg-2.10.14.ebuild
+++ b/net-analyzer/mrtg/mrtg-2.10.14.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.10.14.ebuild,v 1.9 2005/01/05 23:25:01 swtaylor Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.10.14.ebuild,v 1.10 2005/01/26 10:35:05 ka0ttic Exp $
DESCRIPTION="A tool to monitor the traffic load on network-links"
HOMEPAGE="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/"
@@ -30,5 +30,6 @@ src_install () {
cp -a contrib ${D}/usr/share/doc/${PF}/contrib
prepalldocs
docinto html ; dohtml -r doc/*.html images/*
- exeinto /etc/init.d ; newexe ${FILESDIR}/mrtg.rc mrtg
+ newinitd ${FILESDIR}/mrtg.rc ${PN}
+ newconfd ${FILESDIR}/mrtg.confd ${PN}
}
diff --git a/net-analyzer/mrtg/mrtg-2.10.15.ebuild b/net-analyzer/mrtg/mrtg-2.10.15.ebuild
index ba2525da4dd8..75ce3d2e83b9 100644
--- a/net-analyzer/mrtg/mrtg-2.10.15.ebuild
+++ b/net-analyzer/mrtg/mrtg-2.10.15.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.10.15.ebuild,v 1.8 2005/01/05 23:25:01 swtaylor Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.10.15.ebuild,v 1.9 2005/01/26 10:35:05 ka0ttic Exp $
DESCRIPTION="A tool to monitor the traffic load on network-links"
HOMEPAGE="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/"
@@ -30,5 +30,6 @@ src_install () {
cp -a contrib ${D}/usr/share/doc/${PF}/contrib
prepalldocs
docinto html ; dohtml -r doc/*.html images/*
- exeinto /etc/init.d ; newexe ${FILESDIR}/mrtg.rc mrtg
+ newinitd ${FILESDIR}/mrtg.rc ${PN}
+ newconfd ${FILESDIR}/mrtg.confd ${PN}
}
diff --git a/net-analyzer/mrtg/mrtg-2.11.0.ebuild b/net-analyzer/mrtg/mrtg-2.11.0.ebuild
index fd9037c374e5..402e4f05cf40 100644
--- a/net-analyzer/mrtg/mrtg-2.11.0.ebuild
+++ b/net-analyzer/mrtg/mrtg-2.11.0.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.11.0.ebuild,v 1.2 2005/01/05 23:25:01 swtaylor Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.11.0.ebuild,v 1.3 2005/01/26 10:35:05 ka0ttic Exp $
DESCRIPTION="A tool to monitor the traffic load on network-links"
HOMEPAGE="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/"
@@ -30,5 +30,6 @@ src_install () {
cp -a contrib ${D}/usr/share/doc/${PF}/contrib
prepalldocs
docinto html ; dohtml -r doc/*.html images/*
- exeinto /etc/init.d ; newexe ${FILESDIR}/mrtg.rc mrtg
+ newinitd ${FILESDIR}/mrtg.rc ${PN}
+ newconfd ${FILESDIR}/mrtg.confd ${PN}
}
diff --git a/net-analyzer/mrtg/mrtg-2.11.1.ebuild b/net-analyzer/mrtg/mrtg-2.11.1.ebuild
index 0ad2e8ba28e0..c7b1bc943527 100644
--- a/net-analyzer/mrtg/mrtg-2.11.1.ebuild
+++ b/net-analyzer/mrtg/mrtg-2.11.1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.11.1.ebuild,v 1.1 2005/01/05 23:25:01 swtaylor Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.11.1.ebuild,v 1.2 2005/01/26 10:35:05 ka0ttic Exp $
DESCRIPTION="A tool to monitor the traffic load on network-links"
HOMEPAGE="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/"
@@ -9,26 +9,27 @@ SRC_URI="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/pub/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~ppc ~sparc ~ppc64 ~amd64 ~alpha"
-IUSE=""
+IUSE="doc"
DEPEND="virtual/libc
dev-lang/perl
>=media-libs/gd-1.8.4"
-src_compile() {
- ./configure --prefix=/usr --host=${CHOST} || die
- emake || die
-}
-
src_install () {
- make prefix=${D}/usr install || die
- dodir /usr/share/man
- mv ${D}/usr/man/man1 ${D}/usr/share/man
- rm -rf ${D}/usr/{man,doc}
+ keepdir /var/lib/mrtg
+
+ make DESTDIR="${D}" install || die "make install failed"
+ rm -fr ${D}/usr/share/doc/mrtg2
+
+ newinitd ${FILESDIR}/mrtg.rc ${PN}
+ newconfd ${FILESDIR}/mrtg.confd ${PN}
+
dodoc ANNOUNCE COPYING CHANGES COPYRIGHT MANIFEST README THANKS
- docinto txt ; dodoc doc/*.txt
- cp -a contrib ${D}/usr/share/doc/${PF}/contrib
- prepalldocs
- docinto html ; dohtml -r doc/*.html images/*
- exeinto /etc/init.d ; newexe ${FILESDIR}/mrtg.rc mrtg
+
+ if use doc ; then
+ docinto txt ; dodoc doc/*.txt
+ cp -a contrib ${D}/usr/share/doc/${PF}/contrib
+ prepalldocs
+ dohtml -r doc/*.html images/*
+ fi
}