2 # Copyright (C) 2006-2015 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
).tgz
15 PKG_SOURCE_URL
:=@SF
/bandwidthd
16 PKG_MD5SUM
:=aa79aad7bd489fd2cae1f7dc086ca8b6
18 PKG_MAINTAINER
:=Jean-Michel Lacroix
<lacroix@lepine-lacroix.
info>
22 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
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 postgresql
)
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
/description
48 A bandwidthd tracking utility.
51 define Package
/bandwidthd-pgsql
/description
52 $(call Package
/bandwidthd
/description
)
53 With the ability to store in a postgresql database.
56 define Package
/bandwidthd
/daemon
57 This package contains bandwidthd a bandwidth tracking utility.
60 define Package
/bandwidthd-pgsql
/daemon
61 This package contains bandwidthd a bandwidth tracking utility.
64 ifeq ($(BUILD_VARIANT
),no-pgsql
)
66 ac_cv_file__sw_lib
=no \
67 ac_cv_file__sw_include
=no \
68 ac_cv_file__usr_pkg_lib
=no \
69 ac_cv_file__usr_pkg_include
=no \
70 ac_cv_file__usr_local_pgsql_lib
=no \
71 ac_cv_file__usr_local_pgsql_include
=no \
72 ac_cv_lib_pq_PQconnectdb
=no
75 ifeq ($(BUILD_VARIANT
),pgsql
)
77 ac_cv_file__sw_lib
=no \
78 ac_cv_file__sw_include
=no \
79 ac_cv_file__usr_pkg_lib
=no \
80 ac_cv_file__usr_pkg_include
=no \
81 ac_cv_file__usr_local_pgsql_lib
=no \
82 ac_cv_file__usr_local_pgsql_include
=no
85 EXTRA_CFLAGS
+= $(TARGET_CPPFLAGS
) -std
=gnu89
86 EXTRA_LDFLAGS
+= $(TARGET_LDFLAGS
) -Wl
,-rpath-link
,$(STAGING_DIR
)/usr
/lib
88 define Package
/bandwidthd
/install
89 $(INSTALL_DIR
) $(1)/usr
/sbin
90 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
91 $(INSTALL_DIR
) $(1)/etc
/config
92 $(INSTALL_DATA
) .
/files
/bandwidthd.config
$(1)/etc
/config
/bandwidthd
93 $(INSTALL_DIR
) $(1)/etc
/init.d
94 $(INSTALL_BIN
) .
/files
/bandwidthd.init
$(1)/etc
/init.d
/bandwidthd
95 $(INSTALL_DIR
) $(1)/www
96 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/htdocs
/legend.gif
$(1)/www
/
97 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/htdocs
/logo.gif
$(1)/www
/
100 define Package
/bandwidthd-pgsql
/install
101 $(INSTALL_DIR
) $(1)/usr
/sbin
102 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bandwidthd
$(1)/usr
/sbin
/
103 $(INSTALL_DIR
) $(1)/etc
/config
104 $(INSTALL_DATA
) .
/files
/bandwidthd-pgsql.config
$(1)/etc
/config
/bandwidthd
105 $(INSTALL_DIR
) $(1)/etc
/init.d
106 $(INSTALL_BIN
) .
/files
/bandwidthd-pgsql.init
$(1)/etc
/init.d
/bandwidthd
107 $(INSTALL_DIR
) $(1)/www
/phphtdocs
108 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/htdocs
/legend.gif
$(1)/www
/
109 $(INSTALL_DATA
) .
/files
/logo.gif
$(1)/www
/
110 $(INSTALL_DIR
) $(1)/usr
/share
/postgresql
111 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/schema.postgresql
$(1)/usr
/share
/postgresql
112 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/phphtdocs
/bd_pgsql_purge.sh
$(1)/usr
/share
/postgresql
115 define Package
/bandwidthd
/conffiles
116 /etc
/config
/bandwidthd
119 define Package
/bandwidthd-pgsql
/conffiles
120 /etc
/config
/bandwidthd
123 $(eval
$(call BuildPackage
,bandwidthd
))
124 $(eval
$(call BuildPackage
,bandwidthd-pgsql
))