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