You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2016 Toke Høiland-Jørgensen
  3. #
  4. # This is free software, licensed under the GNU General Public License v3 or
  5. # later.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=acme
  9. PKG_VERSION:=2.8.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/Neilpang/acme.sh/tar.gz/$(PKG_VERSION)?
  13. PKG_HASH:=4fc55b2112058e563616893fefb56c5ff4895a7e6327e9f8416797fdc44d98e3
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/acme.sh-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
  16. PKG_LICENSE:=GPL-3.0-only
  17. PKG_LICENSE_FILES:=LICENSE.md
  18. LUCI_DIR:=/usr/lib/lua/luci
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/acme
  21. SECTION:=net
  22. CATEGORY:=Network
  23. DEPENDS:=+wget +ca-bundle +openssl-util +socat
  24. TITLE:=ACME (Letsencrypt) client
  25. URL:=https://acme.sh
  26. PKGARCH:=all
  27. endef
  28. define Package/acme/description
  29. A client for issuing Letsencrypt certificates.
  30. endef
  31. define Package/acme/conffiles
  32. /etc/config/acme
  33. /etc/acme
  34. endef
  35. define Build/Configure
  36. endef
  37. define Build/Compile
  38. endef
  39. define Package/acme/install
  40. $(INSTALL_DIR) $(1)/etc/acme
  41. $(INSTALL_DIR) $(1)/etc/config
  42. $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
  43. $(INSTALL_DIR) $(1)/etc/init.d
  44. $(INSTALL_BIN) ./files/acme.init $(1)/etc/init.d/acme
  45. $(INSTALL_DIR) $(1)/usr/lib/acme
  46. $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/acme/run-acme
  47. $(INSTALL_BIN) $(PKG_BUILD_DIR)/acme.sh $(1)/usr/lib/acme/acme.sh
  48. endef
  49. define Package/acme-dnsapi
  50. SECTION:=net
  51. CATEGORY:=Network
  52. DEPENDS:=+acme
  53. TITLE:=DNS API integration for ACME (Letsencrypt) client
  54. PKGARCH:=all
  55. endef
  56. define Package/acme-dnsapi/description
  57. This package provides DNS API integration for ACME (Letsencrypt) client.
  58. endef
  59. define Package/acme-dnsapi/install
  60. $(INSTALL_DIR) $(1)/usr/lib/acme/dnsapi
  61. $(INSTALL_DATA) $(PKG_BUILD_DIR)/dnsapi/*.sh $(1)/usr/lib/acme/dnsapi
  62. endef
  63. define Package/luci-app-acme
  64. SECTION:=luci
  65. CATEGORY:=LuCI
  66. TITLE:=ACME package - LuCI interface
  67. DEPENDS:= lua luci-base +acme
  68. SUBMENU:=3. Applications
  69. PKGARCH:=all
  70. endef
  71. define Package/luci-app-acme/description
  72. Control the ACME Letsencrypt certificate interface
  73. endef
  74. define Package/luci-app-acme/install
  75. $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
  76. $(INSTALL_DATA) ./files/acme-controller.lua $(1)$(LUCI_DIR)/controller/acme.lua
  77. $(INSTALL_DATA) ./files/acme-cbi.lua $(1)$(LUCI_DIR)/model/cbi/acme.lua
  78. $(INSTALL_DIR) $(1)/etc/uci-defaults
  79. $(INSTALL_BIN) ./files/uci-defaults-acme $(1)/etc/uci-defaults/luci-acme
  80. endef
  81. define Package/luci-app-acme/postinst
  82. #!/bin/sh
  83. [ -x /etc/uci-defaults/luci-acme ] && /etc/uci-defaults/luci-acme || exit 0
  84. endef
  85. define Package/luci-app-acme/postrm
  86. #!/bin/sh
  87. which uci > /dev/null || exit 0
  88. uci -q get ucitrack.@acme[0] > /dev/null && {
  89. uci delete ucitrack.@acme[0]
  90. uci commit
  91. }
  92. exit 0
  93. endef
  94. $(eval $(call BuildPackage,acme))
  95. $(eval $(call BuildPackage,acme-dnsapi))
  96. $(eval $(call BuildPackage,luci-app-acme))