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.

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