Merge pull request #3228 from mhei/ser2net-update
[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.5.4
12 PKG_RELEASE:=3
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.5
17 PKG_MD5SUM:=c17e20d0f6b040580df57f5f94e3610f
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_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 TITLE+= (certool utility)
67 DEPENDS+= +libgnutls
68 endef
69
70 define Package/certtool/description
71 $(call Package/gnutls/Default/description)
72 This package contains the GnuTLS certtool utility.
73 endef
74
75
76 define Package/gnutls-utils
77 $(call Package/gnutls/Default)
78 SECTION:=utils
79 CATEGORY:=Utilities
80 TITLE+= (utilities)
81 DEPENDS+= +libgnutls
82 endef
83
84 define Package/gnutls-utils/description
85 $(call Package/gnutls/Default/description)
86 This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
87 and srptool utilities.
88 endef
89
90 define Package/libgnutls/config
91 source "$(SOURCE)/Config.in"
92 endef
93
94 define Package/libgnutls
95 $(call Package/gnutls/Default)
96 TITLE+= (library)
97 DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp +GNUTLS_EXT_LIBTASN1:libtasn1 +GNUTLS_PKCS11:p11-kit +GNUTLS_CRYPTODEV:kmod-cryptodev
98 endef
99
100 define Package/libgnutls/description
101 $(call Package/gnutls/Default/description)
102 This package contains the GnuTLS shared library, needed by other programs.
103 endef
104
105
106 CONFIGURE_ARGS+= \
107 --enable-shared \
108 --enable-static \
109 --disable-rpath \
110 --disable-libdane \
111 --disable-guile \
112 --disable-nls \
113 --without-zlib \
114 --enable-local-libopts \
115 --disable-doc \
116 --disable-tests \
117 --with-default-trust-store-dir=/etc/ssl/certs/ \
118 --disable-crywrap \
119 --with-librt-prefix="$(LIBRT_ROOT_DIR)/"
120
121 ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
122 CONFIGURE_ARGS += --with-included-libtasn1
123 endif
124
125 ifneq ($(CONFIG_GNUTLS_PKCS11),y)
126 CONFIGURE_ARGS += --without-p11-kit
127 endif
128
129 ifeq ($(CONFIG_LIBNETTLE_MINI),y)
130 CONFIGURE_ARGS += --with-nettle-mini
131 endif
132
133 ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
134 CONFIGURE_ARGS += --disable-dtls-srtp-support
135 endif
136
137 ifneq ($(CONFIG_GNUTLS_ALPN),y)
138 CONFIGURE_ARGS += --disable-alpn-support
139 endif
140
141 ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
142 CONFIGURE_ARGS += --disable-heartbeat-support
143 endif
144
145 ifneq ($(CONFIG_GNUTLS_SRP),y)
146 CONFIGURE_ARGS += --disable-srp-authentication
147 endif
148
149 ifneq ($(CONFIG_GNUTLS_PSK),y)
150 CONFIGURE_ARGS += --disable-psk-authentication
151 endif
152
153 ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
154 CONFIGURE_ARGS += --disable-openpgp-authentication
155 endif
156
157 ifneq ($(CONFIG_GNUTLS_ANON),y)
158 CONFIGURE_ARGS += --disable-anon-authentication
159 endif
160
161 ifneq ($(CONFIG_GNUTLS_OCSP),y)
162 CONFIGURE_ARGS += --disable-ocsp
163 endif
164
165 ifneq ($(CONFIG_GNUTLS_TPM),y)
166 CONFIGURE_ARGS += --without-tpm
167 endif
168
169 ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
170 CONFIGURE_ARGS += --enable-cryptodev
171 endif
172
173 TARGET_CFLAGS += $(FPIC)
174
175 define Build/InstallDev
176 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
177 $(CP) \
178 $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so* \
179 $(1)/usr/lib/
180 $(CP) \
181 $(PKG_INSTALL_DIR)/usr/include/gnutls \
182 $(1)/usr/include/
183 $(CP) \
184 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
185 $(1)/usr/lib/pkgconfig/
186 endef
187
188
189 define Package/certtool/conffiles
190 /etc/gnutls/certtool.cfg
191 endef
192
193 define Package/certtool/install
194 $(INSTALL_DIR) $(1)/etc/gnutls
195 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
196 $(INSTALL_DIR) $(1)/usr/bin
197 $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
198 endef
199
200
201 define Package/gnutls-utils/install
202 $(INSTALL_DIR) $(1)/usr/bin
203 ifeq ($(CONFIG_GNUTLS_OCSP),y)
204 ifeq ($(CONFIG_GNUTLS_ANON),y)
205 $(CP) \
206 $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
207 $(1)/usr/bin/
208 endif
209 $(CP) \
210 $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
211 $(1)/usr/bin/
212 endif
213 ifeq ($(CONFIG_GNUTLS_SRP),y)
214 $(CP) \
215 $(PKG_INSTALL_DIR)/usr/bin/srptool \
216 $(1)/usr/bin/
217 endif
218 ifeq ($(CONFIG_GNUTLS_PSK),y)
219 $(CP) \
220 $(PKG_INSTALL_DIR)/usr/bin/psktool \
221 $(1)/usr/bin/
222 endif
223 ifeq ($(CONFIG_GNUTLS_PKCS11),y)
224 $(CP) \
225 $(PKG_INSTALL_DIR)/usr/bin/p11tool \
226 $(1)/usr/bin/
227 endif
228 ifeq ($(CONFIG_GNUTLS_TPM),y)
229 $(CP) \
230 $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
231 $(1)/usr/bin/
232 endif
233 endef
234
235
236 define Package/libgnutls/install
237 $(INSTALL_DIR) $(1)/usr/lib
238 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
239 endef
240
241
242 $(eval $(call BuildPackage,certtool))
243 $(eval $(call BuildPackage,gnutls-utils))
244 $(eval $(call BuildPackage,libgnutls))