aboutsummaryrefslogtreecommitdiff
path: root/network/vnstat
diff options
context:
space:
mode:
authorMichiel van Wessem <michiel@slackbuilds.org>2010-05-11 19:46:05 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 19:46:05 +0200
commit521e6c6ce4dfd2eea8da0394053c42688d668d5c (patch)
tree53150ec430e9855802725925ffadc39f557746fa /network/vnstat
parente846e1bf5fcca3f169b0e5605dfce98823d3a7b0 (diff)
network/vnstat: Updated for version 1.6
Diffstat (limited to 'network/vnstat')
-rw-r--r--network/vnstat/README3
-rw-r--r--network/vnstat/doinst.sh17
-rw-r--r--network/vnstat/slack-desc20
-rw-r--r--network/vnstat/vnstat.SlackBuild21
-rw-r--r--network/vnstat/vnstat.info6
5 files changed, 49 insertions, 18 deletions
diff --git a/network/vnstat/README b/network/vnstat/README
index f7fbb85607f8..a22949bbfb05 100644
--- a/network/vnstat/README
+++ b/network/vnstat/README
@@ -7,5 +7,4 @@ This program is open source (GPL) and can be installed in 'single' and
'root' mode.
Add the following line to your crontab:
-0-55/5 * * * * root if [ -x /usr/bin/vnstat ] && \
-[ `ls /var/lib/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u; fi
+0-55/5 * * * * if [[ -x /usr/bin/vnstat && $(ls /var/lib/vnstat/ | wc -l) -ge 1 ]]; then /usr/bin/vnstat -u; fi
diff --git a/network/vnstat/doinst.sh b/network/vnstat/doinst.sh
new file mode 100644
index 000000000000..206b717881c9
--- /dev/null
+++ b/network/vnstat/doinst.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/vnstat.conf.new
+
diff --git a/network/vnstat/slack-desc b/network/vnstat/slack-desc
index 3f3eed06a407..69c6620d0380 100644
--- a/network/vnstat/slack-desc
+++ b/network/vnstat/slack-desc
@@ -1,11 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
vnstat: vnStat (a console-based network traffic monitor)
vnstat:
-vnstat: vnStat is a network traffic monitor for Linux that keeps a log of daily
-vnstat: network traffic for the selected interface(s). vnStat isn't a packet
-vnstat: sniffer. The traffic information is analyzed from the /proc filesystem,
-vnstat: so vnStat can be used without root permissions. This program is open
-vnstat: source (GPL) and can be installed in 'single' and 'root' mode.
+vnstat: vnStat is a network traffic monitor for Linux that keeps a log of
+vnstat: daily network traffic for the selected interface(s). vnStat isn't a
+vnstat: packetsniffer. The traffic information is analyzed from the /proc
+vnstat: filesystem so vnStat can be used without root permissions. This
+vnstat: program is open source (GPL) and can be installed in 'single' and
+vnstat: 'root' mode.
vnstat:
vnstat: homepage: http://humdi.net/vnstat/
vnstat:
-vnstat:
diff --git a/network/vnstat/vnstat.SlackBuild b/network/vnstat/vnstat.SlackBuild
index 3525ebd1465f..b31203c27329 100644
--- a/network/vnstat/vnstat.SlackBuild
+++ b/network/vnstat/vnstat.SlackBuild
@@ -22,15 +22,12 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Modified by the SlackBuilds.org project
-
-set -e
-
PRGNAM=vnstat
-VERSION=1.4
+VERSION=1.6
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -38,6 +35,8 @@ OUTPUT=${OUTPUT:-/tmp}
DOCFILES="CHANGES COPYING FAQ INSTALL README UNINSTALL UPGRADE"
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -45,13 +44,19 @@ rm -rf $PRGNAM-$VERSION
tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
-chmod -R u+w,go+r-w,a-s .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
# vnstat doesn't have a proper configure. So we set the locations in the
# Makefiles properly by the way of sed-fu
sed -i 's#MAN = $(DESTDIR)/usr/share/man#MAN = $(DESTDIR)/usr/man#' \
$TMP/$PRGNAM-$VERSION/Makefile
-sed -i 's#CRON = $(DESTDIR)/etc/cron.d#CRON = $(DESTDIR)/usr/doc/vnstat-1.4/scripts#' \
+sed -i "s#CRON = \$(DESTDIR)/etc/cron.d#CRON = \$(DESTDIR)/usr/doc/$PRGNAM-$VERSION/scripts#" \
+ $TMP/$PRGNAM-$VERSION/Makefile
+sed -i 's#install -m 644 cfg/vnstat.conf $(DESTDIR)/etc;#install -D -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf.new;#' \
$TMP/$PRGNAM-$VERSION/Makefile
# Set the compile flags in the src/Makefile properly
@@ -70,6 +75,7 @@ make install DESTDIR=$PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
+
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
@@ -83,6 +89,7 @@ cp -a pppd/* $PKG/usr/doc/$PRGNAM-$VERSION/scripts
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
diff --git a/network/vnstat/vnstat.info b/network/vnstat/vnstat.info
index be9e48ba38bb..3130fa83224a 100644
--- a/network/vnstat/vnstat.info
+++ b/network/vnstat/vnstat.info
@@ -1,8 +1,8 @@
PRGNAM="vnstat"
-VERSION="1.4"
+VERSION="1.6"
HOMEPAGE="http://humdi.net/vnstat/"
-DOWNLOAD="http://humdi.net/vnstat/vnstat-1.4.tar.gz"
-MD5SUM="9184f79b5e60499bc059f670032291e5"
+DOWNLOAD="http://humdi.net/vnstat/vnstat-1.6.tar.gz"
+MD5SUM="9f88dc8278cd49532c1b4485f5ed4ba7"
MAINTAINER="Michiel van Wessem"
EMAIL="michiel@slackbuilds.org"
APPROVED="rworkman"