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.

107 lines
3.2 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.2
  9. PKG_RELEASE:=2
  10. PKG_LICENSE:=LGPL-2.1
  11. PKG_LICENSE_FILES:=LICENSE
  12. PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
  13. include $(INCLUDE_DIR)/kernel.mk
  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. define Package/wifidog-ng/default/conffiles
  62. /etc/config/wifidog-ng
  63. /etc/wifidog-ng
  64. endef
  65. Package/wifidog-ng-nossl/conffiles = $(Package/wifidog-ng/default/conffiles)
  66. Package/wifidog-ng-openssl/conffiles = $(Package/wifidog-ng/default/conffiles)
  67. Package/wifidog-ng-wolfssl/conffiles = $(Package/wifidog-ng/default/conffiles)
  68. Package/wifidog-ng-mbedtls/conffiles = $(Package/wifidog-ng/default/conffiles)
  69. Package/wifidog-ng-nossl/install = $(Package/wifidog-ng/default/install)
  70. Package/wifidog-ng-openssl/install = $(Package/wifidog-ng/default/install)
  71. Package/wifidog-ng-wolfssl/install = $(Package/wifidog-ng/default/install)
  72. Package/wifidog-ng-mbedtls/install = $(Package/wifidog-ng/default/install)
  73. define KernelPackage/wifidog-ng
  74. SUBMENU:=Other modules
  75. TITLE:=Kernel module for wifidog-ng
  76. DEPENDS:=+kmod-nf-nat +kmod-ipt-ipset
  77. FILES:=$(PKG_BUILD_DIR)/wifidog-ng.ko
  78. endef
  79. include $(INCLUDE_DIR)/kernel-defaults.mk
  80. define Build/Compile
  81. $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)" modules
  82. endef
  83. $(eval $(call BuildPackage,wifidog-ng-nossl))
  84. $(eval $(call BuildPackage,wifidog-ng-mbedtls))
  85. $(eval $(call BuildPackage,wifidog-ng-wolfssl))
  86. $(eval $(call BuildPackage,wifidog-ng-openssl))
  87. $(eval $(call KernelPackage,wifidog-ng))