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.

113 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:=8
  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. PKGARCH:=all
  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:=+curl +ca-bundle +openssl-util +socat
  24. TITLE:=ACME (Letsencrypt) client
  25. endef
  26. define Package/acme/description
  27. A client for issuing Letsencrypt certificates.
  28. endef
  29. define Package/acme/conffiles
  30. /etc/config/acme
  31. /etc/acme
  32. endef
  33. define Build/Configure
  34. endef
  35. define Build/Compile
  36. endef
  37. define Package/acme/install
  38. $(INSTALL_DIR) $(1)/etc/acme
  39. $(INSTALL_DIR) $(1)/etc/config
  40. $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
  41. $(INSTALL_DIR) $(1)/etc/init.d
  42. $(INSTALL_BIN) ./files/acme.init $(1)/etc/init.d/acme
  43. $(INSTALL_DIR) $(1)/usr/lib/acme
  44. $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/acme/run-acme
  45. $(INSTALL_BIN) $(PKG_BUILD_DIR)/acme.sh $(1)/usr/lib/acme/acme.sh
  46. endef
  47. define Package/acme-dnsapi
  48. SECTION:=net
  49. CATEGORY:=Network
  50. DEPENDS:=+acme
  51. TITLE:=DNS API integration for ACME (Letsencrypt) client
  52. endef
  53. define Package/acme-dnsapi/description
  54. This package provides DNS API integration for ACME (Letsencrypt) client.
  55. endef
  56. define Package/acme-dnsapi/install
  57. $(INSTALL_DIR) $(1)/usr/lib/acme/dnsapi
  58. $(INSTALL_DATA) $(PKG_BUILD_DIR)/dnsapi/*.sh $(1)/usr/lib/acme/dnsapi
  59. endef
  60. define Package/luci-app-acme
  61. SECTION:=luci
  62. CATEGORY:=LuCI
  63. TITLE:=ACME package - LuCI interface
  64. DEPENDS:= lua luci-base +acme
  65. SUBMENU:=3. Applications
  66. endef
  67. define Package/luci-app-acme/description
  68. Control the ACME Letsencrypt certificate interface
  69. endef
  70. define Package/luci-app-acme/install
  71. $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
  72. $(INSTALL_DATA) ./files/acme-controller.lua $(1)$(LUCI_DIR)/controller/acme.lua
  73. $(INSTALL_DATA) ./files/acme-cbi.lua $(1)$(LUCI_DIR)/model/cbi/acme.lua
  74. $(INSTALL_DIR) $(1)/etc/uci-defaults
  75. $(INSTALL_BIN) ./files/uci-defaults-acme $(1)/etc/uci-defaults/luci-acme
  76. endef
  77. define Package/luci-app-acme/postinst
  78. #!/bin/sh
  79. [ -x /etc/uci-defaults/luci-acme ] && /etc/uci-defaults/luci-acme || exit 0
  80. endef
  81. define Package/luci-app-acme/postrm
  82. #!/bin/sh
  83. which uci > /dev/null || exit 0
  84. uci -q get ucitrack.@acme[0] > /dev/null && {
  85. uci delete ucitrack.@acme[0]
  86. uci commit
  87. }
  88. exit 0
  89. endef
  90. $(eval $(call BuildPackage,acme))
  91. $(eval $(call BuildPackage,acme-dnsapi))
  92. $(eval $(call BuildPackage,luci-app-acme))