Merge pull request #4336 from stangri/simple-adblock
[feed/packages.git] / admin / openwisp-config / Makefile
1 # openwisp.org
2 #
3 # This is free software, licensed under the GNU General Public License v3.
4 # See /LICENSE for more information.
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=openwisp-config
8 PKG_VERSION:=0.4.5
9 PKG_RELEASE:=1
10
11 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
12 PKG_SOURCE_PROTO:=git
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
14 PKG_SOURCE_URL:=https://github.com/openwisp/openwisp-config.git
15 PKG_SOURCE_VERSION:=0.4.5
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
17 PKG_MIRROR_HASH:=017a8ed35ebfda2805426e7da02559d5cc2845ee9ded60fdae8e848d377424fb
18 PKG_LICENSE:=GPL-3.0
19 PKGARCH:=all
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/openwisp-config/default
24 TITLE:=Remote configuration management agent ($(2) variant)
25 CATEGORY:=Administration
26 SECTION:=admin
27 SUBMENU:=openwisp
28 DEPENDS:=+curl +lua +libuci-lua +luafilesystem $(3)
29 VARIANT:=$(1)
30 MAINTAINER:=Federico Capoano <f.capoano@cineca.it>
31 URL:=http://openwisp.org
32 endef
33
34 Package/openwisp-config-openssl=$(call Package/openwisp-config/default,openssl,OpenSSL,+ca-certificates +libopenssl)
35 Package/openwisp-config-mbedtls=$(call Package/openwisp-config/default,mbedtls,mbedTLS,+ca-certificates +libmbedtls)
36 Package/openwisp-config-cyassl=$(call Package/openwisp-config/default,cyassl,CyaSSL,+ca-certificates +libcyassl)
37 # deprecated on recent versions of OpenWRT (>= Designated Driver) and LEDE (>= 17.01)
38 Package/openwisp-config-polarssl=$(call Package/openwisp-config/default,polarssl,PolarSSL,+ca-certificates +libpolarssl)
39 Package/openwisp-config-nossl=$(call Package/openwisp-config/default,nossl,No SSL)
40
41 define Build/Compile
42 endef
43
44 define Package/openwisp-config-$(BUILD_VARIANT)/conffiles
45 /etc/config/openwisp
46 endef
47
48 ifeq ($(BUILD_VARIANT),openssl)
49 CONFIG_OPENWISP_UCI:=ssl
50 endif
51 ifeq ($(BUILD_VARIANT),mbedtls)
52 CONFIG_OPENWISP_UCI:=ssl
53 endif
54 ifeq ($(BUILD_VARIANT),cyassl)
55 CONFIG_OPENWISP_UCI:=ssl
56 endif
57 ifeq ($(BUILD_VARIANT),polarssl)
58 CONFIG_OPENWISP_UCI:=ssl
59 endif
60 ifeq ($(BUILD_VARIANT),nossl)
61 CONFIG_OPENWISP_UCI:=nossl
62 endif
63
64
65 define Package/openwisp-config-$(BUILD_VARIANT)/install
66 $(INSTALL_DIR) \
67 $(1)/usr/sbin \
68 $(1)/etc/init.d \
69 $(1)/etc/config \
70 $(1)/etc/openwisp \
71 $(1)/usr/lib/lua/openwisp
72
73 $(INSTALL_BIN) \
74 $(PKG_BUILD_DIR)/openwisp-config/files/openwisp.agent \
75 $(1)/usr/sbin/openwisp_config
76
77 $(INSTALL_BIN) \
78 $(PKG_BUILD_DIR)/openwisp-config/files/openwisp.init \
79 $(1)/etc/init.d/openwisp_config
80
81 $(INSTALL_CONF) $(PKG_BUILD_DIR)/openwisp-config/files/openwisp-$(CONFIG_OPENWISP_UCI).config \
82 $(1)/etc/config/openwisp
83
84 $(INSTALL_BIN) \
85 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-reload-config \
86 $(1)/usr/sbin/openwisp-reload-config
87
88 $(INSTALL_BIN) \
89 $(PKG_BUILD_DIR)/openwisp-config/files/lib/openwisp/utils.lua \
90 $(1)/usr/lib/lua/openwisp/utils.lua
91
92 $(INSTALL_BIN) \
93 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-store-unmanaged.lua \
94 $(1)/usr/sbin/openwisp-store-unmanaged
95
96 $(INSTALL_BIN) \
97 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-restore-unmanaged.lua \
98 $(1)/usr/sbin/openwisp-restore-unmanaged
99
100 $(INSTALL_BIN) \
101 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-remove-default-wifi.lua \
102 $(1)/usr/sbin/openwisp-remove-default-wifi
103
104 $(INSTALL_BIN) \
105 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-uci-autoname.lua \
106 $(1)/usr/sbin/openwisp-uci-autoname
107
108 $(INSTALL_BIN) \
109 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-update-config.lua \
110 $(1)/usr/sbin/openwisp-update-config
111
112 $(CP) $(PKG_BUILD_DIR)/VERSION $(1)/etc/openwisp/
113 endef
114
115 $(eval $(call BuildPackage,openwisp-config-openssl))
116 $(eval $(call BuildPackage,openwisp-config-mbedtls))
117 $(eval $(call BuildPackage,openwisp-config-cyassl))
118 $(eval $(call BuildPackage,openwisp-config-polarssl))
119 $(eval $(call BuildPackage,openwisp-config-nossl))