-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
70 lines (56 loc) · 1.82 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
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openvpn-server
PKG_VERSION=1.3
PKG_RELEASE:=0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/luci-app-openvpn-server
SUBMENU:=OpenVPN Server
SECTION:=luci
CATEGORY:=LuCI
URL:=https://github.com/DavBfr/luci-app-openvpn-server
MAINTAINER:=David PHAM-VAN <dev.nfet.net@gmail.com>
SUBMENU:=3. Applications
DEPENDS:=+openvpn-openssl +openssl-util
TITLE:=OpenVPN Server
PKGARCH:=all
PKG_LICENSE:=APACHE_2
PKG_LICENSE_FILES:=LICENSE
endef
define Package/luci-app-openvpn-server/conffiles
/etc/openvpn
/etc/config/ovpnauth
endef
define Package/luci-app-openvpn-server/description
This package contains LuCI configuration pages to configure an OpenVPN Server.
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/luci-app-openvpn-server/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./src/gen_openvpn_server_keys.sh $(1)/usr/bin/
$(INSTALL_BIN) ./src/add_ovpn_user.sh $(1)/usr/bin/
$(INSTALL_BIN) ./src/ovpnauth.sh $(1)/usr/bin/
$(CP) ./src/ovpnauth.lua $(1)/usr/lib/lua/luci/controller/
$(CP) ./src/ovpnauth-mod.lua $(1)/usr/lib/lua/luci/model/cbi/
$(CP) ./src/ovpnauth.htm $(1)/usr/lib/lua/luci/view/
$(INSTALL_DATA) ./src/ovpnauth.config $(1)/etc/config/ovpnauth
endef
define Package/openvpn-$(BUILD_VARIANT)/conffiles
/etc/config/ovpnauth
endef
define Package/luci-app-openvpn-server/postinst
. /lib/functions/network.sh
uci set ovpnauth.settings.external_ip=$$(network_get_ipaddr ip wan;echo $$ip)
uci commit ovpnauth
/usr/bin/gen_openvpn_server_keys.sh
endef
$(eval $(call BuildPackage,luci-app-openvpn-server))