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
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>
20 PKG_LIBTOOL_PATHS:=. lib
22 include $(INCLUDE_DIR)/package.mk
25 define Package/gnutls/Default
30 URL:=http://www.gnutls.org/
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.
43 define Package/certtool
44 $(call Package/gnutls/Default)
47 TITLE+= (certool utility)
51 define Package/certtool/description
52 $(call Package/gnutls/Default/description)
53 This package contains the GnuTLS certtool utility.
57 define Package/gnutls-utils
58 $(call Package/gnutls/Default)
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.
71 define Package/libgnutls/config
72 source "$(SOURCE)/Config.in"
75 define Package/libgnutls
76 $(call Package/gnutls/Default)
81 define Package/libgnutls/description
82 $(call Package/gnutls/Default/description)
83 This package contains the GnuTLS shared library, needed by other programs.
87 define Package/libgnutls-openssl
88 $(call Package/gnutls/Default)
89 TITLE+= (OpenSSL compat library)
93 define Package/libgnutls-openssl/description
94 $(call Package/gnutls/Default/description)
95 This package contains the GnuTLS OpenSSL compatibility layer shared library.
105 --with-included-libtasn1 \
106 --enable-local-libopts \
109 --disable-rsa-export \
113 ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
114 CONFIGURE_ARGS += --disable-dtls-srtp-support
117 ifneq ($(CONFIG_GNUTLS_ALPN),y)
118 CONFIGURE_ARGS += --disable-alpn-support
121 ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
122 CONFIGURE_ARGS += --disable-heartbeat-support
125 ifneq ($(CONFIG_GNUTLS_SRP),y)
126 CONFIGURE_ARGS += --disable-srp-authentication
129 ifneq ($(CONFIG_GNUTLS_PSK),y)
130 CONFIGURE_ARGS += --disable-psk-authentication
133 ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
134 CONFIGURE_ARGS += --disable-openpgp-authentication
137 ifneq ($(CONFIG_GNUTLS_ANON),y)
138 CONFIGURE_ARGS += --disable-anon-authentication
141 ifneq ($(CONFIG_GNUTLS_OCSP),y)
142 CONFIGURE_ARGS += --disable-ocsp
145 ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
146 CONFIGURE_ARGS += --enable-cryptodev
149 # XXX: AM_CFLAGS duplicates with CFLAGS
153 TARGET_CFLAGS += $(FPIC)
154 TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
156 define Build/Configure
157 $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
158 $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
159 $(call Build/Configure/Default)
162 define Build/InstallDev
163 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
165 $(PKG_INSTALL_DIR)/usr/include/gnutls \
168 $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
171 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
172 $(1)/usr/lib/pkgconfig/
175 define Package/certtool/conffiles
176 /etc/gnutls/certtool.cfg
179 define Package/certtool/install
180 $(INSTALL_DIR) $(1)/etc/gnutls
181 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
182 $(INSTALL_DIR) $(1)/usr/bin
183 $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
187 define Package/gnutls-utils/install
188 $(INSTALL_DIR) $(1)/usr/bin
190 $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
192 ifeq ($(CONFIG_GNUTLS_OCSP),y)
194 $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
197 ifeq ($(CONFIG_GNUTLS_SRP),y)
199 $(PKG_INSTALL_DIR)/usr/bin/srptool \
202 ifeq ($(CONFIG_GNUTLS_PSK),y)
204 $(PKG_INSTALL_DIR)/usr/bin/psktool \
210 define Package/libgnutls/install
211 $(INSTALL_DIR) $(1)/usr/lib
212 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
216 define Package/libgnutls-openssl/install
217 $(INSTALL_DIR) $(1)/usr/lib
218 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
222 $(eval $(call BuildPackage,certtool))
223 $(eval $(call BuildPackage,gnutls-utils))
224 $(eval $(call BuildPackage,libgnutls))
225 $(eval $(call BuildPackage,libgnutls-openssl))