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