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.

93 lines
3.0 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.0.22
  10. PKG_RELEASE:=1
  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:=08070779232c9711a227189ee2d3cb55042f6be2ea0aa59525cb7b554c4688b0
  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. $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls --without-mbedtls --without-openssl,) \
  57. $(if $(CONFIG_LIBCURL_MBEDTLS),--without-gnutls --with-mbedtls --without-openssl,) \
  58. $(if $(CONFIG_LIBCURL_OPENSSL),--without-gnutls --without-mbedtls --with-openssl,) \
  59. $(if $(CONFIG_LIBCURL_WOLFSSL),--without-gnutls --with-mbedtls --without-openssl,)
  60. define Package/uacme/conffiles
  61. /etc/config/acme
  62. /etc/acme
  63. endef
  64. define Package/uacme/install
  65. $(INSTALL_DIR) \
  66. $(1)/usr/sbin \
  67. $(1)/etc/acme \
  68. $(1)/etc/config \
  69. $(1)/etc/init.d \
  70. $(1)/usr/share/uacme
  71. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uacme $(1)/usr/sbin/uacme
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/uacme/uacme.sh $(1)/usr/share/uacme/
  73. $(SED) '/^CHALLENGE_PATH=/d' $(1)/usr/share/uacme/uacme.sh
  74. $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
  75. $(INSTALL_BIN) ./files/run.sh $(1)/usr/share/uacme/run-uacme
  76. $(INSTALL_BIN) ./files/acme.init $(1)/etc/init.d/acme
  77. endef
  78. $(eval $(call BuildPackage,uacme))