2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://www.ba.cnr.it
/~paolo
/pmacct
/
17 PKG_MD5SUM
:=0be1ffd9d4bda73575caa3240abbf4cb
20 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
24 include $(INCLUDE_DIR
)/package.mk
26 define Package
/pmacct
/Default
29 SUBMENU
:=pmacct
(accounting and aggregation tools
)
30 URL
:=http
://www.ba.cnr.it
/~paolo
/pmacct
/
33 define Package
/nfacctd
/Default
34 $(call Package
/pmacct
/Default
)
35 TITLE
:=NetFlow accounting daemon
38 define Package
/nfacctd
39 $(call Package
/nfacctd
/Default
)
42 define Package
/nfacctd-mysql
43 $(call Package
/nfacctd
/Default
)
44 TITLE
+= with MySQL support
45 DEPENDS
+= +libmysqlclient
48 define Package
/nfacctd-pgsql
49 $(call Package
/nfacctd
/Default
)
50 TITLE
+= with PostreSQL support
54 define Package
/nfacctd-sqlite
55 $(call Package
/nfacctd
/Default
)
56 TITLE
+= with SQLite support
60 define Package
/pmacctd
/Default
61 $(call Package
/pmacct
/Default
)
63 TITLE
:=IP pcap-based accounting daemon
66 define Package
/pmacctd
67 $(call Package
/pmacctd
/Default
)
70 define Package
/pmacctd-mysql
71 $(call Package
/pmacctd
/Default
)
72 TITLE
+= with MySQL support
73 DEPENDS
+= +libmysqlclient
76 define Package
/pmacctd-pgsql
77 $(call Package
/pmacctd
/Default
)
78 TITLE
+= with PostreSQL support
82 define Package
/pmacctd-sqlite
83 $(call Package
/pmacctd
/Default
)
84 TITLE
+= with SQLite support
88 define Package
/sfacctd
/Default
89 $(call Package
/pmacct
/Default
)
90 TITLE
:=sFlow accounting daemon
93 define Package
/pmacct-client
94 $(call Package
/pmacct
/Default
)
95 TITLE
:=Command-line client to gather data from the IMT plugin
100 CONFIG_PACKAGE_nfacctd
:=m
101 CONFIG_PACKAGE_nfacctd-mysql
:=m
102 CONFIG_PACKAGE_nfacctd-pgsql
:=m
103 CONFIG_PACKAGE_nfacctd-sqlite
:=m
104 CONFIG_PACKAGE_pmacctd
:=m
105 CONFIG_PACKAGE_pmacctd-mysql
:=m
106 CONFIG_PACKAGE_pmacctd-pgsql
:=m
107 CONFIG_PACKAGE_pmacctd-sqlite
:=m
110 define Compile
/Template
112 $(PKG_BUILD_DIR
)/nfacctd-
$(1) $(PKG_BUILD_DIR
)/pmacctd-
$(1): $(PKG_BUILD_DIR
)/.configured
113 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
114 $(call Build
/Configure
/Default
, \
115 --with-pcap-includes
="$(STAGING_DIR)/usr/include" \
116 --with-pcap-libs
="$(STAGING_DIR)/usr/lib" \
121 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
122 CFLAGS
="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
124 mv
-f
$(PKG_BUILD_DIR
)/src
/nfacctd
$(PKG_BUILD_DIR
)/nfacctd-
$(1)
125 mv
-f
$(PKG_BUILD_DIR
)/src
/pmacctd
$(PKG_BUILD_DIR
)/pmacctd-
$(1)
127 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/nfacctd-
$(1) $(PKG_BUILD_DIR
)/pmacctd-
$(1)
132 define Install
/Template
134 define Package
/$(1)/conffiles
139 define Package
/$(1)/install
140 install -d
-m0755
$$(1)/usr
/sbin
141 install -m0755
$(PKG_BUILD_DIR
)/$(2) $$(1)/usr
/sbin
/$(3)
142 install -d
-m0755
$$(1)/etc
143 install -m0644 .
/files
/$(3).conf
$$(1)/etc
/
144 install -d
-m0755
$$(1)/etc
/default
145 install -m0644 .
/files
/$(3).default
$$(1)/etc
/default
/$(3)
146 install -d
-m0755
$$(1)/etc
/init.d
147 install -m0755 .
/files
/$(3).init
$$(1)/etc
/init.d
/$(3)
153 ifneq ($(CONFIG_PACKAGE_nfacctd
)$(CONFIG_PACKAGE_pmacctd
),)
154 $(eval
$(call Compile
/Template
,basic
))
155 $(eval
$(call Install
/Template
,nfacctd
,nfacctd-basic
,nfacctd
))
156 $(eval
$(call Install
/Template
,pmacctd
,pmacctd-basic
,pmacctd
))
158 ifneq ($(CONFIG_PACKAGE_nfacctd-mysql
)$(CONFIG_PACKAGE_pmacctd-mysql
),)
159 $(eval
$(call Compile
/Template
,mysql
, \
161 --with-mysql-includes
="$(STAGING_DIR)/usr/include" \
162 --with-mysql-libs
="$(STAGING_DIR)/usr/lib/mysql" \
166 $(eval
$(call Install
/Template
,nfacctd-mysql
,nfacctd-mysql
,nfacctd
))
167 $(eval
$(call Install
/Template
,pmacctd-mysql
,pmacctd-mysql
,pmacctd
))
169 ifneq ($(CONFIG_PACKAGE_nfacctd-pgsql
)$(CONFIG_PACKAGE_pmacctd-pgsql
),)
170 $(eval
$(call Compile
/Template
,pgsql
, \
172 --with-pgsql-includes
="$(STAGING_DIR)/usr/include" \
173 --with-pgsql-libs
="$(STAGING_DIR)/usr/lib" \
175 $(eval
$(call Install
/Template
,nfacctd-pgsql
,nfacctd-pgsql
,nfacctd
))
176 $(eval
$(call Install
/Template
,pmacctd-pgsql
,pmacctd-pgsql
,pmacctd
))
178 ifneq ($(CONFIG_PACKAGE_nfacctd-sqlite
)$(CONFIG_PACKAGE_pmacctd-sqlite
),)
179 $(eval
$(call Compile
/Template
,sqlite
, \
181 --with-sqlite3-includes
="$(STAGING_DIR)/usr/include" \
182 --with-sqlite3-libs
="$(STAGING_DIR)/usr/lib" \
184 $(eval
$(call Install
/Template
,nfacctd-sqlite
,nfacctd-sqlite
,nfacctd
))
185 $(eval
$(call Install
/Template
,pmacctd-sqlite
,pmacctd-sqlite
,pmacctd
))
188 define Build
/Configure
194 define Package
/pmacct-client
/install
195 install -d
-m0755
$(1)/usr
/sbin
196 $(CP
) $(PKG_BUILD_DIR
)/src
/pmacct
$(1)/usr
/sbin
/
199 $(eval
$(call BuildPackage
,nfacctd
))
200 $(eval
$(call BuildPackage
,nfacctd-mysql
))
201 $(eval
$(call BuildPackage
,nfacctd-pgsql
))
202 $(eval
$(call BuildPackage
,nfacctd-sqlite
))
203 $(eval
$(call BuildPackage
,pmacctd
))
204 $(eval
$(call BuildPackage
,pmacctd-mysql
))
205 $(eval
$(call BuildPackage
,pmacctd-pgsql
))
206 $(eval
$(call BuildPackage
,pmacctd-sqlite
))
207 $(eval
$(call BuildPackage
,pmacct-client
))