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.

103 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2014-2017 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:=wifidog-ng
  9. PKG_VERSION:=1.2.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_VERSION:=v$(PKG_VERSION)
  13. PKG_SOURCE_URL=https://github.com/zhaojh329/wifidog-ng.git
  14. PKG_MIRROR_HASH:=d8e6749e8f8c788043cd8261b55f41e4dae6a5f7fa88aeca8c9613c88a602006
  15. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
  16. PKG_LICENSE:=LGPL-2.1
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/wifidog-ng/default
  22. SUBMENU:=Captive Portals
  23. SECTION:=net
  24. CATEGORY:=Network
  25. TITLE:=Next generation WifiDog
  26. DEPENDS:=+kmod-wifidog-ng +libuci +libuclient +libblobmsg-json +libubus +libcares
  27. endef
  28. define Package/wifidog-ng-nossl
  29. $(Package/wifidog-ng/default)
  30. TITLE += (NO SSL)
  31. DEPENDS += +libuhttpd-nossl
  32. VARIANT:=nossl
  33. CONFLICTS:=wifidog-ng-openssl wifidog-ng-wolfssl wifidog-ng-mbedtls
  34. endef
  35. define Package/wifidog-ng-openssl
  36. $(Package/wifidog-ng/default)
  37. TITLE += (openssl)
  38. DEPENDS += +libuhttpd-openssl
  39. VARIANT:=openssl
  40. CONFLICTS:=wifidog-ng-wolfssl wifidog-ng-mbedtls
  41. endef
  42. define Package/wifidog-ng-wolfssl
  43. $(Package/wifidog-ng/default)
  44. TITLE += (wolfssl)
  45. DEPENDS += +libuhttpd-wolfssl
  46. VARIANT:=wolfssl
  47. CONFLICTS:=wifidog-ng-mbedtls
  48. endef
  49. define Package/wifidog-ng-mbedtls
  50. $(Package/wifidog-ng/default)
  51. TITLE += (mbedtls)
  52. DEPENDS += +libuhttpd-mbedtls
  53. VARIANT:=mbedtls
  54. endef
  55. define Package/wifidog-ng/default/install
  56. $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config $(1)/etc/wifidog-ng
  57. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wifidog-ng $(1)/usr/bin
  58. $(INSTALL_BIN) ./files/wifidog-ng.init $(1)/etc/init.d/wifidog-ng
  59. $(INSTALL_CONF) ./files/wifidog-ng.config $(1)/etc/config/wifidog-ng
  60. $(INSTALL_CONF) ./files/wifidog-ng.key $(1)/etc/wifidog-ng
  61. $(INSTALL_CONF) ./files/wifidog-ng.crt $(1)/etc/wifidog-ng
  62. endef
  63. Package/wifidog-ng-nossl/install = $(Package/wifidog-ng/default/install)
  64. Package/wifidog-ng-openssl/install = $(Package/wifidog-ng/default/install)
  65. Package/wifidog-ng-wolfssl/install = $(Package/wifidog-ng/default/install)
  66. Package/wifidog-ng-mbedtls/install = $(Package/wifidog-ng/default/install)
  67. include $(INCLUDE_DIR)/kernel.mk
  68. define KernelPackage/wifidog-ng
  69. SUBMENU:=Other modules
  70. TITLE:=Kernel module for wifidog-ng
  71. DEPENDS:=+kmod-nf-nat
  72. FILES:=$(PKG_BUILD_DIR)/kmod/wifidog-ng.ko
  73. endef
  74. include $(INCLUDE_DIR)/kernel-defaults.mk
  75. define Build/Compile
  76. $(call Build/Compile/Default)
  77. $(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)"/kmod modules
  78. endef
  79. $(eval $(call BuildPackage,wifidog-ng-nossl))
  80. $(eval $(call BuildPackage,wifidog-ng-mbedtls))
  81. $(eval $(call BuildPackage,wifidog-ng-wolfssl))
  82. $(eval $(call BuildPackage,wifidog-ng-openssl))
  83. $(eval $(call KernelPackage,wifidog-ng))