packages: fix parallel build by adding + for every make command that passes the jobserver
[openwrt/svn-archive/archive.git] / net / vnstat / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=vnstat
11 PKG_VERSION:=1.11
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://humdi.net/vnstat
16 PKG_MD5SUM:=a5a113f9176cd61fb954f2ba297f5fdb
17
18 PKG_INSTALL:=1
19
20 PKG_BUILD_DEPENDS:=libgd
21 PKG_BUILD_PARALLEL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/vnstat/Default
26 SECTION:=net
27 CATEGORY:=Network
28 URL:=http://humdi.net/vnstat/
29 endef
30
31 define Package/vnstat
32 $(call Package/vnstat/Default)
33 TITLE:=Console-based network traffic monitor
34 endef
35
36 define 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.
41 endef
42
43 define Package/vnstati
44 $(call Package/vnstat/Default)
45 DEPENDS+=vnstat +libgd
46 TITLE:=PNG image output support for vnStat
47 endef
48
49 define 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.
55 endef
56
57 define Package/vnstat/conffiles
58 /etc/vnstat.conf
59 /etc/config/vnstat
60 endef
61
62 define Build/Compile/vnstat
63 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
64 $(TARGET_CONFIGURE_OPTS) \
65 CFLAGS="$(TARGET_CFLAGS)"
66 endef
67
68 define 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
74 endef
75
76 define Build/Compile
77 $(call Build/Compile/vnstat)
78 $(call Build/Compile/vnstati)
79 endef
80
81 define Package/vnstat/install
82 $(INSTALL_DIR) $(1)/usr/bin
83 $(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstat $(1)/usr/bin/
84 $(INSTALL_DIR) $(1)/usr/sbin
85 $(CP) $(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.config $(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
94 endef
95
96 define Package/vnstati/install
97 $(INSTALL_DIR) $(1)/usr/bin
98 $(CP) $(PKG_INSTALL_DIR)/usr/bin/vnstati $(1)/usr/bin/
99 endef
100
101 define Package/vnstat/postinst
102 #!/bin/sh
103 [ -n "$${IPKG_INSTROOT}" ] || (. /etc/uci-defaults/vnstat) && rm -f /etc/uci-defaults/vnstat
104 exit 0
105 endef
106
107 $(eval $(call BuildPackage,vnstat))
108 $(eval $(call BuildPackage,vnstati))