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.

100 lines
2.8 KiB

  1. # Copyright (C) 2018 Jianhui Zhao
  2. #
  3. # This is free software, licensed under the GNU General Public License v2.
  4. # See /LICENSE for more information.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=wifidog-ng
  8. PKG_VERSION:=2.0.0
  9. PKG_RELEASE:=2
  10. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)
  11. PKG_LICENSE:=LGPL-2.1
  12. PKG_LICENSE_FILES:=LICENSE
  13. PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
  14. include $(INCLUDE_DIR)/package.mk
  15. define Package/wifidog-ng/default
  16. SUBMENU:=Captive Portals
  17. SECTION:=net
  18. CATEGORY:=Network
  19. TITLE:=Next generation WifiDog implemented in Lua
  20. DEPENDS:=+kmod-wifidog-ng +libubox-lua +libuci-lua +libubus-lua \
  21. +ipset +dnsmasq-full +luasocket
  22. endef
  23. define Package/wifidog-ng-nossl
  24. $(Package/wifidog-ng/default)
  25. TITLE += (NO SSL)
  26. DEPENDS += +libuhttpd-nossl
  27. VARIANT:=nossl
  28. CONFLICTS:=wifidog-ng-openssl wifidog-ng-wolfssl wifidog-ng-mbedtls
  29. endef
  30. define Package/wifidog-ng-openssl
  31. $(Package/wifidog-ng/default)
  32. TITLE += (openssl)
  33. DEPENDS += +libuhttpd-openssl
  34. VARIANT:=openssl
  35. CONFLICTS:=wifidog-ng-wolfssl wifidog-ng-mbedtls
  36. endef
  37. define Package/wifidog-ng-wolfssl
  38. $(Package/wifidog-ng/default)
  39. TITLE += (wolfssl)
  40. DEPENDS += +libuhttpd-wolfssl
  41. VARIANT:=wolfssl
  42. CONFLICTS:=wifidog-ng-mbedtls
  43. endef
  44. define Package/wifidog-ng-mbedtls
  45. $(Package/wifidog-ng/default)
  46. TITLE += (mbedtls)
  47. DEPENDS += +libuhttpd-mbedtls
  48. VARIANT:=mbedtls
  49. endef
  50. define Package/wifidog-ng/default/install
  51. $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config \
  52. $(1)/etc/wifidog-ng $(1)//etc/hotplug.d/dhcp $(1)/usr/lib/lua
  53. $(INSTALL_BIN) ./files//wifidog-ng.lua $(1)/usr/bin/wifidog-ng
  54. $(INSTALL_BIN) ./files/wifidog-ng.init $(1)/etc/init.d/wifidog-ng
  55. $(INSTALL_CONF) ./files/wifidog-ng.config $(1)/etc/config/wifidog-ng
  56. $(INSTALL_CONF) ./files/ssl.key $(1)/etc/wifidog-ng
  57. $(INSTALL_CONF) ./files/ssl.crt $(1)/etc/wifidog-ng
  58. $(INSTALL_DATA) ./files/wifidog-ng.hotplug $(1)/etc/hotplug.d/dhcp/00-wifidog-ng
  59. $(CP) ./files/wifidog-ng $(1)/usr/lib/lua
  60. endef
  61. Package/wifidog-ng-nossl/install = $(Package/wifidog-ng/default/install)
  62. Package/wifidog-ng-openssl/install = $(Package/wifidog-ng/default/install)
  63. Package/wifidog-ng-wolfssl/install = $(Package/wifidog-ng/default/install)
  64. Package/wifidog-ng-mbedtls/install = $(Package/wifidog-ng/default/install)
  65. include $(INCLUDE_DIR)/kernel.mk
  66. define KernelPackage/wifidog-ng
  67. SUBMENU:=Other modules
  68. TITLE:=Kernel module for wifidog-ng
  69. DEPENDS:=+kmod-nf-nat +kmod-ipt-ipset
  70. FILES:=$(PKG_BUILD_DIR)/wifidog-ng.ko
  71. endef
  72. include $(INCLUDE_DIR)/kernel-defaults.mk
  73. define Build/Compile
  74. $(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
  75. endef
  76. $(eval $(call BuildPackage,wifidog-ng-nossl))
  77. $(eval $(call BuildPackage,wifidog-ng-mbedtls))
  78. $(eval $(call BuildPackage,wifidog-ng-wolfssl))
  79. $(eval $(call BuildPackage,wifidog-ng-openssl))
  80. $(eval $(call KernelPackage,wifidog-ng))