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 include $(INCLUDE_DIR
)/package.mk
22 define Package
/pmacct
/Default
24 CATEGORY
:=Administration
25 URL
:=http
://www.pmacct.net
/
28 define Package
/nfacctd
/Default
29 $(call Package
/pmacct
/Default
)
30 TITLE
:=NetFlow accounting daemon
33 define Package
/nfacctd
34 $(call Package
/nfacctd
/Default
)
37 define Package
/nfacctd-mysql
38 $(call Package
/nfacctd
/Default
)
39 TITLE
+= with MySQL support
40 DEPENDS
+= +libmysqlclient
43 define Package
/nfacctd-pgsql
44 $(call Package
/nfacctd
/Default
)
45 TITLE
+= with PostreSQL support
49 define Package
/nfacctd-sqlite
50 $(call Package
/nfacctd
/Default
)
51 TITLE
+= with SQLite support
55 define Package
/pmacctd
/Default
56 $(call Package
/pmacct
/Default
)
58 TITLE
:=IP pcap-based accounting daemon
61 define Package
/pmacctd
62 $(call Package
/pmacctd
/Default
)
65 define Package
/pmacctd-mysql
66 $(call Package
/pmacctd
/Default
)
67 TITLE
+= with MySQL support
68 DEPENDS
+= +libmysqlclient
71 define Package
/pmacctd-pgsql
72 $(call Package
/pmacctd
/Default
)
73 TITLE
+= with PostreSQL support
77 define Package
/pmacctd-sqlite
78 $(call Package
/pmacctd
/Default
)
79 TITLE
+= with SQLite support
83 define Package
/pmacct-client
84 $(call Package
/pmacct
/Default
)
85 TITLE
:=Command-line client to gather data from the IMT plugin
88 define Compile
/Template
90 $(PKG_BUILD_DIR
)/nfacctd
$(1) $(PKG_BUILD_DIR
)/pmacctd
$(1): $(STAMP_CONFIGURED
)
91 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
92 $(call Build
/Configure
/Default
, \
93 --with-pcap-includes
="$(STAGING_DIR)/usr/include" \
94 --with-pcap-libs
="$(STAGING_DIR)/usr/lib" \
100 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
102 mv
-f
$(PKG_BUILD_DIR
)/src
/nfacctd
$(PKG_BUILD_DIR
)/nfacctd
$(1)
103 mv
-f
$(PKG_BUILD_DIR
)/src
/pmacctd
$(PKG_BUILD_DIR
)/pmacctd
$(1)
105 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/nfacctd
$(1) $(PKG_BUILD_DIR
)/pmacctd
$(1)
110 define Install
/Template
112 define Package
/$(1)$(2)/conffiles
117 define Package
/$(1)$(2)/install
118 $(INSTALL_DIR
) $$(1)/usr
/sbin
119 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/$(1)$(2) $$(1)/usr
/sbin
/$(1)
120 $(INSTALL_DIR
) $$(1)/etc
121 $(INSTALL_DATA
) .
/files
/$(1).conf
$$(1)/etc
/
122 $(INSTALL_DIR
) $$(1)/etc
/default
123 $(INSTALL_DATA
) .
/files
/$(1).default
$$(1)/etc
/default
/$(1)
124 $(INSTALL_DIR
) $$(1)/etc
/init.d
125 $(INSTALL_BIN
) .
/files
/$(1).init
$$(1)/etc
/init.d
/$(1)
130 ifneq ($(SDK
)$(CONFIG_PACKAGE_nfacctd
)$(CONFIG_PACKAGE_pmacctd
),)
131 define Compile
/pmacct
/basic
132 $(call Compile
/Template
,, \
137 $(call Install
/Template
,nfacctd
,)
138 $(call Install
/Template
,pmacctd
,)
141 $(eval
$(Compile
/pmacct
/basic
))
143 ifneq ($(SDK
)$(CONFIG_PACKAGE_nfacctd-mysql
)$(CONFIG_PACKAGE_pmacctd-mysql
),)
144 define Compile
/pmacct
/mysql
145 $(call Compile
/Template
,-mysql
, \
147 --with-mysql-includes
="$(STAGING_DIR)/usr/include" \
148 --with-mysql-libs
="$(STAGING_DIR)/usr/lib/mysql" \
150 $(call Install
/Template
,nfacctd
,-mysql
)
151 $(call Install
/Template
,pmacctd
,-mysql
)
154 $(eval
$(Compile
/pmacct
/mysql
))
156 ifneq ($(SDK
)$(CONFIG_PACKAGE_nfacctd-pgsql
)$(CONFIG_PACKAGE_pmacctd-pgsql
),)
157 define Compile
/pmacct
/pgsql
158 $(call Compile
/Template
,-pgsql
, \
160 --with-pgsql-includes
="$(STAGING_DIR)/usr/include" \
161 --with-pgsql-libs
="$(STAGING_DIR)/usr/lib" \
163 $(call Install
/Template
,nfacctd
,-pgsql
)
164 $(call Install
/Template
,pmacctd
,-pgsql
)
167 $(eval
$(Compile
/pmacct
/pgsql
))
169 ifneq ($(SDK
)$(CONFIG_PACKAGE_nfacctd-sqlite
)$(CONFIG_PACKAGE_pmacctd-sqlite
),)
170 define Compile
/pmacct
/sqlite
171 $(call Compile
/Template
,-sqlite
, \
173 --with-sqlite3-includes
="$(STAGING_DIR)/usr/include" \
174 --with-sqlite3-libs
="$(STAGING_DIR)/usr/lib" \
176 $(call Install
/Template
,nfacctd
,-sqlite
)
177 $(call Install
/Template
,pmacctd
,-sqlite
)
180 $(eval
$(Compile
/pmacct
/sqlite
))
182 define Build
/Configure
188 define Package
/pmacct-client
/install
189 $(INSTALL_DIR
) $(1)/usr
/sbin
190 $(CP
) $(PKG_BUILD_DIR
)/src
/pmacct
$(1)/usr
/sbin
/
193 $(eval
$(call BuildPackage
,nfacctd
))
194 $(eval
$(call BuildPackage
,nfacctd-mysql
))
195 $(eval
$(call BuildPackage
,nfacctd-pgsql
))
196 $(eval
$(call BuildPackage
,nfacctd-sqlite
))
197 $(eval
$(call BuildPackage
,pmacctd
))
198 $(eval
$(call BuildPackage
,pmacctd-mysql
))
199 $(eval
$(call BuildPackage
,pmacctd-pgsql
))
200 $(eval
$(call BuildPackage
,pmacctd-sqlite
))
201 $(eval
$(call BuildPackage
,pmacct-client
))