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.

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