Ticket #6450: vnstat_6450.diff

File vnstat_6450.diff, 2.2 KB (added by swalker, 7 years ago)

Along with using PKG_INSTALL & removing the unused cron bits

  • feeds/packages/net/vnstat/Makefile

     
    11# 
    2 # Copyright (C) 2006-2009 OpenWrt.org 
     2# Copyright (C) 2006-2010 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
    55# See /LICENSE for more information. 
     
    88include $(TOPDIR)/rules.mk 
    99 
    1010PKG_NAME:=vnstat 
    11 PKG_VERSION:=1.9 
     11PKG_VERSION:=1.10 
    1212PKG_RELEASE:=1 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    1515PKG_SOURCE_URL:=http://humdi.net/vnstat 
    16 PKG_MD5SUM:=ebaf8352fa3674faea2fe2ce1001a38d 
     16PKG_MD5SUM:=95421d968689130590348ceb80ff74a8 
    1717 
     18PKG_INSTALL:=1 
     19 
    1820include $(INCLUDE_DIR)/package.mk 
    1921 
    2022define Package/vnstat/Default 
     
    7577 
    7678define Package/vnstat/install 
    7779        $(INSTALL_DIR) $(1)/usr/bin 
    78         $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/vnstat $(1)/usr/bin/ 
     80        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vnstat $(1)/usr/bin/ 
    7981        $(INSTALL_DIR) $(1)/usr/sbin 
    80         $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/vnstatd $(1)/usr/sbin/ 
     82        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vnstatd $(1)/usr/sbin/ 
    8183        $(INSTALL_DIR) $(1)/etc 
    82         $(INSTALL_CONF) $(PKG_BUILD_DIR)/cfg/vnstat.conf $(1)/etc/ 
     84        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vnstat.conf $(1)/etc/ 
    8385        $(INSTALL_DIR) $(1)/etc/config 
    8486        $(INSTALL_CONF) ./files/vnstat-uci.conf $(1)/etc/config/vnstat 
    8587        $(INSTALL_DIR) $(1)/etc/init.d 
     
    8890 
    8991define Package/vnstati/install 
    9092        $(INSTALL_DIR) $(1)/usr/bin 
    91         $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/vnstati $(1)/usr/bin/ 
     93        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vnstati $(1)/usr/bin/ 
    9294endef 
    9395 
    9496define Package/vnstat/postinst 
    9597#!/bin/sh 
    9698BIN_REL=/usr/bin/vnstat 
    9799BIN=$${IPKG_INSTROOT}$${BIN_REL} 
    98 CRONTAB=$${IPKG_INSTROOT}/etc/crontabs/root 
    99100LIB_D_REL=/var/lib/vnstat 
    100101LIB_D=$${IPKG_INSTROOT}$${LIB_D_REL} 
    101 mkdir -p $${IPKG_INSTROOT}/etc/crontabs/ 
    102102[ -d $$LIB_D ] || mkdir -p $$LIB_D 
    103103IFACE_WAN=$$(uci get network.wan.ifname) 
    104104if [ -n $$IFACE_WAN ]; then 
    105105        [ -e $$LIB_D/$$IFACE_WAN ] || ( [ -x $$BIN ] && $$BIN -u -i $$IFACE_WAN ) 
    106106fi 
    107 grep -q "$$BIN_REL -u" $$CRONTAB 2>/dev/null 
    108 [ $$? -eq 0 ] && sed -i -e "/\/usr\/bin\/vnstat -u/d" $$CRONTAB 
    109107true 
    110108endef 
    111109