You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.5 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=bandwidthd
  9. PKG_VERSION:=2.0.1
  10. PKG_RELEASE:=5
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
  12. PKG_SOURCE_URL:=@SF/bandwidthd
  13. PKG_MD5SUM:=aa79aad7bd489fd2cae1f7dc086ca8b6
  14. PKG_MAINTAINER:=Jean-Michel Lacroix <lacroix@lepine-lacroix.info>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/bandwidthd/Default
  19. SECTION:=utils
  20. CATEGORY:=Utilities
  21. TITLE:=Bandwidthd
  22. URL:=http://bandwidthd.sourceforge.net/
  23. endef
  24. define Package/bandwidthd
  25. $(call Package/bandwidthd/Default)
  26. TITLE += (without postgresql)
  27. VARIANT:=no-pgsql
  28. DEPENDS:=+libgd +libpcap
  29. endef
  30. define Package/bandwidthd-pgsql
  31. $(call Package/bandwidthd/Default)
  32. TITLE += (with postgresql enabled)
  33. VARIANT:=pgsql
  34. DEPENDS:=+libgd +libpcap +libpq
  35. endef
  36. define Package/bandwidthd/description
  37. A bandwidthd tracking utility.
  38. endef
  39. define Package/bandwidthd-pgsql/description
  40. $(call Package/bandwidthd/description)
  41. With the ability to store in a postgresql database.
  42. endef
  43. define Package/bandwidthd/daemon
  44. This package contains bandwidthd a bandwith tracking utility.
  45. endef
  46. define Package/bandwidthd-pgsql/daemon
  47. This package contains bandwidthd a bandwith tracking utility.
  48. endef
  49. ifeq ($(BUILD_VARIANT),no-pgsql)
  50. CONFIGURE_ARGS += \
  51. ac_cv_file__sw_lib=no \
  52. ac_cv_file__sw_include=no \
  53. ac_cv_file__usr_pkg_lib=no \
  54. ac_cv_file__usr_pkg_include=no \
  55. ac_cv_file__usr_local_pgsql_lib=no \
  56. ac_cv_file__usr_local_pgsql_include=no \
  57. ac_cv_lib_pq_PQconnectdb=no
  58. endif
  59. ifeq ($(BUILD_VARIANT),pgsql)
  60. CONFIGURE_ARGS += \
  61. ac_cv_file__sw_lib=no \
  62. ac_cv_file__sw_include=no \
  63. ac_cv_file__usr_pkg_lib=no \
  64. ac_cv_file__usr_pkg_include=no \
  65. ac_cv_file__usr_local_pgsql_lib=no \
  66. ac_cv_file__usr_local_pgsql_include=no
  67. endif
  68. EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) -std=gnu89
  69. EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
  70. define Package/bandwidthd/install
  71. $(INSTALL_DIR) $(1)/usr/sbin
  72. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bandwidthd $(1)/usr/sbin/
  73. $(INSTALL_DIR) $(1)/etc/config
  74. $(INSTALL_DATA) ./files/bandwidthd.config $(1)/etc/config/bandwidthd
  75. $(INSTALL_DIR) $(1)/etc/init.d
  76. $(INSTALL_BIN) ./files/bandwidthd.init $(1)/etc/init.d/bandwidthd
  77. $(INSTALL_DIR) $(1)/www
  78. $(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/legend.gif $(1)/www/
  79. $(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/logo.gif $(1)/www/
  80. endef
  81. define Package/bandwidthd-pgsql/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bandwidthd $(1)/usr/sbin/
  84. $(INSTALL_DIR) $(1)/etc/config
  85. $(INSTALL_DATA) ./files/bandwidthd-pgsql.config $(1)/etc/config/bandwidthd
  86. $(INSTALL_DIR) $(1)/etc/init.d
  87. $(INSTALL_BIN) ./files/bandwidthd-pgsql.init $(1)/etc/init.d/bandwidthd
  88. $(INSTALL_DIR) $(1)/www/phphtdocs
  89. $(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/legend.gif $(1)/www/
  90. $(INSTALL_DATA) ./files/logo.gif $(1)/www/
  91. $(INSTALL_DIR) $(1)/usr/share/postgresql
  92. $(INSTALL_DATA) $(PKG_BUILD_DIR)/schema.postgresql $(1)/usr/share/postgresql
  93. $(INSTALL_BIN) $(PKG_BUILD_DIR)/phphtdocs/bd_pgsql_purge.sh $(1)/usr/share/postgresql
  94. endef
  95. define Package/bandwidthd/conffiles
  96. /etc/config/bandwidthd
  97. endef
  98. define Package/bandwidthd-pgsql/conffiles
  99. /etc/config/bandwidthd
  100. endef
  101. $(eval $(call BuildPackage,bandwidthd))
  102. $(eval $(call BuildPackage,bandwidthd-pgsql))