source: branches/packages_10.03.1/net/vnstat/Makefile @ 28188

Last change on this file since 28188 was 28188, checked in by jow, 5 years ago

[backfire] merge r28187

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