2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://josefsson.org/gnutls/releases/ \
17 http://www.mirrors.wiretapped.net/security/network-security/gnutls/ \
18 ftp://ftp.gnutls.org/pub/gnutls/ \
19 ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/ \
20 ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/
21 PKG_MD5SUM:=181b2ff554a83e6cf85505ea16699d39
23 include $(INCLUDE_DIR)/package.mk
25 define Package/gnutls/Default
29 URL:=http://www.gnu.org/software/gnutls/
32 define Package/gnutls/Default/description
33 GnuTLS is a project that aims to develop a library which provides a
34 secure layer, over a reliable transport layer. Currently the GnuTLS
35 library implements the proposed standards by the IETF's TLS working
40 define Package/certtool
41 $(call Package/gnutls/Default)
44 TITLE+= (certool utility)
45 DEPENDS+= +libgnutls +libncurses +libreadline
48 define Package/certtool/description
49 $(call Package/gnutls/Default/description)
50 This package contains the GnuTLS certtool utility.
54 define Package/gnutls-utils
55 $(call Package/gnutls/Default)
59 DEPENDS+= +libgnutls +libgnutls-extra
62 define Package/gnutls-utils/description
63 $(call Package/gnutls/Default/description)
64 This package contains the GnuTLS gnutls-cli, gnutls-serv and psktool
69 define Package/libgnutls
70 $(call Package/gnutls/Default)
72 DEPENDS+= +libgcrypt +libgpg-error
75 define Package/libgnutls/description
76 $(call Package/gnutls/Default/description)
77 This package contains the GnuTLS shared library, needed by other programs.
81 define Package/libgnutls-extra
82 $(call Package/gnutls/Default)
83 TITLE+= (extra library)
87 define Package/libgnutls-extra/description
88 $(call Package/gnutls/Default/description)
89 This package contains the GnuTLS extra shared library.
93 define Package/libgnutls-openssl
94 $(call Package/gnutls/Default)
95 TITLE+= (OpenSSL compat library)
99 define Package/libgnutls-openssl/description
100 $(call Package/gnutls/Default/description)
101 This package contains the GnuTLS OpenSSL compatibility layer shared library.
105 # XXX: configure will disable any of theese if they're present regardless of
106 # the "--enable" prefix
107 # --enable-anon-authentication \
108 # --enable-openpgp-authentication \
109 # --enable-psk-authentication \
110 # --enable-srp-authentication \
111 # --enable-tls-authorization \
113 # and the following prevents the library from building so it's ommited
114 # --disable-tls-authorization
119 --disable-anon-authentication \
120 --disable-openpgp-authentication \
121 --disable-psk-authentication \
122 --disable-srp-authentication \
123 --with-included-libtasn1 \
124 --with-included-libcfg \
125 --without-included-opencdk \
127 --with-libgcrypt-prefix="$(STAGING_DIR)/usr" \
128 --without-libiconv-prefix \
129 --without-libintl-prefix \
130 --without-libopencdk-prefix \
131 --with-libreadline-prefix="$(STAGING_DIR)/usr" \
135 # XXX: AM_CFLAGS duplicates with CFLAGS
139 define Build/Configure
140 $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
141 $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
142 $(call Build/Configure/Default)
143 $(call libtool_disable_rpath)
147 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) all
148 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
149 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) DESTDIR="$(PKG_INSTALL_DIR)" install
152 define Build/InstallDev
153 mkdir -p $(STAGING_DIR)/usr/bin
154 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libgnutls{,-extra}-config $(STAGING_DIR)/usr/bin/
155 mkdir -p $(STAGING_DIR)/usr/include
156 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(STAGING_DIR)/usr/include/
157 mkdir -p $(STAGING_DIR)/usr/lib
158 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(STAGING_DIR)/usr/lib/
159 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(STAGING_DIR)/usr/lib/pkgconfig/
163 define Build/UninstallDev
164 rm -rf $(STAGING_DIR)/usr/bin/libgnutls{,-extra}-config \
165 $(STAGING_DIR)/usr/include/gnutls \
166 $(STAGING_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} \
167 $(STAGING_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc
171 define Package/certtool/conffiles
172 /etc/gnutls/certtool.cfg
175 define Package/certtool/install
176 $(INSTALL_DIR) $(1)/etc/gnutls
177 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
178 $(INSTALL_DIR) $(1)/usr/bin
179 $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
183 define Package/gnutls-utils/install
184 $(INSTALL_DIR) $(1)/usr/bin
185 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
186 $(CP) $(PKG_INSTALL_DIR)/usr/bin/psktool $(1)/usr/bin/
190 define Package/libgnutls/install
191 $(INSTALL_DIR) $(1)/usr/lib
192 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
196 define Package/libgnutls-extra/install
197 $(INSTALL_DIR) $(1)/usr/lib
198 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-extra.so.* $(1)/usr/lib/
202 define Package/libgnutls-openssl/install
203 $(INSTALL_DIR) $(1)/usr/lib
204 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
208 $(eval $(call BuildPackage,certtool))
209 $(eval $(call BuildPackage,gnutls-utils))
210 $(eval $(call BuildPackage,libgnutls))
211 $(eval $(call BuildPackage,libgnutls-extra))
212 $(eval $(call BuildPackage,libgnutls-openssl))