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