1
0

Makefile 3.7 KB

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