ddns-scripts: fix wget-ssl path
[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:=2
10
11 PKG_SOURCE_PROTO:=git
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
13 PKG_SOURCE_URL:=https://github.com/openwisp/openwisp-config.git
14 PKG_SOURCE_VERSION:=0.4.5
15 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
16 PKG_MIRROR_HASH:=017a8ed35ebfda2805426e7da02559d5cc2845ee9ded60fdae8e848d377424fb
17 PKG_LICENSE:=GPL-3.0
18 PKGARCH:=all
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/openwisp-config/default
23 TITLE:=Remote configuration management agent ($(2) variant)
24 CATEGORY:=Administration
25 SECTION:=admin
26 SUBMENU:=OpenWISP
27 DEPENDS:=+curl +lua +libuci-lua +luafilesystem $(3)
28 VARIANT:=$(1)
29 MAINTAINER:=Federico Capoano <f.capoano@cineca.it>
30 URL:=http://openwisp.org
31 endef
32
33 Package/openwisp-config-openssl=$(call Package/openwisp-config/default,openssl,OpenSSL,+ca-certificates +libopenssl)
34 Package/openwisp-config-mbedtls=$(call Package/openwisp-config/default,mbedtls,mbedTLS,+ca-certificates +libmbedtls)
35 Package/openwisp-config-cyassl=$(call Package/openwisp-config/default,cyassl,CyaSSL,+ca-certificates +libcyassl)
36 Package/openwisp-config-nossl=$(call Package/openwisp-config/default,nossl,No SSL)
37
38 define Build/Compile
39 endef
40
41 define Package/openwisp-config-$(BUILD_VARIANT)/conffiles
42 /etc/config/openwisp
43 endef
44
45 ifeq ($(BUILD_VARIANT),openssl)
46 CONFIG_OPENWISP_UCI:=ssl
47 endif
48 ifeq ($(BUILD_VARIANT),mbedtls)
49 CONFIG_OPENWISP_UCI:=ssl
50 endif
51 ifeq ($(BUILD_VARIANT),cyassl)
52 CONFIG_OPENWISP_UCI:=ssl
53 endif
54 ifeq ($(BUILD_VARIANT),nossl)
55 CONFIG_OPENWISP_UCI:=nossl
56 endif
57
58
59 define Package/openwisp-config-$(BUILD_VARIANT)/install
60 $(INSTALL_DIR) \
61 $(1)/usr/sbin \
62 $(1)/etc/init.d \
63 $(1)/etc/config \
64 $(1)/etc/openwisp \
65 $(1)/usr/lib/lua/openwisp
66
67 $(INSTALL_BIN) \
68 $(PKG_BUILD_DIR)/openwisp-config/files/openwisp.agent \
69 $(1)/usr/sbin/openwisp_config
70
71 $(INSTALL_BIN) \
72 $(PKG_BUILD_DIR)/openwisp-config/files/openwisp.init \
73 $(1)/etc/init.d/openwisp_config
74
75 $(INSTALL_CONF) $(PKG_BUILD_DIR)/openwisp-config/files/openwisp-$(CONFIG_OPENWISP_UCI).config \
76 $(1)/etc/config/openwisp
77
78 $(INSTALL_BIN) \
79 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-reload-config \
80 $(1)/usr/sbin/openwisp-reload-config
81
82 $(INSTALL_BIN) \
83 $(PKG_BUILD_DIR)/openwisp-config/files/lib/openwisp/utils.lua \
84 $(1)/usr/lib/lua/openwisp/utils.lua
85
86 $(INSTALL_BIN) \
87 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-store-unmanaged.lua \
88 $(1)/usr/sbin/openwisp-store-unmanaged
89
90 $(INSTALL_BIN) \
91 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-restore-unmanaged.lua \
92 $(1)/usr/sbin/openwisp-restore-unmanaged
93
94 $(INSTALL_BIN) \
95 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-remove-default-wifi.lua \
96 $(1)/usr/sbin/openwisp-remove-default-wifi
97
98 $(INSTALL_BIN) \
99 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-uci-autoname.lua \
100 $(1)/usr/sbin/openwisp-uci-autoname
101
102 $(INSTALL_BIN) \
103 $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-update-config.lua \
104 $(1)/usr/sbin/openwisp-update-config
105
106 $(CP) $(PKG_BUILD_DIR)/VERSION $(1)/etc/openwisp/
107 endef
108
109 $(eval $(call BuildPackage,openwisp-config-openssl))
110 $(eval $(call BuildPackage,openwisp-config-mbedtls))
111 $(eval $(call BuildPackage,openwisp-config-cyassl))
112 $(eval $(call BuildPackage,openwisp-config-nossl))