|
@@ -0,0 +1,109 @@
|
|
1
|
+#
|
|
2
|
+# Copyright (C) 2006-2014 OpenWrt.org
|
|
3
|
+#
|
|
4
|
+# This is free software, licensed under the GNU General Public License v2.
|
|
5
|
+# See /LICENSE for more information.
|
|
6
|
+#
|
|
7
|
+
|
|
8
|
+include $(TOPDIR)/rules.mk
|
|
9
|
+
|
|
10
|
+PKG_NAME:=vnstat
|
|
11
|
+PKG_VERSION:=1.11
|
|
12
|
+PKG_RELEASE:=4
|
|
13
|
+
|
|
14
|
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
15
|
+PKG_SOURCE_URL:=http://humdi.net/vnstat
|
|
16
|
+PKG_MD5SUM:=a5a113f9176cd61fb954f2ba297f5fdb
|
|
17
|
+PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
|
|
18
|
+
|
|
19
|
+PKG_INSTALL:=1
|
|
20
|
+
|
|
21
|
+PKG_BUILD_DEPENDS:=libgd
|
|
22
|
+PKG_BUILD_PARALLEL:=1
|
|
23
|
+
|
|
24
|
+include $(INCLUDE_DIR)/package.mk
|
|
25
|
+
|
|
26
|
+define Package/vnstat/Default
|
|
27
|
+ SECTION:=net
|
|
28
|
+ CATEGORY:=Network
|
|
29
|
+ URL:=http://humdi.net/vnstat/
|
|
30
|
+endef
|
|
31
|
+
|
|
32
|
+define Package/vnstat
|
|
33
|
+$(call Package/vnstat/Default)
|
|
34
|
+ TITLE:=Console-based network traffic monitor
|
|
35
|
+endef
|
|
36
|
+
|
|
37
|
+define Package/vnstat/description
|
|
38
|
+ vnStat is a network traffic monitor for Linux that keeps a log of daily
|
|
39
|
+ network traffic for the selected interface(s). vnStat isn't a packet
|
|
40
|
+ sniffer. The traffic information is analyzed from the /proc -filesystem,
|
|
41
|
+ so vnStat can be used without root permissions.
|
|
42
|
+endef
|
|
43
|
+
|
|
44
|
+define Package/vnstati
|
|
45
|
+$(call Package/vnstat/Default)
|
|
46
|
+ DEPENDS+=vnstat +libgd
|
|
47
|
+ TITLE:=PNG image output support for vnStat
|
|
48
|
+endef
|
|
49
|
+
|
|
50
|
+define Package/vnstati/description
|
|
51
|
+ The purpose of vnstati is to provide image output support for statistics
|
|
52
|
+ collected using vnstat(1). However, the image file format is limited to
|
|
53
|
+ png. All basic outputs of vnStat are supported excluding live traffic
|
|
54
|
+ features. The image can be outputted either to a file or to standard
|
|
55
|
+ output.
|
|
56
|
+endef
|
|
57
|
+
|
|
58
|
+define Package/vnstat/conffiles
|
|
59
|
+/etc/vnstat.conf
|
|
60
|
+/etc/config/vnstat
|
|
61
|
+endef
|
|
62
|
+
|
|
63
|
+define Build/Compile/vnstat
|
|
64
|
+ +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
65
|
+ $(TARGET_CONFIGURE_OPTS) \
|
|
66
|
+ CFLAGS="$(TARGET_CFLAGS)"
|
|
67
|
+endef
|
|
68
|
+
|
|
69
|
+define Build/Compile/vnstati
|
|
70
|
+ +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
71
|
+ $(TARGET_CONFIGURE_OPTS) \
|
|
72
|
+ CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
|
|
73
|
+ LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib" \
|
|
74
|
+ all
|
|
75
|
+endef
|
|
76
|
+
|
|
77
|
+define Build/Compile
|
|
78
|
+$(call Build/Compile/vnstat)
|
|
79
|
+$(call Build/Compile/vnstati)
|
|
80
|
+endef
|
|
81
|
+
|
|
82
|
+define Package/vnstat/install
|
|
83
|
+ $(INSTALL_DIR) $(1)/usr/bin
|
|
84
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstat $(1)/usr/bin/
|
|
85
|
+ $(INSTALL_DIR) $(1)/usr/sbin
|
|
86
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/vnstatd $(1)/usr/sbin/
|
|
87
|
+ $(INSTALL_DIR) $(1)/etc
|
|
88
|
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vnstat.conf $(1)/etc/
|
|
89
|
+ $(INSTALL_DIR) $(1)/etc/config
|
|
90
|
+ $(INSTALL_CONF) ./files/vnstat.config $(1)/etc/config/vnstat
|
|
91
|
+ $(INSTALL_DIR) $(1)/etc/init.d
|
|
92
|
+ $(INSTALL_BIN) ./files/vnstat.init $(1)/etc/init.d/vnstat
|
|
93
|
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
|
|
94
|
+ $(INSTALL_BIN) ./files/vnstat.defaults $(1)/etc/uci-defaults/vnstat
|
|
95
|
+endef
|
|
96
|
+
|
|
97
|
+define Package/vnstati/install
|
|
98
|
+ $(INSTALL_DIR) $(1)/usr/bin
|
|
99
|
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstati $(1)/usr/bin/
|
|
100
|
+endef
|
|
101
|
+
|
|
102
|
+define Package/vnstat/postinst
|
|
103
|
+#!/bin/sh
|
|
104
|
+[ -n "$${IPKG_INSTROOT}" ] || (. /etc/uci-defaults/vnstat) && rm -f /etc/uci-defaults/vnstat
|
|
105
|
+exit 0
|
|
106
|
+endef
|
|
107
|
+
|
|
108
|
+$(eval $(call BuildPackage,vnstat))
|
|
109
|
+$(eval $(call BuildPackage,vnstati))
|