2 # Copyright (C) 2006-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=http
://www.pmacct.net
/
16 PKG_MD5SUM
:=4588531f0e8033fe82ad7fb22d1bbdb7
18 PKG_BUILD_DEPENDS
:=libpcap
20 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
22 PKG_CONFIG_DEPENDS
:= \
27 include $(INCLUDE_DIR
)/package.mk
29 define Package
/pmacct
/Default
31 CATEGORY
:=Administration
33 URL
:=http
://www.pmacct.net
/
37 define Package
/pmacct-client
38 $(call Package
/pmacct
/Default
)
39 TITLE
:=Command-line client to gather data from the IMT plugin
43 define Package
/nfacctd
/Default
44 $(call Package
/pmacct
/Default
)
45 TITLE
:=NetFlow accounting daemon
48 define Package
/pmacctd
/Default
49 $(call Package
/pmacct
/Default
)
50 TITLE
:=IP pcap-based accounting daemon
53 define Package
/sfacctd
/Default
54 $(call Package
/pmacct
/Default
)
55 TITLE
:=sFlow accounting daemon
58 define Package
/uacctd
/Default
59 $(call Package
/pmacct
/Default
)
60 DEPENDS
+= +iptables-mod-ulog
61 TITLE
:=ulog accounting daemon
66 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
67 --with-pcap-includes
="$(STAGING_DIR)/usr/include" \
68 --with-pcap-libs
="$(STAGING_DIR)/usr/lib" \
71 ifeq ($(BUILD_VARIANT
),basic
)
80 ifeq ($(BUILD_VARIANT
),mysql
)
84 --with-mysql-includes
="$(STAGING_DIR)/usr/include" \
85 --with-mysql-libs
="$(STAGING_DIR)/usr/lib/mysql" \
94 ifeq ($(BUILD_VARIANT
),pgsql
)
99 --with-pgsql-includes
="$(STAGING_DIR)/usr/include" \
100 --with-pgsql-libs
="$(STAGING_DIR)/usr/lib" \
105 ifeq ($(BUILD_VARIANT
),sqlite
)
111 --with-sqlite3-includes
="$(STAGING_DIR)/usr/include" \
112 --with-sqlite3-libs
="$(STAGING_DIR)/usr/lib" \
117 define Package
/pmacct-client
/install
118 $(INSTALL_DIR
) $(1)/usr
/sbin
119 $(CP
) $(PKG_BUILD_DIR
)/src
/pmacct
$(1)/usr
/sbin
/
123 # $(1): build variant {basic,mysql,pgsql,sqlite}
124 # $(2): package name prefix {nfacctd,pmacctd,sfacctd,uacctd}
125 # $(3): package name suffix {,-mysql,-pgsql,-sqlite}
126 # $(4): additional title (with MySQL support, ...)
127 # $(5): additional dependencies (+libmysqlclient, ...)
129 define BuildPackage
/Template
131 define Package
/$(2)$(3)
132 $(call Package
/$(2)/Default
)
138 define Package
/$(2)$(3)/conffiles
143 define Package
/$(2)$(3)/install
144 $(INSTALL_DIR
) $$(1)/usr
/sbin
145 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/$(2) $$(1)/usr
/sbin
/
146 $(INSTALL_DIR
) $$(1)/etc
147 $(INSTALL_DATA
) .
/files
/$(2).conf
$$(1)/etc
/
148 $(INSTALL_DIR
) $$(1)/etc
/default
149 $(INSTALL_DATA
) .
/files
/$(2).default
$$(1)/etc
/default
/$(2)
150 $(INSTALL_DIR
) $$(1)/etc
/init.d
151 $(INSTALL_BIN
) .
/files
/$(2).init
$$(1)/etc
/init.d
/$(2)
154 $$(eval
$$(call BuildPackage
,$(2)$(3)))
158 $(eval
$(call BuildPackage
,pmacct-client
))
160 $(eval
$(call BuildPackage
/Template
,basic
,nfacctd
,,,))
161 $(eval
$(call BuildPackage
/Template
,basic
,pmacctd
,,,))
162 $(eval
$(call BuildPackage
/Template
,basic
,sfacctd
,,,))
163 $(eval
$(call BuildPackage
/Template
,basic
,uacctd
,,,))
165 $(eval
$(call BuildPackage
/Template
,mysql
,nfacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
166 $(eval
$(call BuildPackage
/Template
,mysql
,pmacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
167 $(eval
$(call BuildPackage
/Template
,mysql
,sfacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
168 $(eval
$(call BuildPackage
/Template
,mysql
,uacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
170 $(eval
$(call BuildPackage
/Template
,pgsql
,nfacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
171 $(eval
$(call BuildPackage
/Template
,pgsql
,pmacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
172 $(eval
$(call BuildPackage
/Template
,pgsql
,sfacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
173 $(eval
$(call BuildPackage
/Template
,pgsql
,uacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
175 $(eval
$(call BuildPackage
/Template
,sqlite
,nfacctd
,-sqlite
,with SQLite support
,+libsqlite3
+zlib
))
176 $(eval
$(call BuildPackage
/Template
,sqlite
,pmacctd
,-sqlite
,with SQLite support
,+libsqlite3
+zlib
))
177 $(eval
$(call BuildPackage
/Template
,sqlite
,sfacctd
,-sqlite
,with SQLite support
,+libsqlite3
+zlib
))
178 $(eval
$(call BuildPackage
/Template
,sqlite
,uacctd
,-sqlite
,with SQLite support
,+libsqlite3
+zlib
))