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.

99 lines
3.1 KiB

  1. #
  2. # Copyright (C) 2019 Lucian Cristian <lucian.cristian@gmail.com>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=uacme
  9. PKG_VERSION:=1.7
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/ndilieto/uacme/tar.gz/upstream/$(PKG_VERSION)?
  13. PKG_HASH:=32ca99851194cadb16c05f3c5d32892b0b93fc247321de2b560fa0f667e6cf04
  14. PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
  15. PKG_LICENSE:=GPL-3.0-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-upstream-$(PKG_VERSION)
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_LIBCURL_GNUTLS \
  22. CONFIG_LIBCURL_MBEDTLS \
  23. CONFIG_LIBCURL_OPENSSL \
  24. CONFIG_LIBCURL_WOLFSSL \
  25. CONFIG_LIBCURL_NOSSL
  26. include $(INCLUDE_DIR)/package.mk
  27. define Package/uacme
  28. SECTION:=net
  29. CATEGORY:=Network
  30. DEPENDS:=+libcurl +LIBCURL_WOLFSSL:libmbedtls
  31. TITLE:=lightweight client for ACMEv2
  32. URL:=https://github.com/ndilieto/uacme
  33. endef
  34. define Package/uacme/Default/description
  35. lightweight client for the RFC8555 ACMEv2 protocol, written in plain C code
  36. with minimal dependencies (libcurl and one of GnuTLS, OpenSSL or mbedTLS).
  37. The ACMEv2 protocol allows a Certificate Authority (https://letsencrypt.org
  38. is a popular one) and an applicant to automate the process of verification
  39. and certificate issuance. The protocol also provides facilities for other
  40. certificate management functions, such as certificate revocation.
  41. endef
  42. define Package/uacme/config
  43. if PACKAGE_uacme && LIBCURL_WOLFSSL
  44. comment "libcurl uses WolfSSL; uacme will install mbedtls"
  45. comment "Choose another SSL lib in libcurl to avoid this"
  46. endif
  47. if PACKAGE_uacme && LIBCURL_NOSSL
  48. comment "libcurl is built without ssl; uacme needs ssl support"
  49. comment "Choose another SSL lib in libcurl to avoid this"
  50. endif
  51. endef
  52. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  53. CONFIGURE_ARGS+= \
  54. --disable-maintainer-mode \
  55. --disable-docs \
  56. --without-ualpn \
  57. $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls --without-mbedtls --without-openssl,) \
  58. $(if $(CONFIG_LIBCURL_MBEDTLS),--without-gnutls --with-mbedtls --without-openssl,) \
  59. $(if $(CONFIG_LIBCURL_OPENSSL),--without-gnutls --without-mbedtls --with-openssl,) \
  60. $(if $(CONFIG_LIBCURL_WOLFSSL),--without-gnutls --with-mbedtls --without-openssl,)
  61. define Package/uacme/conffiles
  62. /etc/config/acme
  63. /etc/acme
  64. endef
  65. define Package/uacme/install
  66. $(INSTALL_DIR) \
  67. $(1)/usr/sbin \
  68. $(1)/etc/acme \
  69. $(1)/etc/config \
  70. $(1)/etc/init.d \
  71. $(1)/usr/share/uacme
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uacme $(1)/usr/sbin/uacme
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/uacme/uacme.sh $(1)/usr/share/uacme/
  74. $(SED) '/^CHALLENGE_PATH=/d' $(1)/usr/share/uacme/uacme.sh
  75. $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
  76. $(INSTALL_BIN) ./files/run.sh $(1)/usr/share/uacme/run-uacme
  77. $(INSTALL_BIN) ./files/acme.init $(1)/etc/init.d/acme
  78. endef
  79. define Package/uacme/prerm
  80. #!/bin/sh
  81. sed -i '/\/etc\/init\.d\/acme start/d' /etc/crontabs/root
  82. endef
  83. $(eval $(call BuildPackage,uacme))