gnutls: updated to 3.8.3
[feed/packages.git] / libs / gnutls / Makefile
1 # SPDX-Identifier-License: GPL-2.0-only
2 #
3 # Copyright (C) 2005-2016 OpenWrt.org
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=gnutls
9 PKG_VERSION:=3.8.3
10 PKG_RELEASE:=1
11 PKG_BUILD_FLAGS:=no-mips16
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
14 PKG_SOURCE_URL:=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8
15 PKG_HASH:=f74fc5954b27d4ec6dfbb11dea987888b5b124289a3703afcada0ee520f4173e
16
17 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
18 PKG_LICENSE:=LGPL-2.1-or-later
19 PKG_LICENSE_FILES:=LICENSE
20 PKG_CPE_ID:=cpe:/a:gnu:gnutls
21
22 PKG_BUILD_DEPENDS:=gettext-full/host
23 PKG_BUILD_PARALLEL:=1
24 PKG_FIXUP:=autoreconf gettext-version
25 PKG_INSTALL:=1
26 PKG_LIBTOOL_PATHS:=. lib
27
28 PKG_CONFIG_DEPENDS:= \
29 CONFIG_GNUTLS_ALPN \
30 CONFIG_GNUTLS_ANON \
31 CONFIG_GNUTLS_CRYPTODEV \
32 CONFIG_GNUTLS_DTLS_SRTP \
33 CONFIG_GNUTLS_EXT_LIBTASN1 \
34 CONFIG_GNUTLS_HEARTBEAT \
35 CONFIG_GNUTLS_OCSP \
36 CONFIG_GNUTLS_PKCS11 \
37 CONFIG_GNUTLS_PSK \
38 CONFIG_GNUTLS_SRP \
39 CONFIG_GNUTLS_TPM \
40 CONFIG_LIBNETTLE_MINI \
41 CONFIG_PACKAGE_libgnutls-dane \
42
43 include $(INCLUDE_DIR)/package.mk
44
45
46 define Package/gnutls/Default
47 SUBMENU:=SSL
48 SECTION:=libs
49 CATEGORY:=Libraries
50 TITLE:=GNU TLS
51 URL:=http://www.gnutls.org/
52 endef
53
54 define Package/gnutls/Default/description
55 GnuTLS is a secure communications library implementing the SSL, TLS
56 and DTLS protocols and technologies around them. It provides a simple
57 C language application programming interface (API) to access the secure
58 communications protocols as well as APIs to parse and write X.509, PKCS12,
59 OpenPGP and other required structures. It is aimed to be portable and
60 efficient with focus on security and interoperability.
61 endef
62
63
64 define Package/certtool
65 $(call Package/gnutls/Default)
66 SECTION:=utils
67 CATEGORY:=Utilities
68 SUBMENU:=Encryption
69 TITLE+= (certool utility)
70 DEPENDS+= +libgnutls
71 endef
72
73 define Package/certtool/description
74 $(call Package/gnutls/Default/description)
75 This package contains the GnuTLS certtool utility.
76 endef
77
78
79 define Package/gnutls-utils
80 $(call Package/gnutls/Default)
81 SECTION:=utils
82 CATEGORY:=Utilities
83 SUBMENU:=Encryption
84 TITLE+= (utilities)
85 DEPENDS+= +libgnutls +PACKAGE_libgnutls-dane:libgnutls-dane
86 endef
87
88 define Package/gnutls-utils/description
89 $(call Package/gnutls/Default/description)
90 This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
91 and srptool utilities.
92 endef
93
94 define Package/libgnutls/config
95 source "$(SOURCE)/Config.in"
96 endef
97
98 define Package/libgnutls
99 $(call Package/gnutls/Default)
100 TITLE+= (library)
101 DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit +GNUTLS_CRYPTODEV:kmod-cryptodev +libatomic
102 endef
103
104 define Package/libgnutls-dane
105 $(call Package/gnutls/Default)
106 TITLE+= (libgnutls-dane library)
107 DEPENDS:= +libgnutls +PACKAGE_libgnutls-dane:libunbound
108 endef
109
110 define Package/libgnutls/description
111 $(call Package/gnutls/Default/description)
112 This package contains the GnuTLS shared library, needed by other programs.
113 endef
114
115 # We disable the configuration file (system-priority-file) because
116 # the use of configuration increases the non-shared memory used by
117 # the library and we don't provide an openwrt-specific configuration
118 # anyway.
119 CONFIGURE_ARGS+= \
120 --enable-shared \
121 --enable-static \
122 --disable-doc \
123 --disable-gcc-warnings \
124 --disable-guile \
125 --disable-rpath \
126 --disable-seccomp-tests \
127 --disable-tests \
128 --disable-valgrind-tests \
129 --disable-ssl2-support \
130 --disable-ssl3-support \
131 --enable-local-libopts \
132 --without-idn \
133 --with-default-trust-store-dir=/etc/ssl/certs/ \
134 --with-included-unistring \
135 --with-included-libunistring \
136 --with-librt-prefix="$(LIBRT_ROOT_DIR)/" \
137 --with-pic \
138 --with-system-priority-file="" \
139 --without-brotli \
140 --without-zlib \
141 --without-zstd
142
143 ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
144 CONFIGURE_ARGS += --with-included-libtasn1
145 endif
146
147 ifneq ($(CONFIG_GNUTLS_PKCS11),y)
148 CONFIGURE_ARGS += --without-p11-kit
149 endif
150
151 ifeq ($(CONFIG_LIBNETTLE_MINI),y)
152 CONFIGURE_ARGS += --with-nettle-mini
153 endif
154
155 ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
156 CONFIGURE_ARGS += --disable-dtls-srtp-support
157 endif
158
159 ifneq ($(CONFIG_GNUTLS_ALPN),y)
160 CONFIGURE_ARGS += --disable-alpn-support
161 endif
162
163 ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
164 CONFIGURE_ARGS += --disable-heartbeat-support
165 endif
166
167 ifneq ($(CONFIG_GNUTLS_SRP),y)
168 CONFIGURE_ARGS += --disable-srp-authentication
169 endif
170
171 ifneq ($(CONFIG_GNUTLS_PSK),y)
172 CONFIGURE_ARGS += --disable-psk-authentication
173 endif
174
175 ifneq ($(CONFIG_GNUTLS_ANON),y)
176 CONFIGURE_ARGS += --disable-anon-authentication
177 endif
178
179 ifneq ($(CONFIG_GNUTLS_OCSP),y)
180 CONFIGURE_ARGS += --disable-ocsp
181 endif
182
183 ifneq ($(CONFIG_GNUTLS_TPM),y)
184 CONFIGURE_ARGS += --without-tpm
185 endif
186
187 ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
188 CONFIGURE_ARGS += --enable-cryptodev
189 endif
190
191 ifeq ($(CONFIG_PACKAGE_libgnutls-dane),)
192 CONFIGURE_ARGS += --disable-libdane
193 endif
194
195 define Build/InstallDev
196 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
197 $(CP) \
198 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
199 $(1)/usr/lib/
200 $(CP) \
201 $(PKG_INSTALL_DIR)/usr/include/gnutls \
202 $(1)/usr/include/
203 $(CP) \
204 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
205 $(1)/usr/lib/pkgconfig/
206 endef
207
208
209 define Package/certtool/conffiles
210 /etc/gnutls/certtool.cfg
211 endef
212
213 define Package/certtool/install
214 $(INSTALL_DIR) $(1)/etc/gnutls
215 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
216 $(INSTALL_DIR) $(1)/usr/bin
217 $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
218 endef
219
220
221 define Package/gnutls-utils/install
222 $(INSTALL_DIR) $(1)/usr/bin
223 ifeq ($(CONFIG_GNUTLS_OCSP),y)
224 ifeq ($(CONFIG_GNUTLS_ANON),y)
225 $(CP) \
226 $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
227 $(1)/usr/bin/
228 endif
229 $(CP) \
230 $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
231 $(1)/usr/bin/
232 endif
233 ifeq ($(CONFIG_GNUTLS_SRP),y)
234 $(CP) \
235 $(PKG_INSTALL_DIR)/usr/bin/srptool \
236 $(1)/usr/bin/
237 endif
238 ifeq ($(CONFIG_GNUTLS_PSK),y)
239 $(CP) \
240 $(PKG_INSTALL_DIR)/usr/bin/psktool \
241 $(1)/usr/bin/
242 endif
243 ifeq ($(CONFIG_GNUTLS_PKCS11),y)
244 $(CP) \
245 $(PKG_INSTALL_DIR)/usr/bin/p11tool \
246 $(1)/usr/bin/
247 endif
248 ifeq ($(CONFIG_GNUTLS_TPM),y)
249 $(CP) \
250 $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
251 $(1)/usr/bin/
252 endif
253 endef
254
255
256 define Package/libgnutls/install
257 $(INSTALL_DIR) $(1)/usr/lib
258 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
259 endef
260
261 define Package/libgnutls-dane/install
262 $(INSTALL_DIR) $(1)/usr/lib
263 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-dane.so.* $(1)/usr/lib/
264 endef
265
266
267 $(eval $(call BuildPackage,certtool))
268 $(eval $(call BuildPackage,gnutls-utils))
269 $(eval $(call BuildPackage,libgnutls))
270 $(eval $(call BuildPackage,libgnutls-dane))