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