2 # Copyright (C) 2005-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
16 PKG_SOURCE_URL
:=ftp
://ftp.gnutls.org
/gcrypt
/gnutls
/v3.3
17 PKG_MD5SUM
:=a7387fe8bf3e604bf518a6da9ab2a4e6
18 PKG_MAINTAINER
:=Nikos Mavrogiannopoulos
<nmav@gnutls.org
>
21 PKG_LIBTOOL_PATHS
:=. lib
22 PKG_CHECK_FORMAT_SECURITY
:=0
24 PKG_CONFIG_DEPENDS
:= \
27 CONFIG_GNUTLS_CRYPTODEV \
28 CONFIG_GNUTLS_DTLS_SRTP \
29 CONFIG_GNUTLS_EXT_LIBTASN1 \
30 CONFIG_GNUTLS_HEARTBEAT \
32 CONFIG_GNUTLS_OPENPGP \
33 CONFIG_GNUTLS_PKCS11 \
36 CONFIG_LIBNETTLE_MINI \
38 include $(INCLUDE_DIR
)/package.mk
41 define Package
/gnutls
/Default
46 URL
:=http
://www.gnutls.org
/
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.
59 define Package
/certtool
60 $(call Package
/gnutls
/Default
)
63 TITLE
+= (certool utility
)
67 define Package
/certtool
/description
68 $(call Package
/gnutls
/Default
/description
)
69 This package contains the GnuTLS certtool utility.
73 define Package
/gnutls-utils
74 $(call Package
/gnutls
/Default
)
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.
87 define Package
/libgnutls
/config
88 source
"$(SOURCE)/Config.in"
91 define Package
/libgnutls
92 $(call Package
/gnutls
/Default
)
94 DEPENDS
+= +libnettle
+!LIBNETTLE_MINI
:libgmp
+GNUTLS_EXT_LIBTASN1
:libtasn1
+GNUTLS_PKCS11
:p11-kit
97 define Package
/libgnutls
/description
98 $(call Package
/gnutls
/Default
/description
)
99 This package contains the GnuTLS shared library
, needed by other programs.
103 define Package
/libgnutls-openssl
104 $(call Package
/gnutls
/Default
)
105 TITLE
+= (OpenSSL compat library
)
109 define Package
/libgnutls-openssl
/description
110 $(call Package
/gnutls
/Default
/description
)
111 This package contains the GnuTLS OpenSSL compatibility layer shared library.
121 --enable-local-libopts \
124 --disable-rsa-export \
125 --with-default-trust-store-dir
=/etc
/ssl
/certs
/ \
128 ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1
),y
)
129 CONFIGURE_ARGS
+= --with-included-libtasn1
132 ifneq ($(CONFIG_GNUTLS_PKCS11
),y
)
133 CONFIGURE_ARGS
+= --without-p11-kit
136 ifeq ($(CONFIG_LIBNETTLE_MINI
),y
)
137 CONFIGURE_ARGS
+= --with-nettle-mini
140 ifneq ($(CONFIG_GNUTLS_DTLS_SRTP
),y
)
141 CONFIGURE_ARGS
+= --disable-dtls-srtp-support
144 ifneq ($(CONFIG_GNUTLS_ALPN
),y
)
145 CONFIGURE_ARGS
+= --disable-alpn-support
148 ifneq ($(CONFIG_GNUTLS_HEARTBEAT
),y
)
149 CONFIGURE_ARGS
+= --disable-heartbeat-support
152 ifneq ($(CONFIG_GNUTLS_SRP
),y
)
153 CONFIGURE_ARGS
+= --disable-srp-authentication
156 ifneq ($(CONFIG_GNUTLS_PSK
),y
)
157 CONFIGURE_ARGS
+= --disable-psk-authentication
160 ifneq ($(CONFIG_GNUTLS_OPENPGP
),y
)
161 CONFIGURE_ARGS
+= --disable-openpgp-authentication
164 ifneq ($(CONFIG_GNUTLS_ANON
),y
)
165 CONFIGURE_ARGS
+= --disable-anon-authentication
168 ifneq ($(CONFIG_GNUTLS_OCSP
),y
)
169 CONFIGURE_ARGS
+= --disable-ocsp
172 ifeq ($(CONFIG_GNUTLS_CRYPTODEV
),y
)
173 CONFIGURE_ARGS
+= --enable-cryptodev
176 TARGET_CFLAGS
+= $(FPIC
)
177 TARGET_LDFLAGS
+= -Wl
,-rpath-link
=$(STAGING_DIR
)/usr
/lib
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
)
185 define Build
/InstallDev
186 $(INSTALL_DIR
) $(1)/usr
/include $(1)/usr
/lib
/pkgconfig
188 $(PKG_INSTALL_DIR
)/usr
/include/gnutls \
191 $(PKG_INSTALL_DIR
)/usr
/lib
/libgnutls
{,-openssl
}.
{a
,so
*} \
194 $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/gnutls.
pc \
195 $(1)/usr
/lib
/pkgconfig
/
198 define Package
/certtool
/conffiles
199 /etc
/gnutls
/certtool.cfg
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
/
210 define Package
/gnutls-utils
/install
211 $(INSTALL_DIR
) $(1)/usr
/bin
212 ifeq ($(CONFIG_GNUTLS_OCSP
),y
)
213 ifeq ($(CONFIG_GNUTLS_ANON
),y
)
215 $(PKG_INSTALL_DIR
)/usr
/bin
/gnutls-
{cli
,serv
} \
219 $(PKG_INSTALL_DIR
)/usr
/bin
/ocsptool \
222 ifeq ($(CONFIG_GNUTLS_SRP
),y
)
224 $(PKG_INSTALL_DIR
)/usr
/bin
/srptool \
227 ifeq ($(CONFIG_GNUTLS_PSK
),y
)
229 $(PKG_INSTALL_DIR
)/usr
/bin
/psktool \
232 ifeq ($(CONFIG_GNUTLS_PKCS11
),y
)
234 $(PKG_INSTALL_DIR
)/usr
/bin
/p11tool \
240 define Package
/libgnutls
/install
241 $(INSTALL_DIR
) $(1)/usr
/lib
242 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libgnutls.so.
* $(1)/usr
/lib
/
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
/
252 $(eval
$(call BuildPackage
,certtool
))
253 $(eval
$(call BuildPackage
,gnutls-utils
))
254 $(eval
$(call BuildPackage
,libgnutls
))
255 $(eval
$(call BuildPackage
,libgnutls-openssl
))