2 # Copyright (C) 2006-2017 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
:=https
://github.com
/NethServer
/bandwidthd
/archive
/$(PKG_VERSION
)
16 PKG_HASH
:=41803a202956ae99b095f98ce92e5637dad62d25509ccd5cff9a8913626a4226
18 PKG_MAINTAINER
:=Jean-Michel Lacroix
<lacroix@lepine-lacroix.
info>
22 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/bandwidthd
/Default
32 URL
:=http
://bandwidthd.sourceforge.net
/
35 define Package
/bandwidthd
36 $(call Package
/bandwidthd
/Default
)
37 TITLE
+= (without database
)
39 DEPENDS
:=+libgd
+libpcap
42 define Package
/bandwidthd-pgsql
43 $(call Package
/bandwidthd
/Default
)
44 TITLE
+= (with postgresql enabled
)
46 DEPENDS
:=+libgd
+libpcap
+libpq
49 define Package
/bandwidthd-sqlite
50 $(call Package
/bandwidthd
/Default
)
51 TITLE
+= (with sqlite enabled
)
53 DEPENDS
:=+libgd
+libpcap
+libsqlite3
+php7
+php7-cgi
+php7-mod-gd
+php7-mod-pdo
+php7-mod-pdo-sqlite
56 define Package
/bandwidthd-php
57 $(call Package
/bandwidthd
/Default
)
58 TITLE
= PHP files to graph bandwidthd data from postgresql
60 DEPENDS
:=+libpcre
+libxml2
+php7
+php7-cgi
+php7-mod-pgsql
+php7-mod-gd
63 define Package
/bandwidthd
/description
64 A bandwidthd tracking utility.
67 define Package
/bandwidthd-pgsql
/description
68 $(call Package
/bandwidthd
/description
)
69 With the ability to store in a postgresql database.
72 define Package
/bandwidthd-sqlite
/description
73 $(call Package
/bandwidthd
/description
)
74 With the ability to store in a sqlite database.
77 define Package
/bandwidthd-php
/description
78 PHP files to graph bandwidthd data from pgsql.
81 define Package
/bandwidthd
/daemon
82 This package contains bandwidthd
, a bandwidth tracking utility.
85 define Package
/bandwidthd-pgsql
/daemon
86 This package contains bandwidthd
, a bandwidth tracking utility.
89 define Package
/bandwidthd-sqlite
/daemon
90 This package contains bandwidthd
, a bandwidth tracking utility.
93 define Package
/bandwidthd-php
/daemon
94 This package contains the PHP files to graph the data from a pgsql database.
97 ifeq ($(BUILD_VARIANT
),no-db
)
99 ac_cv_file__sw_lib
=no \
100 ac_cv_file__sw_include
=no \
101 ac_cv_file__usr_pkg_lib
=no \
102 ac_cv_file__usr_pkg_include
=no \
103 ac_cv_file__usr_local_pgsql_lib
=no \
104 ac_cv_file__usr_local_pgsql_include
=no \
105 ac_cv_lib_pq_PQconnectdb
=no \
106 ac_cv_lib_sqlite3_sqlite3_open
=no
109 ifeq ($(BUILD_VARIANT
),pgsql
)
111 ac_cv_file__sw_lib
=no \
112 ac_cv_file__sw_include
=no \
113 ac_cv_file__usr_pkg_lib
=no \
114 ac_cv_file__usr_pkg_include
=no \
115 ac_cv_file__usr_local_pgsql_lib
=no \
116 ac_cv_file__usr_local_pgsql_include
=no \
117 ac_cv_lib_sqlite3_sqlite3_open
=no
120 ifeq ($(BUILD_VARIANT
),sqlite
)
122 ac_cv_file__sw_lib
=no \
123 ac_cv_file__sw_include
=no \
124 ac_cv_file__usr_pkg_lib
=no \
125 ac_cv_file__usr_pkg_include
=no \
126 ac_cv_file__usr_local_pgsql_lib
=no \
127 ac_cv_file__usr_local_pgsql_include
=no \
128 ac_cv_lib_pq_PQconnectdb
=no
131 ifeq ($(BUILD_VARIANT
),php
)
133 ac_cv_file__sw_lib
=no \
134 ac_cv_file__sw_include
=no \
135 ac_cv_file__usr_pkg_lib
=no \
136 ac_cv_file__usr_pkg_include
=no \
137 ac_cv_file__usr_local_pgsql_lib
=no \
138 ac_cv_file__usr_local_pgsql_include
=no \
139 ac_cv_lib_pq_PQconnectdb
=no \
140 ac_cv_lib_sqlite3_sqlite3_open
=no
143 EXTRA_CFLAGS
+= $(TARGET_CPPFLAGS
)
144 EXTRA_LDFLAGS
+= $(TARGET_LDFLAGS
) -Wl
,-rpath-link
,$(STAGING_DIR
)/usr
/lib
146 define Package
/bandwidthd
/install
147 $(INSTALL_DIR
) $(1)/usr
/sbin
148 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
149 $(INSTALL_DIR
) $(1)/etc
/config
150 $(INSTALL_DATA
) .
/files
/bandwidthd.config
$(1)/etc
/config
/bandwidthd
151 $(INSTALL_DIR
) $(1)/etc
/init.d
152 $(INSTALL_BIN
) .
/files
/bandwidthd.init
$(1)/etc
/init.d
/bandwidthd
153 $(INSTALL_DIR
) $(1)/www
154 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/
155 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/logo.gif
158 define Package
/bandwidthd-pgsql
/install
159 $(INSTALL_DIR
) $(1)/usr
/sbin
160 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
161 $(INSTALL_DIR
) $(1)/etc
/config
162 $(INSTALL_DATA
) .
/files
/bandwidthd-pgsql.config
$(1)/etc
/config
/bandwidthd
163 $(INSTALL_DIR
) $(1)/etc
/init.d
164 $(INSTALL_BIN
) .
/files
/bandwidthd.init
$(1)/etc
/init.d
/bandwidthd
165 $(INSTALL_DIR
) $(1)/www
166 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/
167 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/logo.gif
168 $(INSTALL_DIR
) $(1)/usr
/share
/postgresql
169 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/phphtdocs
/bd_pgsql_purge.sh
$(1)/usr
/share
/postgresql
172 define Package
/bandwidthd-sqlite
/install
173 $(INSTALL_DIR
) $(1)/usr
/sbin
174 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
175 $(INSTALL_DIR
) $(1)/etc
/config
176 $(INSTALL_DATA
) .
/files
/bandwidthd-sqlite.config
$(1)/etc
/config
/bandwidthd
177 $(INSTALL_DIR
) $(1)/etc
/init.d
178 $(INSTALL_BIN
) .
/files
/bandwidthd-sqlite.init
$(1)/etc
/init.d
/bandwidthd
179 $(INSTALL_DIR
) $(1)/www
/phphtdocs
180 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/phphtdocs
/
181 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/details.php
$(1)/www
/phphtdocs
/
182 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/footer.php
$(1)/www
/phphtdocs
/
183 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/graph.php
$(1)/www
/phphtdocs
/
184 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/include.php
$(1)/www
/phphtdocs
/
185 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/index.php
$(1)/www
/phphtdocs
/
186 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/phphtdocs
/logo.gif
187 ln
-s
/var
/etc
/bandwidthd-php.conf
$(1)/www
/phphtdocs
/config.conf.php
188 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/
189 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/logo.gif
192 define Package
/bandwidthd-php
/install
193 $(INSTALL_DIR
) $(1)/www
/phphtdocs
194 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/phphtdocs
/
195 $(INSTALL_DATA
) .
/files
/phphtdocs
/details.php
$(1)/www
/phphtdocs
/
196 $(INSTALL_DATA
) .
/files
/phphtdocs
/footer.php
$(1)/www
/phphtdocs
/
197 $(INSTALL_DATA
) .
/files
/phphtdocs
/graph.php
$(1)/www
/phphtdocs
/
198 $(INSTALL_DATA
) .
/files
/phphtdocs
/include.php
$(1)/www
/phphtdocs
/
199 $(INSTALL_DATA
) .
/files
/phphtdocs
/index.php
$(1)/www
/phphtdocs
/
200 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/phphtdocs
/logo.gif
201 ln
-s
/var
/etc
/bandwidthd-php.conf
$(1)/www
/phphtdocs
/config.conf
202 $(INSTALL_DIR
) $(1)//etc
/config
203 $(INSTALL_CONF
) .
/files
/bandwidthd-php.config
$(1)/etc
/config
/bandwidthd-php
204 $(INSTALL_DIR
) $(1)/etc
/init.d
205 $(INSTALL_BIN
) .
/files
/bandwidthd-php.init
$(1)/etc
/init.d
/bandwidthd-php
208 define Package
/bandwidthd
/conffiles
209 /etc
/config
/bandwidthd
212 define Package
/bandwidthd-pgsql
/conffiles
213 /etc
/config
/bandwidthd
216 define Package
/bandwidthd-sqlite
/conffiles
217 /etc
/config
/bandwidthd
220 define Package
/bandwidthd-php
/conffiles
221 /etc
/config
/bandwidthd-php
224 $(eval
$(call BuildPackage
,bandwidthd
))
225 $(eval
$(call BuildPackage
,bandwidthd-pgsql
))
226 $(eval
$(call BuildPackage
,bandwidthd-sqlite
))
227 $(eval
$(call BuildPackage
,bandwidthd-php
))