update php-apc to 3.0.16, disable pthread mutex's as they are on by default now.
[openwrt/svn-archive/archive.git] / net / pmacct / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=pmacct
12 PKG_VERSION:=0.10.3
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.ba.cnr.it/~paolo/pmacct/
17 PKG_MD5SUM:=0be1ffd9d4bda73575caa3240abbf4cb
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20
21 PKG_BUILD_DEPENDS:=libpcap
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/pmacct/Default
26 SECTION:=net
27 CATEGORY:=Network
28 SUBMENU:=pmacct (accounting and aggregation tools)
29 URL:=http://www.ba.cnr.it/~paolo/pmacct/
30 endef
31
32 define Package/nfacctd/Default
33 $(call Package/pmacct/Default)
34 TITLE:=NetFlow accounting daemon
35 endef
36
37 define Package/nfacctd
38 $(call Package/nfacctd/Default)
39 endef
40
41 define Package/nfacctd-mysql
42 $(call Package/nfacctd/Default)
43 TITLE+= with MySQL support
44 DEPENDS+= +libmysqlclient
45 endef
46
47 define Package/nfacctd-pgsql
48 $(call Package/nfacctd/Default)
49 TITLE+= with PostreSQL support
50 DEPENDS+= +libpq
51 endef
52
53 define Package/nfacctd-sqlite
54 $(call Package/nfacctd/Default)
55 TITLE+= with SQLite support
56 DEPENDS+= +libsqlite3
57 endef
58
59 define Package/pmacctd/Default
60 $(call Package/pmacct/Default)
61 DEPENDS+= +libpcap
62 TITLE:=IP pcap-based accounting daemon
63 endef
64
65 define Package/pmacctd
66 $(call Package/pmacctd/Default)
67 endef
68
69 define Package/pmacctd-mysql
70 $(call Package/pmacctd/Default)
71 TITLE+= with MySQL support
72 DEPENDS+= +libmysqlclient
73 endef
74
75 define Package/pmacctd-pgsql
76 $(call Package/pmacctd/Default)
77 TITLE+= with PostreSQL support
78 DEPENDS+= +libpq
79 endef
80
81 define Package/pmacctd-sqlite
82 $(call Package/pmacctd/Default)
83 TITLE+= with SQLite support
84 DEPENDS+= +libsqlite3
85 endef
86
87 define Package/pmacct-client
88 $(call Package/pmacct/Default)
89 TITLE:=Command-line client to gather data from the IMT plugin
90 endef
91
92 define Compile/Template
93
94 $(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1): $(PKG_BUILD_DIR)/.configured
95 -$(MAKE) -C $(PKG_BUILD_DIR) distclean
96 $(call Build/Configure/Default, \
97 --with-pcap-includes="$(STAGING_DIR)/usr/include" \
98 --with-pcap-libs="$(STAGING_DIR)/usr/lib" \
99 $(2) \
100 ,\
101 LIBS="-lz" \
102 ,,\
103 );
104 $(MAKE) -C $(PKG_BUILD_DIR) \
105 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
106 all
107 mv -f $(PKG_BUILD_DIR)/src/nfacctd $(PKG_BUILD_DIR)/nfacctd$(1)
108 mv -f $(PKG_BUILD_DIR)/src/pmacctd $(PKG_BUILD_DIR)/pmacctd$(1)
109
110 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1)
111
112 endef
113
114
115 define Install/Template
116
117 define Package/$(1)$(2)/conffiles
118 /etc/default/$(1)
119 /etc/$(1).conf
120 endef
121
122 define Package/$(1)$(2)/install
123 $(INSTALL_DIR) $$(1)/usr/sbin
124 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1)$(2) $$(1)/usr/sbin/$(1)
125 $(INSTALL_DIR) $$(1)/etc
126 $(INSTALL_DATA) ./files/$(1).conf $$(1)/etc/
127 $(INSTALL_DIR) $$(1)/etc/default
128 $(INSTALL_DATA) ./files/$(1).default $$(1)/etc/default/$(1)
129 $(INSTALL_DIR) $$(1)/etc/init.d
130 $(INSTALL_BIN) ./files/$(1).init $$(1)/etc/init.d/$(1)
131 endef
132
133 endef
134
135 ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd)$(CONFIG_PACKAGE_pmacctd),)
136 define Compile/pmacct/basic
137 $(call Compile/Template,, \
138 --disable-mysql \
139 --disable-pgsql \
140 --disable-sqlite3 \
141 )
142 $(call Install/Template,nfacctd,)
143 $(call Install/Template,pmacctd,)
144 endef
145 endif
146 $(eval $(Compile/pmacct/basic))
147
148 ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-mysql)$(CONFIG_PACKAGE_pmacctd-mysql),)
149 define Compile/pmacct/mysql
150 $(call Compile/Template,-mysql, \
151 --enable-mysql \
152 --with-mysql-includes="$(STAGING_DIR)/usr/include" \
153 --with-mysql-libs="$(STAGING_DIR)/usr/lib/mysql" \
154 )
155 $(call Install/Template,nfacctd,-mysql)
156 $(call Install/Template,pmacctd,-mysql)
157 endef
158 endif
159 $(eval $(Compile/pmacct/mysql))
160
161 ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-pgsql)$(CONFIG_PACKAGE_pmacctd-pgsql),)
162 define Compile/pmacct/pgsql
163 $(call Compile/Template,-pgsql, \
164 --enable-pgsql \
165 --with-pgsql-includes="$(STAGING_DIR)/usr/include" \
166 --with-pgsql-libs="$(STAGING_DIR)/usr/lib" \
167 )
168 $(call Install/Template,nfacctd,-pgsql)
169 $(call Install/Template,pmacctd,-pgsql)
170 endef
171 endif
172 $(eval $(Compile/pmacct/pgsql))
173
174 ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-sqlite)$(CONFIG_PACKAGE_pmacctd-sqlite),)
175 define Compile/pmacct/sqlite
176 $(call Compile/Template,-sqlite, \
177 --enable-sqlite3 \
178 --with-sqlite3-includes="$(STAGING_DIR)/usr/include" \
179 --with-sqlite3-libs="$(STAGING_DIR)/usr/lib" \
180 )
181 $(call Install/Template,nfacctd,-sqlite)
182 $(call Install/Template,pmacctd,-sqlite)
183 endef
184 endif
185 $(eval $(Compile/pmacct/sqlite))
186
187 define Build/Configure
188 endef
189
190 define Build/Compile
191 endef
192
193 define Package/pmacct-client/install
194 $(INSTALL_DIR) $(1)/usr/sbin
195 $(CP) $(PKG_BUILD_DIR)/src/pmacct $(1)/usr/sbin/
196 endef
197
198 $(eval $(call BuildPackage,nfacctd))
199 $(eval $(call BuildPackage,nfacctd-mysql))
200 $(eval $(call BuildPackage,nfacctd-pgsql))
201 $(eval $(call BuildPackage,nfacctd-sqlite))
202 $(eval $(call BuildPackage,pmacctd))
203 $(eval $(call BuildPackage,pmacctd-mysql))
204 $(eval $(call BuildPackage,pmacctd-pgsql))
205 $(eval $(call BuildPackage,pmacctd-sqlite))
206 $(eval $(call BuildPackage,pmacct-client))