diff options
author | Kirill Ponomarev <krion@FreeBSD.org> | 2003-12-08 20:51:57 +0000 |
---|---|---|
committer | Kirill Ponomarev <krion@FreeBSD.org> | 2003-12-08 20:51:57 +0000 |
commit | d838e8fa85b4be166e1a3d71f6ff996ebaa37f20 (patch) | |
tree | a521a039db6385598f70f85f07547c75848cc750 /net-mgmt | |
parent | e9a6149ae60a0cad9c3892bb2111d9ede958793b (diff) | |
download | ports-d838e8fa85b4be166e1a3d71f6ff996ebaa37f20.tar.gz ports-d838e8fa85b4be166e1a3d71f6ff996ebaa37f20.zip |
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/ifgraph/Makefile | 79 | ||||
-rw-r--r-- | net-mgmt/ifgraph/distinfo | 1 | ||||
-rw-r--r-- | net-mgmt/ifgraph/files/crontab.in | 3 | ||||
-rw-r--r-- | net-mgmt/ifgraph/files/patch-find-if.pl | 22 | ||||
-rw-r--r-- | net-mgmt/ifgraph/files/patch-ifgraph.conf | 17 | ||||
-rw-r--r-- | net-mgmt/ifgraph/files/patch-ifgraph.pl | 29 | ||||
-rw-r--r-- | net-mgmt/ifgraph/files/patch-makegraph.pl | 27 | ||||
-rw-r--r-- | net-mgmt/ifgraph/pkg-deinstall | 38 | ||||
-rw-r--r-- | net-mgmt/ifgraph/pkg-descr | 12 | ||||
-rw-r--r-- | net-mgmt/ifgraph/pkg-install | 51 | ||||
-rw-r--r-- | net-mgmt/ifgraph/pkg-message | 32 | ||||
-rw-r--r-- | net-mgmt/ifgraph/pkg-plist | 33 |
12 files changed, 344 insertions, 0 deletions
diff --git a/net-mgmt/ifgraph/Makefile b/net-mgmt/ifgraph/Makefile new file mode 100644 index 000000000000..0a4f31ae28f8 --- /dev/null +++ b/net-mgmt/ifgraph/Makefile @@ -0,0 +1,79 @@ +# New ports collection makefile for: ifgraph +# Date created: Sep 18 2003 +# Whom: Lars Thegler <lars@thegler.dk> +# +# $FreeBSD$ +# + +PORTNAME= ifgraph +PORTVERSION= 0.4.9 +CATEGORIES= net www +MASTER_SITES= http://ifgraph.sourceforge.net/stable/ + +MAINTAINER= lars@thegler.dk +COMMENT= Simple grapher of SNMP data with RRD + +RUN_DEPENDS= rrdtool:${PORTSDIR}/net/rrdtool + +USE_PERL5= yes +NO_BUILD= yes + +PKGMESSAGE= ${WRKDIR}/pkg-message +PKGINSTALL= ${WRKDIR}/pkg-install +PKGDEINSTALL= ${WRKDIR}/pkg-deinstall + +IFGRAPH_USER= ifgraph +IFGRAPH_GROUP= ifgraph + +PLFILES= find-if.pl ifgraph.pl makegraph.pl +DOCFILES= CHANGELOG INSTALACAO INSTALL TODO LICENSE.TXT MUDANCAS + +FILES_SUB= USER=${IFGRAPH_USER} GROUP=${IFGRAPH_GROUP} \ + PREFIX=${PREFIX} DOCSDIR=${DOCSDIR} + +pre-install: + @ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${PKGDIR}/pkg-install > ${PKGINSTALL} + @ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + +do-install: + @ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL} + @ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${PKGDIR}/pkg-message > ${PKGMESSAGE} +.for plfile in ${PLFILES} + @ ${INSTALL_SCRIPT} ${WRKSRC}/${plfile} ${PREFIX}/bin +.endfor + @ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${WRKSRC}/ifgraph.conf > ${WRKSRC}/ifgraph.conf.sample + @ ${INSTALL_DATA} ${WRKSRC}/ifgraph.conf.sample ${PREFIX}/etc + @ ${MKDIR} ${PREFIX}/ifgraph + @ ${MKDIR} ${PREFIX}/ifgraph/htdocs + @ ${CP} -Rp ${WRKSRC}/templates ${PREFIX}/ifgraph + @ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/crontab.in > ${PREFIX}/ifgraph/crontab.in + @ ${CHOWN} -R ifgraph:ifgraph ${PREFIX}/ifgraph + @ ${MKDIR} ${PREFIX}/var/ifgraph + @ ${CHOWN} ifgraph:ifgraph ${PREFIX}/var/ifgraph +.if !defined(NOPORTDOCS) + @ ${MKDIR} ${DOCSDIR} +.for docfile in ${DOCFILES} + @ ${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR} +.endfor +.endif + +post-install: + @ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.if !defined(BATCH) + @ ${CAT} ${PKGMESSAGE} +.endif + +.include <bsd.port.pre.mk> + +.if ${PERL_LEVEL} < 500600 +RUN_DEPENDS+= ${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net/p5-Net-SNMP3 +.else +RUN_DEPENDS+= ${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net/p5-Net-SNMP +.endif + +.include <bsd.port.post.mk> diff --git a/net-mgmt/ifgraph/distinfo b/net-mgmt/ifgraph/distinfo new file mode 100644 index 000000000000..caf4f48156ac --- /dev/null +++ b/net-mgmt/ifgraph/distinfo @@ -0,0 +1 @@ +MD5 (ifgraph-0.4.9.tar.gz) = 9da25053e0aa376e5c7ba5c4e4c48dfa diff --git a/net-mgmt/ifgraph/files/crontab.in b/net-mgmt/ifgraph/files/crontab.in new file mode 100644 index 000000000000..6d856dd91303 --- /dev/null +++ b/net-mgmt/ifgraph/files/crontab.in @@ -0,0 +1,3 @@ +# crontab file for ifGraph +#*/5 * * * * %%PREFIX%%/bin/ifgraph.pl -c %%PREFIX%%/etc/ifgraph.conf > /dev/null +#*/5 * * * * %%PREFIX%%/bin/makegraph.pl -c %%PREFIX%%/etc/ifgraph.conf > /dev/null diff --git a/net-mgmt/ifgraph/files/patch-find-if.pl b/net-mgmt/ifgraph/files/patch-find-if.pl new file mode 100644 index 000000000000..c547871067eb --- /dev/null +++ b/net-mgmt/ifgraph/files/patch-find-if.pl @@ -0,0 +1,22 @@ +--- find-if.pl.orig Sat Sep 20 14:35:38 2003 ++++ find-if.pl Sat Sep 20 14:36:07 2003 +@@ -19,10 +19,6 @@ + #Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org + #Visite: http://www.ifgraph.org + +-# Let's find out where we are +-use FindBin; +-# # Found, now we add it to the @INC +-use lib "$FindBin::Bin/lib"; + # # We are strict + use strict; + # # Get the command line options +@@ -30,7 +26,7 @@ + getopts('adhims'); + + # We just nedd the basic features here +-use Net::SNMP_365; ++use Net::SNMP; + + use vars qw($response $response2 $response3 $response4 $response5 $response6 $response7 $response8 $response9 + $response10 $response11 $response12 $opt_d @ips $ip $mac $opt_a $opt_h $opt_m $opt_i $opt_s $if $desc $stat $ocin diff --git a/net-mgmt/ifgraph/files/patch-ifgraph.conf b/net-mgmt/ifgraph/files/patch-ifgraph.conf new file mode 100644 index 000000000000..9dc20049c6b6 --- /dev/null +++ b/net-mgmt/ifgraph/files/patch-ifgraph.conf @@ -0,0 +1,17 @@ +--- ifgraph.conf.orig Fri Sep 19 19:06:49 2003 ++++ ifgraph.conf Fri Sep 19 19:08:52 2003 +@@ -19,10 +19,10 @@ + # will not work as expected. + + [global] +-rrdtool = /usr/local/bin/rrdtool +-rrddir = /home/someuser/rrdfiles +-graphdir= /home/someuser/public_html/ifgraph-0.4.9 +-template=/home/someuser/ifgraph-0.4.9/templates/en ++rrdtool = %%PREFIX%%/bin/rrdtool ++rrddir = %%PREFIX%%/var/ifgraph ++graphdir = %%PREFIX%%/ifgraph/htdocs ++template = %%PREFIX%%/ifgraph/templates/en + imgformat=PNG + # those are the default configurations, should be + # overriden in each target diff --git a/net-mgmt/ifgraph/files/patch-ifgraph.pl b/net-mgmt/ifgraph/files/patch-ifgraph.pl new file mode 100644 index 000000000000..619831a4e173 --- /dev/null +++ b/net-mgmt/ifgraph/files/patch-ifgraph.pl @@ -0,0 +1,29 @@ +--- ifgraph.pl.orig Sun Sep 28 22:29:51 2003 ++++ ifgraph.pl Sun Sep 28 22:30:19 2003 +@@ -19,10 +19,6 @@ + #Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org + #Visite: http://www.ifgraph.org + +-# Let's find out where we are +-use FindBin; +-# Found, now we add it to the @INC +-use lib "$FindBin::Bin/lib"; + # We are strict + use strict; + # Get the command line options +@@ -32,14 +28,7 @@ + getopt('cltF'); + getopts('dh'); + +-# If the perl is older, we have to fetch the older Net::SNMP library +-if ($] < 5.006) { +- &debug("Warning: Older perl version $], we will use Net::SNMP 3.65\n"); +- require Net::SNMP_365; +-} else { +- &debug("Starting ifgraph 0.4.9 with perl $], Net::SNMP 4.3\n"); +- require Net::SNMP; +-} ++use Net::SNMP; + + # SIGINT call + $SIG{INT}=\&sigint; diff --git a/net-mgmt/ifgraph/files/patch-makegraph.pl b/net-mgmt/ifgraph/files/patch-makegraph.pl new file mode 100644 index 000000000000..045dabe5dfc0 --- /dev/null +++ b/net-mgmt/ifgraph/files/patch-makegraph.pl @@ -0,0 +1,27 @@ +--- makegraph.pl.orig Sun Sep 21 12:30:49 2003 ++++ makegraph.pl Sun Sep 21 12:32:08 2003 +@@ -19,8 +19,6 @@ + #Sugestoes e criticas (sem flames!!) mailto:sartori@ifgraph.org + #Visite: http://www.ifgraph.org + +-use FindBin; +-use lib "$FindBin::Bin/lib"; + use strict; + use Getopt::Std; + use vars qw($opt_d $opt_c $opt_B $opt_b $opt_h $opt_g $opt_t $opt_T $targetindex +@@ -30,14 +28,7 @@ + getopt('ctT'); + getopts('Bbgdh'); + +-# If the perl is older, we have to fetch the older Net::SNMP library +-if ($] < 5.006) { +- &debug("Warning: Older perl version $], we will use Net::SNMP 3.65\n"); +- require Net::SNMP_365; +-} else { +- &debug("Starting ifgraph 0.4.9 with perl $[, Net::SNMP 4.3\n"); +- require Net::SNMP; +-} ++use Net::SNMP; + + # HELP + if (defined($opt_h)) { diff --git a/net-mgmt/ifgraph/pkg-deinstall b/net-mgmt/ifgraph/pkg-deinstall new file mode 100644 index 000000000000..5724a05f20ff --- /dev/null +++ b/net-mgmt/ifgraph/pkg-deinstall @@ -0,0 +1,38 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +PATH=/bin:/usr/bin:/usr/sbin + +case $2 in + +DEINSTALL) + echo '---> Starting deinstall script:' + + echo '---> Zeroing crontab(5) file belonging to user "%%USER%%"' + /usr/bin/crontab -u %%USER%% /dev/null + echo ' (The crontab(5) will be deleted completely when user "%%USER%%" is removed.)' + + ;; + +POST-DEINSTALL) + echo '---> Starting post-deinstall script:' + + if [ -f %%PREFIX%%/etc/ifgraph.conf -o \ + -d %%PREFIX%%/ifgraph -o \ + -d %%PREFIX%%/var/ifgraph ]; then + echo '---> You seem to have made some custom ifGraph configuration.' + echo '---> - The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.' + echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".' + + else + echo '---> Removing group "%%GROUP%%"' + /usr/sbin/pw groupdel -n %%GROUP%% + echo '---> Removing user "%%USER%%"' + echo 'y' | /usr/sbin/pw userdel -n %%USER%% + fi + + ;; + +esac diff --git a/net-mgmt/ifgraph/pkg-descr b/net-mgmt/ifgraph/pkg-descr new file mode 100644 index 000000000000..bf4ea780360d --- /dev/null +++ b/net-mgmt/ifgraph/pkg-descr @@ -0,0 +1,12 @@ +ifGraph is a set of Perl scripts created to help network administrators +to visualize network flow on a daily, weekly, monthly, and yearly basis. +The graphics are created with RRDTool, and it shows bytes (in/out) and +errors for each interface. It also shows the current/average/max use and +the respective link/interface usage in percentages. The program also +outputs HTML files to make the visualization of the PNG/GIF/GD images +more friendly and easy. + +WWW: http://www.ifgraph.org + +- Lars Thegler +lars@thegler.dk diff --git a/net-mgmt/ifgraph/pkg-install b/net-mgmt/ifgraph/pkg-install new file mode 100644 index 000000000000..98d6edc4c506 --- /dev/null +++ b/net-mgmt/ifgraph/pkg-install @@ -0,0 +1,51 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +PATH=/bin:/usr/bin:/usr/sbin + +case $2 in + +PRE-INSTALL) + echo "---> Starting pre-install script:" + + if [ -z "%%USER%%" -o \ + -z "%%GROUP%%" ]; then + echo "ERROR: A required pragma was empty" + exit 1 + fi + + if pw showgroup "%%GROUP%%" 2>/dev/null; then + echo "---> Using existing group \"%%GROUP%%\"" + else + echo "---> Adding group \"%%GROUP%%\"" + pw addgroup %%GROUP%% -h - || exit 1 + fi + + # Create user if required + if pw showuser "%%USER%%" 2>/dev/null; then + echo "---> Using existing user \"%%USER%%\"" + else + echo "---> Adding user \"%%USER%%\"" + pw adduser %%USER%% -g %%GROUP%% -h - \ + -s "/sbin/nologin" -c "ifGraph User" || exit 1 + fi + + ;; + +POST-INSTALL) + echo "---> Starting post-install script:" + + if [ -z "%%USER%%" -o \ + -z "%%PREFIX%%" ]; then + echo "ERROR: A required pragma was empty" + exit 1 + fi + + echo "---> Creating crontab(5) file for user \"%%USER%%\"" + crontab -u "%%USER%%" "%%PREFIX%%/ifgraph/crontab.in" || exit 1 + + ;; + +esac diff --git a/net-mgmt/ifgraph/pkg-message b/net-mgmt/ifgraph/pkg-message new file mode 100644 index 000000000000..043a08c75042 --- /dev/null +++ b/net-mgmt/ifgraph/pkg-message @@ -0,0 +1,32 @@ +================================================================= + +ifGraph has now been installed in %%PREFIX%%/ifgraph/. + +NOTE: A sample configuration files has been placed at: + + %%PREFIX%%/etc/ifgraph.conf.sample + +You need to copy this to + + %%PREFIX%%/etc/ifgraph.conf + +and edit it to suit your requirements. + +A sample crontab(5) entry has been installed. You need to activate +this to start measurements and graph generation. You can do this +with + + crontab -u ifgraph -e + +Documentation is installed in + + %%DOCSDIR%%/ + +To enable Apache web access, add the following to your +%%PREFIX%%/etc/apache/httpd.conf: + + Alias /ifgraph/ %%PREFIX%%/ifgraph/htdocs/ + +Enjoy! + +================================================================= diff --git a/net-mgmt/ifgraph/pkg-plist b/net-mgmt/ifgraph/pkg-plist new file mode 100644 index 000000000000..af0d537080fc --- /dev/null +++ b/net-mgmt/ifgraph/pkg-plist @@ -0,0 +1,33 @@ +@exec mkdir -p %D/ifgraph/htdocs +@exec mkdir -p %D/var/ifgraph +@exec chown ifgraph:ifgraph %D/var/ifgraph +bin/find-if.pl +bin/ifgraph.pl +bin/makegraph.pl +etc/ifgraph.conf.sample +ifgraph/crontab.in +ifgraph/templates/ifgraph-logo.jpg +ifgraph/templates/en/main-header.html +ifgraph/templates/en/if-data.html +ifgraph/templates/en/if-header.html +ifgraph/templates/en/if-trailer.html +ifgraph/templates/en/main-data.html +ifgraph/templates/en/main-trailer.html +ifgraph/templates/pt-br/main-header.html +ifgraph/templates/pt-br/if-data.html +ifgraph/templates/pt-br/if-header.html +ifgraph/templates/pt-br/if-trailer.html +ifgraph/templates/pt-br/main-data.html +ifgraph/templates/pt-br/main-trailer.html +@dirrm ifgraph/templates/en/ +@dirrm ifgraph/templates/pt-br/ +@dirrm ifgraph/templates +@unexec rmdir %D/ifgraph 2>/dev/null || true +@unexec rmdir %D/var/ifgraph 2>/dev/null || true +%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG +%%PORTDOCS%%%%DOCSDIR%%/INSTALACAO +%%PORTDOCS%%%%DOCSDIR%%/INSTALL +%%PORTDOCS%%%%DOCSDIR%%/TODO +%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TXT +%%PORTDOCS%%%%DOCSDIR%%/MUDANCAS +%%PORTDOCS%%@dirrm %%DOCSDIR%% |