-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile
72 lines (56 loc) · 1.81 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (C) 2018 Jianhui Zhao
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=wifidog-ng
PKG_VERSION:=2.0.0
PKG_RELEASE:=1
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
include $(INCLUDE_DIR)/package.mk
define Package/wifidog-ng
SUBMENU:=Captive Portals
SECTION:=net
CATEGORY:=Network
TITLE:=Next generation WifiDog implemented in Lua
DEPENDS:=+kmod-wifidog-ng +libuci-lua +libubus-lua \
+ipset +dnsmasq-full +luasocket +lua-copas +lua-coxpcall +luasec
endef
define Package/wifidog-ng/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config \
$(1)/etc/wifidog-ng $(1)/etc/hotplug.d/dhcp $(1)/usr/lib/lua
$(INSTALL_BIN) ./files/wifidog-ng.lua $(1)/usr/bin/wifidog-ng
$(INSTALL_BIN) ./files/wifidog-ng.init $(1)/etc/init.d/wifidog-ng
$(INSTALL_CONF) ./files/wifidog-ng.config $(1)/etc/config/wifidog-ng
$(INSTALL_CONF) ./files/ssl.key $(1)/etc/wifidog-ng
$(INSTALL_CONF) ./files/ssl.crt $(1)/etc/wifidog-ng
$(INSTALL_DATA) ./files/wifidog-ng.hotplug $(1)/etc/hotplug.d/dhcp/00-wifidog-ng
$(CP) ./files/wifidog-ng $(1)/usr/lib/lua
endef
include $(INCLUDE_DIR)/kernel.mk
define KernelPackage/wifidog-ng
SUBMENU:=Other modules
TITLE:=Kernel module for wifidog-ng
DEPENDS:=+kmod-nf-nat +kmod-ipt-ipset
FILES:=$(PKG_BUILD_DIR)/wifidog-ng.ko
endef
define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)
$(CP) ./src/. $(PKG_BUILD_DIR)
endef
KERNEL_MAKE_FLAGS?= \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)"
MAKE_OPTS:= \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)"
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules
endef
$(eval $(call BuildPackage,wifidog-ng))
$(eval $(call KernelPackage,wifidog-ng))