fwknop: init script improvements
[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.0.20
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:=c9106e166156685fcf9f164f0b2935cf680251a653f460b04da26a290e946bf9
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 $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls --without-mbedtls --without-openssl,) \
68 $(if $(CONFIG_LIBCURL_MBEDTLS),--without-gnutls --with-mbedtls --without-openssl,) \
69 $(if $(CONFIG_LIBCURL_OPENSSL),--without-gnutls --without-mbedtls --with-openssl,) \
70 $(if $(CONFIG_LIBCURL_WOLFSSL),--without-gnutls --with-mbedtls --without-openssl,)
71
72 define Package/uacme/conffiles
73 /etc/config/acme
74 /etc/acme
75 endef
76
77 define Package/uacme/install
78 $(INSTALL_DIR) \
79 $(1)/usr/sbin \
80 $(1)/etc/acme \
81 $(1)/etc/config \
82 $(1)/etc/init.d \
83 $(1)/usr/share/uacme
84
85 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uacme $(1)/usr/sbin/uacme
86 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/uacme/uacme.sh $(1)/usr/share/uacme/
87 $(SED) '/^CHALLENGE_PATH=/d' $(1)/usr/share/uacme/uacme.sh
88 $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
89 $(INSTALL_BIN) ./files/run.sh $(1)/usr/share/uacme/run-uacme
90 $(INSTALL_BIN) ./files/acme.init $(1)/etc/init.d/acme
91 endef
92
93 $(eval $(call BuildPackage,uacme))