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