From a8123dcc21328e9144acb1fdd81f821aab480a03 Mon Sep 17 00:00:00 2001 From: brad Date: Tue, 27 Apr 1999 19:25:27 +0000 Subject: [PATCH] - upgrade to mrtg 2.7.4b - add INSTALL and DEINSTALL scripts --- net/mrtg/Makefile | 24 ++++---------- net/mrtg/files/md5 | 6 ++-- net/mrtg/pkg/DEINSTALL | 28 ++++++++++++++++ net/mrtg/pkg/INSTALL | 72 ++++++++++++++++++++++++++++++++++++++++++ net/mrtg/pkg/PLIST | 7 ---- 5 files changed, 109 insertions(+), 28 deletions(-) create mode 100644 net/mrtg/pkg/DEINSTALL create mode 100644 net/mrtg/pkg/INSTALL diff --git a/net/mrtg/Makefile b/net/mrtg/Makefile index bc4721be169..b261d01ba94 100644 --- a/net/mrtg/Makefile +++ b/net/mrtg/Makefile @@ -1,18 +1,16 @@ -# $OpenBSD: Makefile,v 1.8 1999/04/22 15:53:26 brad Exp $ +# $OpenBSD: Makefile,v 1.9 1999/04/27 19:25:27 brad Exp $ -DISTNAME= mrtg-2.7.3b +DISTNAME= mrtg-2.7.4b CATEGORIES= net MASTER_SITES= http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/pub/ +HOMEPAGE= http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html NEED_VERSION= 1.73 MAINTAINER= brad@openbsd.org -HOMEPAGE= http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html BUILD_DEPENDS= ${PREFIX}/lib/libgd.a:${PORTSDIR}/graphics/gd -USE_PERL5= yes - GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-gd-lib=${PREFIX}/lib --with-gd-inc=${PREFIX}/include/gd @@ -33,19 +31,9 @@ do-install: ${INSTALL_SCRIPT} ${WRKSRC}/run/BER.pm ${PREFIX}/lib/mrtg ${INSTALL_SCRIPT} ${WRKSRC}/run/SNMP_Session.pm ${PREFIX}/lib/mrtg ${INSTALL_SCRIPT} ${WRKSRC}/run/SNMP_util.pm ${PREFIX}/lib/mrtg - cp ${PREFIX}/lib/mrtg/BER.pm /usr/lib/perl5/site_perl - cp ${PREFIX}/lib/mrtg/SNMP_Session.pm /usr/lib/perl5/site_perl - cp ${PREFIX}/lib/mrtg/SNMP_util.pm /usr/lib/perl5/site_perl ${INSTALL_DATA} ${WRKSRC}/doc/sample-mrtg.cfg ${PREFIX}/lib/mrtg/mrtg.cfg.sample - @${ECHO} "" - @${ECHO} "*** The latest sample config file" - @${ECHO} "*** can be found in ${PREFIX}/lib/mrtg" - @if [ -f /etc/mrtg.cfg ]; then \ - ${ECHO} "*** Your /etc/mrtg.cfg has NOT been changed"; \ - else \ - cp ${PREFIX}/lib/mrtg/mrtg.cfg.sample /etc/mrtg.cfg; \ - ${ECHO} "*** mrtg.cfg has been copied into /etc"; \ - fi - @${ECHO} "" + +post-install: + @PKG_PREFIX="${PREFIX}" ${SH} ${PKGDIR}/INSTALL ${DISTNAME} POST-INSTALL .include diff --git a/net/mrtg/files/md5 b/net/mrtg/files/md5 index c343cf06211..99c498fe05f 100644 --- a/net/mrtg/files/md5 +++ b/net/mrtg/files/md5 @@ -1,3 +1,3 @@ -MD5 (mrtg-2.7.3b.tar.gz) = d5a342c28347f231a70054347bd5fc42 -RMD160 (mrtg-2.7.3b.tar.gz) = 4ee194dbf348e04cf09369a97d78bc466af725ee -SHA1 (mrtg-2.7.3b.tar.gz) = 7fd3c21ffbfdba3adeb802b121fc0c88688372a4 +MD5 (mrtg-2.7.4b.tar.gz) = 2f30710aa9668097e4a93820cdbd3df4 +RMD160 (mrtg-2.7.4b.tar.gz) = 8c745ed74d4139f3a86442742d39248cfca900f4 +SHA1 (mrtg-2.7.4b.tar.gz) = b7cfae3e86b09283a2c3fd9252771ac6f8390ffa diff --git a/net/mrtg/pkg/DEINSTALL b/net/mrtg/pkg/DEINSTALL new file mode 100644 index 00000000000..ba98c58cddf --- /dev/null +++ b/net/mrtg/pkg/DEINSTALL @@ -0,0 +1,28 @@ +# $OpenBSD: DEINSTALL,v 1.1 1999/04/27 19:25:27 brad Exp $ +# +# mrtg de-installation + +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_FILE=/etc/mrtg.cfg + +rm -f /usr/lib/perl5/site_perl/BER.pm +rm -f /usr/lib/perl5/site_perl/SNMP_Session.pm +rm -f /usr/lib/perl5/site_perl/SNMP_util.pm + +if [ -f ${CONFIG_FILE} ]; then + echo + echo "+---------------" + echo "| To completely deinstall the $1 package you need to perform" + echo "| this step as root:" + echo "|" + echo "| rm -f ${CONFIG_FILE}" + echo "|" + echo "| Do not do this if you plan on re-installing $1" + echo "| at some future time." + echo "+---------------" + echo +fi + +exit 0 diff --git a/net/mrtg/pkg/INSTALL b/net/mrtg/pkg/INSTALL new file mode 100644 index 00000000000..07fe98beef4 --- /dev/null +++ b/net/mrtg/pkg/INSTALL @@ -0,0 +1,72 @@ +#!/bin/sh +# $OpenBSD: INSTALL,v 1.1 1999/04/27 19:25:27 brad Exp $ +# +# Pre/post-installation setup of mrtg + +# exit on errors, use a sane path and install prefix +# +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_FILE=/etc/mrtg.cfg + +cp ${PREFIX}/lib/mrtg/BER.pm /usr/lib/perl5/site_perl +cp ${PREFIX}/lib/mrtg/SNMP_Session.pm /usr/lib/perl5/site_perl +cp ${PREFIX}/lib/mrtg/SNMP_util.pm /usr/lib/perl5/site_perl + +# Function: tell the user what s/he needs to do to use the port just installed +# +do_notice() +{ + echo + echo "+---------------" + echo "| The existing $1 configuration file, ${CONFIG_FILE}," + echo "| has NOT been changed. You may want to compare it to the" + echo "| current sample file, ${PREFIX}/lib/mrtg/mrtg.cfg.sample," + echo "| and update your configuration as needed." + echo "+---------------" + echo +} + +# Function: install the system mrtg.cfg from the sample +# +do_install() +{ + cp ${PREFIX}/lib/mrtg/mrtg.cfg.sample ${CONFIG_FILE} + echo + echo "+---------------" + echo "| The $1 configuration file, ${CONFIG_FILE}," + echo "| has been installed. Please view this file and change" + echo "| the configuration to meet your needs" + echo "+---------------" + echo + +} + +# verify proper execution +# +if [ $# -ne 2 ]; then + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 +fi + +# Verify/process the command +# +case $2 in + PRE-INSTALL) + : nothing to pre-install for this port + ;; + POST-INSTALL) + if [ -f $CONFIG_FILE ]; then + do_notice $1 + else + do_install $1 + fi + ;; + *) + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/net/mrtg/pkg/PLIST b/net/mrtg/pkg/PLIST index 1ba5dc0fd61..ad8161cc1df 100644 --- a/net/mrtg/pkg/PLIST +++ b/net/mrtg/pkg/PLIST @@ -3,13 +3,9 @@ bin/cfgmaker bin/indexmaker bin/mrtg lib/mrtg/BER.pm -@exec cp %D/%F /usr/lib/perl5/site_perl lib/mrtg/SNMP_Session.pm -@exec cp %D/%F /usr/lib/perl5/site_perl lib/mrtg/SNMP_util.pm -@exec cp %D/%F /usr/lib/perl5/site_perl lib/mrtg/mrtg.cfg.sample -@exec if [ ! -f /etc/mrtg.cfg ]; then cp %D/%F /etc/mrtg.cfg; fi share/doc/mrtg/config.html share/doc/mrtg/config.pod share/doc/mrtg/config.txt @@ -31,6 +27,3 @@ share/mrtg/mrtg-ti.gif @dirrm lib/mrtg @dirrm share/mrtg @dirrm share/doc/mrtg -@unexec rm -f /usr/lib/perl5/site_perl/BER.pm -@unexec rm -f /usr/lib/perl5/site_perl/SNMP_Session.pm -@unexec rm -f /usr/lib/perl5/site_perl/SNMP_util.pm