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.

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