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