Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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:=6d84da588b98733dd9c4f5b88440281ab1eb4989
  10. PKG_VERSION:=1.4
  11. PKG_RELEASE:=1
  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-certificates +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/config
  41. $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
  42. $(INSTALL_DIR) $(1)/etc/init.d
  43. $(INSTALL_BIN) ./files/acme.init $(1)/etc/init.d/acme
  44. $(INSTALL_DIR) $(1)/usr/lib/acme
  45. $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/acme/run-acme
  46. $(INSTALL_BIN) $(PKG_BUILD_DIR)/acme.sh $(1)/usr/lib/acme/acme.sh
  47. endef
  48. define Package/luci-app-acme
  49. SECTION:=luci
  50. CATEGORY:=LuCI
  51. TITLE:=ACME package - LuCI interface
  52. MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
  53. PKGARCH:=all
  54. DEPENDS:= lua luci-base +acme luci-app-uhttpd
  55. SUBMENU:=3. Applications
  56. endef
  57. define Package/luci-app-acme/description
  58. Control the ACME Letsencrypt certificate interface
  59. endef
  60. define Package/luci-app-acme/install
  61. $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
  62. $(INSTALL_DATA) ./files/acme-controller.lua $(1)$(LUCI_DIR)/controller/acme.lua
  63. $(INSTALL_DATA) ./files/acme-cbi.lua $(1)$(LUCI_DIR)/model/cbi/acme.lua
  64. $(INSTALL_DIR) $(1)/etc/uci-defaults
  65. $(INSTALL_BIN) ./files/uci-defaults-acme $(1)/etc/uci-defaults/luci-acme
  66. endef
  67. define Package/luci-app-acme/postinst
  68. #!/bin/sh
  69. [ -x /etc/uci-defaults/luci-acme ] && /etc/uci-defaults/luci-acme || exit 0
  70. endef
  71. define Package/luci-app-acme/postrm
  72. #!/bin/sh
  73. which uci > /dev/null || exit 0
  74. uci -q get ucitrack.@acme[0] > /dev/null && {
  75. uci delete ucitrack.@acme[0]
  76. uci commit
  77. }
  78. endef
  79. $(eval $(call BuildPackage,acme))
  80. $(eval $(call BuildPackage,luci-app-acme))