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)
78 DEPENDS+= +libnettle +!LIBNETTLE_MINI:libgmp
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 ifeq ($(CONFIG_LIBNETTLE_MINI),y)
114 CONFIGURE_ARGS += --with-nettle-mini
117 ifneq ($(CONFIG_GNUTLS_DTLS_SRTP),y)
118 CONFIGURE_ARGS += --disable-dtls-srtp-support
121 ifneq ($(CONFIG_GNUTLS_ALPN),y)
122 CONFIGURE_ARGS += --disable-alpn-support
125 ifneq ($(CONFIG_GNUTLS_HEARTBEAT),y)
126 CONFIGURE_ARGS += --disable-heartbeat-support
129 ifneq ($(CONFIG_GNUTLS_SRP),y)
130 CONFIGURE_ARGS += --disable-srp-authentication
133 ifneq ($(CONFIG_GNUTLS_PSK),y)
134 CONFIGURE_ARGS += --disable-psk-authentication
137 ifneq ($(CONFIG_GNUTLS_OPENPGP),y)
138 CONFIGURE_ARGS += --disable-openpgp-authentication
141 ifneq ($(CONFIG_GNUTLS_ANON),y)
142 CONFIGURE_ARGS += --disable-anon-authentication
145 ifneq ($(CONFIG_GNUTLS_OCSP),y)
146 CONFIGURE_ARGS += --disable-ocsp
149 ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
150 CONFIGURE_ARGS += --enable-cryptodev
153 # XXX: AM_CFLAGS duplicates with CFLAGS
157 TARGET_CFLAGS += $(FPIC)
158 TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
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)
166 define Build/InstallDev
167 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
169 $(PKG_INSTALL_DIR)/usr/include/gnutls \
172 $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-openssl}.{a,so*} \
175 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls.pc \
176 $(1)/usr/lib/pkgconfig/
179 define Package/certtool/conffiles
180 /etc/gnutls/certtool.cfg
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/
191 define Package/gnutls-utils/install
192 $(INSTALL_DIR) $(1)/usr/bin
193 ifeq ($(CONFIG_GNUTLS_OCSP),y)
194 ifeq ($(CONFIG_GNUTLS_ANON),y)
196 $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
200 $(PKG_INSTALL_DIR)/usr/bin/ocsptool \
203 ifeq ($(CONFIG_GNUTLS_SRP),y)
205 $(PKG_INSTALL_DIR)/usr/bin/srptool \
208 ifeq ($(CONFIG_GNUTLS_PSK),y)
210 $(PKG_INSTALL_DIR)/usr/bin/psktool \
216 define Package/libgnutls/install
217 $(INSTALL_DIR) $(1)/usr/lib
218 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
222 define Package/libgnutls-openssl/install
223 $(INSTALL_DIR) $(1)/usr/lib
224 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
228 $(eval $(call BuildPackage,certtool))
229 $(eval $(call BuildPackage,gnutls-utils))
230 $(eval $(call BuildPackage,libgnutls))
231 $(eval $(call BuildPackage,libgnutls-openssl))