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
://codeload.github.com
/NethServer
/bandwidthd
/tar.gz
/$(PKG_VERSION
)?
16 PKG_HASH
:=75f526d9e81c5a543accbb9e197b6b582c293aa20d6cdfc8be5cef43046981c5
18 PKG_MAINTAINER
:=Jean-Michel Lacroix
<lacroix@lepine-lacroix.
info>
19 PKG_LICENSE
:=GPL-2.0
-or-later
24 include $(INCLUDE_DIR
)/package.mk
26 define Package
/bandwidthd
/Default
30 URL
:=http
://bandwidthd.sourceforge.net
/
33 define Package
/bandwidthd
34 $(call Package
/bandwidthd
/Default
)
35 TITLE
+= (without database
)
37 DEPENDS
:=+libgd
+libpcap
40 define Package
/bandwidthd-pgsql
41 $(call Package
/bandwidthd
/Default
)
42 TITLE
+= (with postgresql enabled
)
44 DEPENDS
:=+libgd
+libpcap
+libpq
47 define Package
/bandwidthd-sqlite
48 $(call Package
/bandwidthd
/Default
)
49 TITLE
+= (with sqlite enabled
)
51 DEPENDS
:=+libgd
+libpcap
+libsqlite3
+php8
+php8-cgi
+php8-mod-gd
+php8-mod-pdo
+php8-mod-pdo-sqlite
54 define Package
/bandwidthd-php
55 $(call Package
/bandwidthd
/Default
)
56 TITLE
= PHP files to graph bandwidthd data from postgresql
58 DEPENDS
:=+libpcre
+libxml2
+php8
+php8-cgi
+php8-mod-pgsql
+php8-mod-gd
61 define Package
/bandwidthd
/description
62 A bandwidthd tracking utility.
65 define Package
/bandwidthd-pgsql
/description
66 $(call Package
/bandwidthd
/description
)
67 With the ability to store in a postgresql database.
70 define Package
/bandwidthd-sqlite
/description
71 $(call Package
/bandwidthd
/description
)
72 With the ability to store in a sqlite database.
75 define Package
/bandwidthd-php
/description
76 PHP files to graph bandwidthd data from pgsql.
79 define Package
/bandwidthd
/daemon
80 This package contains bandwidthd
, a bandwidth tracking utility.
83 define Package
/bandwidthd-pgsql
/daemon
84 This package contains bandwidthd
, a bandwidth tracking utility.
87 define Package
/bandwidthd-sqlite
/daemon
88 This package contains bandwidthd
, a bandwidth tracking utility.
91 define Package
/bandwidthd-php
/daemon
92 This package contains the PHP files to graph the data from a pgsql database.
95 ifeq ($(BUILD_VARIANT
),no-db
)
97 ac_cv_file__sw_lib
=no \
98 ac_cv_file__sw_include
=no \
99 ac_cv_file__usr_pkg_lib
=no \
100 ac_cv_file__usr_pkg_include
=no \
101 ac_cv_file__usr_local_pgsql_lib
=no \
102 ac_cv_file__usr_local_pgsql_include
=no \
103 ac_cv_lib_pq_PQconnectdb
=no \
104 ac_cv_lib_sqlite3_sqlite3_open
=no
107 ifeq ($(BUILD_VARIANT
),pgsql
)
109 ac_cv_file__sw_lib
=no \
110 ac_cv_file__sw_include
=no \
111 ac_cv_file__usr_pkg_lib
=no \
112 ac_cv_file__usr_pkg_include
=no \
113 ac_cv_file__usr_local_pgsql_lib
=no \
114 ac_cv_file__usr_local_pgsql_include
=no \
115 ac_cv_lib_sqlite3_sqlite3_open
=no
118 ifeq ($(BUILD_VARIANT
),sqlite
)
120 ac_cv_file__sw_lib
=no \
121 ac_cv_file__sw_include
=no \
122 ac_cv_file__usr_pkg_lib
=no \
123 ac_cv_file__usr_pkg_include
=no \
124 ac_cv_file__usr_local_pgsql_lib
=no \
125 ac_cv_file__usr_local_pgsql_include
=no \
126 ac_cv_lib_pq_PQconnectdb
=no
129 ifeq ($(BUILD_VARIANT
),php
)
131 ac_cv_file__sw_lib
=no \
132 ac_cv_file__sw_include
=no \
133 ac_cv_file__usr_pkg_lib
=no \
134 ac_cv_file__usr_pkg_include
=no \
135 ac_cv_file__usr_local_pgsql_lib
=no \
136 ac_cv_file__usr_local_pgsql_include
=no \
137 ac_cv_lib_pq_PQconnectdb
=no \
138 ac_cv_lib_sqlite3_sqlite3_open
=no
141 EXTRA_CFLAGS
+= $(TARGET_CPPFLAGS
) -fgnu89-inline
142 EXTRA_LDFLAGS
+= $(TARGET_LDFLAGS
)
144 define Package
/bandwidthd
/install
145 $(INSTALL_DIR
) $(1)/usr
/sbin
146 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
147 $(INSTALL_DIR
) $(1)/etc
/config
148 $(INSTALL_DATA
) .
/files
/bandwidthd.config
$(1)/etc
/config
/bandwidthd
149 $(INSTALL_DIR
) $(1)/etc
/init.d
150 $(INSTALL_BIN
) .
/files
/bandwidthd.init
$(1)/etc
/init.d
/bandwidthd
151 $(INSTALL_DIR
) $(1)/www
152 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/
153 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/logo.gif
156 define Package
/bandwidthd-pgsql
/install
157 $(INSTALL_DIR
) $(1)/usr
/sbin
158 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
159 $(INSTALL_DIR
) $(1)/etc
/config
160 $(INSTALL_DATA
) .
/files
/bandwidthd-pgsql.config
$(1)/etc
/config
/bandwidthd
161 $(INSTALL_DIR
) $(1)/etc
/init.d
162 $(INSTALL_BIN
) .
/files
/bandwidthd.init
$(1)/etc
/init.d
/bandwidthd
163 $(INSTALL_DIR
) $(1)/www
164 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/
165 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/logo.gif
166 $(INSTALL_DIR
) $(1)/usr
/share
/postgresql
167 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/phphtdocs
/bd_pgsql_purge.sh
$(1)/usr
/share
/postgresql
170 define Package
/bandwidthd-sqlite
/install
171 $(INSTALL_DIR
) $(1)/usr
/sbin
172 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
173 $(INSTALL_DIR
) $(1)/etc
/config
174 $(INSTALL_DATA
) .
/files
/bandwidthd-sqlite.config
$(1)/etc
/config
/bandwidthd
175 $(INSTALL_DIR
) $(1)/etc
/init.d
176 $(INSTALL_BIN
) .
/files
/bandwidthd-sqlite.init
$(1)/etc
/init.d
/bandwidthd
177 $(INSTALL_DIR
) $(1)/www
/phphtdocs
178 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/phphtdocs
/
179 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/details.php
$(1)/www
/phphtdocs
/
180 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/footer.php
$(1)/www
/phphtdocs
/
181 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/graph.php
$(1)/www
/phphtdocs
/
182 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/include.php
$(1)/www
/phphtdocs
/
183 $(INSTALL_DATA
) .
/files
/phphtdocs-sqlite
/index.php
$(1)/www
/phphtdocs
/
184 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/phphtdocs
/logo.gif
185 ln
-s
/var
/etc
/bandwidthd-php.conf
$(1)/www
/phphtdocs
/config.conf.php
186 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/
187 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/logo.gif
190 define Package
/bandwidthd-php
/install
191 $(INSTALL_DIR
) $(1)/www
/phphtdocs
192 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/phphtdocs
/legend.gif
$(1)/www
/phphtdocs
/
193 $(INSTALL_DATA
) .
/files
/phphtdocs
/details.php
$(1)/www
/phphtdocs
/
194 $(INSTALL_DATA
) .
/files
/phphtdocs
/footer.php
$(1)/www
/phphtdocs
/
195 $(INSTALL_DATA
) .
/files
/phphtdocs
/graph.php
$(1)/www
/phphtdocs
/
196 $(INSTALL_DATA
) .
/files
/phphtdocs
/include.php
$(1)/www
/phphtdocs
/
197 $(INSTALL_DATA
) .
/files
/phphtdocs
/index.php
$(1)/www
/phphtdocs
/
198 $(INSTALL_DATA
) .
/files
/logo-openwrt.gif
$(1)/www
/phphtdocs
/logo.gif
199 ln
-s
/var
/etc
/bandwidthd-php.conf
$(1)/www
/phphtdocs
/config.conf
200 $(INSTALL_DIR
) $(1)//etc
/config
201 $(INSTALL_CONF
) .
/files
/bandwidthd-php.config
$(1)/etc
/config
/bandwidthd-php
202 $(INSTALL_DIR
) $(1)/etc
/init.d
203 $(INSTALL_BIN
) .
/files
/bandwidthd-php.init
$(1)/etc
/init.d
/bandwidthd-php
206 define Package
/bandwidthd
/conffiles
207 /etc
/config
/bandwidthd
210 define Package
/bandwidthd-pgsql
/conffiles
211 /etc
/config
/bandwidthd
214 define Package
/bandwidthd-sqlite
/conffiles
215 /etc
/config
/bandwidthd
218 define Package
/bandwidthd-php
/conffiles
219 /etc
/config
/bandwidthd-php
222 $(eval
$(call BuildPackage
,bandwidthd
))
223 $(eval
$(call BuildPackage
,bandwidthd-pgsql
))
224 $(eval
$(call BuildPackage
,bandwidthd-sqlite
))
225 $(eval
$(call BuildPackage
,bandwidthd-php
))