2 # Copyright (C) 2006-2011 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
:=3d10f9301a17f034a0f221490a99a5d0
18 PKG_BUILD_DEPENDS
:=libpcap
20 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
22 PKG_CONFIG_DEPENDS
:= \
25 include $(INCLUDE_DIR
)/package.mk
27 define Package
/pmacct
/Default
29 CATEGORY
:=Administration
31 URL
:=http
://www.pmacct.net
/
34 define Package
/pmacct-client
35 $(call Package
/pmacct
/Default
)
36 TITLE
:=Command-line client to gather data from the IMT plugin
40 define Package
/nfacctd
/Default
41 $(call Package
/pmacct
/Default
)
42 TITLE
:=NetFlow accounting daemon
45 define Package
/pmacctd
/Default
46 $(call Package
/pmacct
/Default
)
48 TITLE
:=IP pcap-based accounting daemon
51 define Package
/sfacctd
/Default
52 $(call Package
/pmacct
/Default
)
54 TITLE
:=sFlow accounting daemon
57 define Package
/uacctd
/Default
58 $(call Package
/pmacct
/Default
)
59 DEPENDS
+= +iptables-mod-ulog
60 TITLE
:=ulog accounting daemon
65 $(call autoconf_bool
,CONFIG_IPV6
,ipv6
) \
66 --with-pcap-includes
="$(STAGING_DIR)/usr/include" \
67 --with-pcap-libs
="$(STAGING_DIR)/usr/lib" \
70 ifeq ($(BUILD_VARIANT
),basic
)
79 ifeq ($(BUILD_VARIANT
),mysql
)
83 --with-mysql-includes
="$(STAGING_DIR)/usr/include" \
84 --with-mysql-libs
="$(STAGING_DIR)/usr/lib/mysql" \
93 ifeq ($(BUILD_VARIANT
),pgsql
)
98 --with-pgsql-includes
="$(STAGING_DIR)/usr/include" \
99 --with-pgsql-libs
="$(STAGING_DIR)/usr/lib" \
104 ifeq ($(BUILD_VARIANT
),sqlite
)
110 --with-sqlite3-includes
="$(STAGING_DIR)/usr/include" \
111 --with-sqlite3-libs
="$(STAGING_DIR)/usr/lib" \
117 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
118 DESTDIR
="$(PKG_INSTALL_DIR)" \
123 define Package
/pmacct-client
/install
124 $(INSTALL_DIR
) $(1)/usr
/sbin
125 $(CP
) $(PKG_BUILD_DIR
)/src
/pmacct
$(1)/usr
/sbin
/
129 # $(1): build variant {basic,mysql,pgsql,sqlite}
130 # $(2): package name prefix {nfacctd,pmacctd,sfacctd,uacctd}
131 # $(3): package name suffix {,-mysql,-pgsql,-sqlite}
132 # $(4): additional title (with MySQL support, ...)
133 # $(5): additional dependencies (+libmysqlclient, ...)
135 define BuildPackage
/Template
137 define Package
/$(2)$(3)
138 $(call Package
/$(2)/Default
)
144 define Package
/$(2)$(3)/conffiles
149 define Package
/$(2)$(3)/install
150 $(INSTALL_DIR
) $$(1)/usr
/sbin
151 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/$(2) $$(1)/usr
/sbin
/
152 $(INSTALL_DIR
) $$(1)/etc
153 $(INSTALL_DATA
) .
/files
/$(2).conf
$$(1)/etc
/
154 $(INSTALL_DIR
) $$(1)/etc
/default
155 $(INSTALL_DATA
) .
/files
/$(2).default
$$(1)/etc
/default
/$(2)
156 $(INSTALL_DIR
) $$(1)/etc
/init.d
157 $(INSTALL_BIN
) .
/files
/$(2).init
$$(1)/etc
/init.d
/$(2)
160 $$(eval
$$(call BuildPackage
,$(2)$(3)))
164 $(eval
$(call BuildPackage
,pmacct-client
))
166 $(eval
$(call BuildPackage
/Template
,basic
,nfacctd
,,,))
167 $(eval
$(call BuildPackage
/Template
,basic
,pmacctd
,,,))
168 $(eval
$(call BuildPackage
/Template
,basic
,sfacctd
,,,))
169 $(eval
$(call BuildPackage
/Template
,basic
,uacctd
,,,))
171 $(eval
$(call BuildPackage
/Template
,mysql
,nfacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
172 $(eval
$(call BuildPackage
/Template
,mysql
,pmacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
173 $(eval
$(call BuildPackage
/Template
,mysql
,sfacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
174 $(eval
$(call BuildPackage
/Template
,mysql
,uacctd
,-mysql
,with MySQL support
,+libmysqlclient
))
176 $(eval
$(call BuildPackage
/Template
,pgsql
,nfacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
177 $(eval
$(call BuildPackage
/Template
,pgsql
,pmacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
178 $(eval
$(call BuildPackage
/Template
,pgsql
,sfacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
179 $(eval
$(call BuildPackage
/Template
,pgsql
,uacctd
,-pgsql
,with PostgreSQL support
,+libpq
))
181 $(eval
$(call BuildPackage
/Template
,sqlite
,nfacctd
,-sqlite
,with SQLite support
,+libsqlite3
))
182 $(eval
$(call BuildPackage
/Template
,sqlite
,pmacctd
,-sqlite
,with SQLite support
,+libsqlite3
))
183 $(eval
$(call BuildPackage
/Template
,sqlite
,sfacctd
,-sqlite
,with SQLite support
,+libsqlite3
))
184 $(eval
$(call BuildPackage
/Template
,sqlite
,uacctd
,-sqlite
,with SQLite support
,+libsqlite3
))