[package] update vnstat to 1.10 (#6450)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@19025 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2010-01-03 20:57:02 +00:00
parent 10d84a58d9
commit a6bfc432bf
2 changed files with 47 additions and 11 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2009 OpenWrt.org
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -8,12 +8,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vnstat
PKG_VERSION:=1.9
PKG_VERSION:=1.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://humdi.net/vnstat
PKG_MD5SUM:=ebaf8352fa3674faea2fe2ce1001a38d
PKG_MD5SUM:=95421d968689130590348ceb80ff74a8
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:= libgd
include $(INCLUDE_DIR)/package.mk
@ -75,11 +79,11 @@ endef
define Package/vnstat/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/vnstat $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vnstat $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/vnstatd $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vnstatd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) $(PKG_BUILD_DIR)/cfg/vnstat.conf $(1)/etc/
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vnstat.conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/vnstat-uci.conf $(1)/etc/config/vnstat
$(INSTALL_DIR) $(1)/etc/init.d
@ -88,24 +92,20 @@ endef
define Package/vnstati/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/vnstati $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vnstati $(1)/usr/bin/
endef
define Package/vnstat/postinst
#!/bin/sh
BIN_REL=/usr/bin/vnstat
BIN=$${IPKG_INSTROOT}$${BIN_REL}
CRONTAB=$${IPKG_INSTROOT}/etc/crontabs/root
LIB_D_REL=/var/lib/vnstat
LIB_D=$${IPKG_INSTROOT}$${LIB_D_REL}
mkdir -p $${IPKG_INSTROOT}/etc/crontabs/
[ -d $$LIB_D ] || mkdir -p $$LIB_D
IFACE_WAN=$$(uci get network.wan.ifname)
if [ -n $$IFACE_WAN ]; then
[ -e $$LIB_D/$$IFACE_WAN ] || ( [ -x $$BIN ] && $$BIN -u -i $$IFACE_WAN )
fi
grep -q "$$BIN_REL -u" $$CRONTAB 2>/dev/null
[ $$? -eq 0 ] && sed -i -e "/\/usr\/bin\/vnstat -u/d" $$CRONTAB
true
endef

View File

@ -0,0 +1,36 @@
diff -urN vnstat-1.10/Makefile vnstat-1.10.new/Makefile
--- vnstat-1.10/Makefile 2009-08-01 21:23:43.000000000 +0200
+++ vnstat-1.10.new/Makefile 2010-01-03 21:51:31.000000000 +0100
@@ -54,11 +54,11 @@
# install everything else
install -d -m 755 $(BIN) $(SBIN) $(MAN)/man1 $(MAN)/man5 $(DESTDIR)/var/lib/vnstat
- install -s -m 755 src/vnstat $(BIN)
- install -s -m 755 src/vnstatd $(SBIN)
+ install -m 755 src/vnstat $(BIN)
+ install -m 755 src/vnstatd $(SBIN)
@if [ -f "src/vnstati" ]; \
- then echo install -s -m 755 src/vnstati $(BIN); \
- install -s -m 755 src/vnstati $(BIN); \
+ then echo install -m 755 src/vnstati $(BIN); \
+ install -m 755 src/vnstati $(BIN); \
fi
# update man pages, gzip it if previous version was done so
@@ -127,12 +127,12 @@
# install binaries
install -dm 755 $(DESTDIR)/var/db/vnstat
- install -s -m 755 src/vnstat $(BIN_BSD)
- install -s -m 755 src/vnstatd $(SBIN_BSD)
+ install -m 755 src/vnstat $(BIN_BSD)
+ install -m 755 src/vnstatd $(SBIN_BSD)
@if [ -f "src/vnstati" ]; \
- then echo install -s -m 755 src/vnstati $(BIN_BSD); \
- install -s -m 755 src/vnstati $(BIN_BSD); \
+ then echo install -m 755 src/vnstati $(BIN_BSD); \
+ install -m 755 src/vnstati $(BIN_BSD); \
fi
# install default config if such doesn't exist