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.

96 lines
2.4 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.8
  10. PKG_RELEASE:=1
  11. PKG_LICENSE:=GPLv3
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/Neilpang/acme.sh
  14. PKG_SOURCE_VERSION:=521d8c4b1f374c52ab1452d399a4d4910465e9fe
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
  16. PKG_MIRROR_HASH:=03e24eb41513b4d28dc42f5ae5c91be0030094149cbdbf9cdf9b6f87db9e36c0
  17. PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
  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 +netcat
  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/luci-app-acme
  48. SECTION:=luci
  49. CATEGORY:=LuCI
  50. TITLE:=ACME package - LuCI interface
  51. DEPENDS:= lua luci-base +acme luci-app-uhttpd
  52. SUBMENU:=3. Applications
  53. endef
  54. define Package/luci-app-acme/description
  55. Control the ACME Letsencrypt certificate interface
  56. endef
  57. define Package/luci-app-acme/install
  58. $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
  59. $(INSTALL_DATA) ./files/acme-controller.lua $(1)$(LUCI_DIR)/controller/acme.lua
  60. $(INSTALL_DATA) ./files/acme-cbi.lua $(1)$(LUCI_DIR)/model/cbi/acme.lua
  61. $(INSTALL_DIR) $(1)/etc/uci-defaults
  62. $(INSTALL_BIN) ./files/uci-defaults-acme $(1)/etc/uci-defaults/luci-acme
  63. endef
  64. define Package/luci-app-acme/postinst
  65. #!/bin/sh
  66. [ -x /etc/uci-defaults/luci-acme ] && /etc/uci-defaults/luci-acme || exit 0
  67. endef
  68. define Package/luci-app-acme/postrm
  69. #!/bin/sh
  70. which uci > /dev/null || exit 0
  71. uci -q get ucitrack.@acme[0] > /dev/null && {
  72. uci delete ucitrack.@acme[0]
  73. uci commit
  74. }
  75. exit 0
  76. endef
  77. $(eval $(call BuildPackage,acme))
  78. $(eval $(call BuildPackage,luci-app-acme))