[8.09] [packages] gnutls: fix 2 vulnerabilities allowing Man-in-the-Middle attacks
[openwrt/svn-archive/archive.git] / libs / gnutls / Makefile
1 #
2 # Copyright (C) 2005-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=gnutls
12 PKG_VERSION:=2.4.1
13 PKG_RELEASE:=2.1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://www.mirrors.wiretapped.net/security/network-security/gnutls/ \
17 ftp://ftp.gnutls.org/pub/gnutls/ \
18 ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/ \
19 http://josefsson.org/gnutls/releases/
20 PKG_MD5SUM:=573db36cb3f8472b0293cfa1f52c607a
21
22 PKG_FIXUP = libtool
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/gnutls/Default
27 SECTION:=libs
28 CATEGORY:=Libraries
29 TITLE:=GNU TLS
30 URL:=http://www.gnu.org/software/gnutls/
31 endef
32
33 define Package/gnutls/Default/description
34 GnuTLS is a project that aims to develop a library which provides a
35 secure layer, over a reliable transport layer. Currently the GnuTLS
36 library implements the proposed standards by the IETF's TLS working
37 group.
38 endef
39
40
41 define Package/certtool
42 $(call Package/gnutls/Default)
43 SECTION:=utils
44 CATEGORY:=Utilities
45 TITLE+= (certool utility)
46 DEPENDS+= +libgnutls +libncurses +libreadline
47 endef
48
49 define Package/certtool/description
50 $(call Package/gnutls/Default/description)
51 This package contains the GnuTLS certtool utility.
52 endef
53
54
55 define Package/gnutls-utils
56 $(call Package/gnutls/Default)
57 SECTION:=utils
58 CATEGORY:=Utilities
59 TITLE+= (utilities)
60 DEPENDS+= +libgnutls +libgnutls-extra
61 endef
62
63 define Package/gnutls-utils/description
64 $(call Package/gnutls/Default/description)
65 This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
66 and srptool utilities.
67 endef
68
69
70 define Package/libgnutls
71 $(call Package/gnutls/Default)
72 TITLE+= (library)
73 DEPENDS+= +zlib +libgcrypt +libgpg-error
74 endef
75
76 define Package/libgnutls/description
77 $(call Package/gnutls/Default/description)
78 This package contains the GnuTLS shared library, needed by other programs.
79 endef
80
81
82 define Package/libgnutls-extra
83 $(call Package/gnutls/Default)
84 TITLE+= (extra library)
85 DEPENDS+= +libgnutls
86 endef
87
88 define Package/libgnutls-extra/description
89 $(call Package/gnutls/Default/description)
90 This package contains the GnuTLS extra shared library.
91 endef
92
93
94 define Package/libgnutls-openssl
95 $(call Package/gnutls/Default)
96 TITLE+= (OpenSSL compat library)
97 DEPENDS+= +libgnutls
98 endef
99
100 define Package/libgnutls-openssl/description
101 $(call Package/gnutls/Default/description)
102 This package contains the GnuTLS OpenSSL compatibility layer shared library.
103 endef
104
105 TARGET_CFLAGS += $(FPIC)
106
107 CONFIGURE_ARGS+= \
108 --enable-shared \
109 --enable-static \
110 --disable-openpgp-authentication \
111 --with-included-libcfg \
112 --with-included-libtasn1 \
113 --with-libgcrypt-prefix="$(STAGING_DIR)/usr" \
114 --with-libreadline-prefix="$(STAGING_DIR)/usr" \
115 --with-libz-prefix="$(STAGING_DIR)/usr" \
116
117 # XXX: AM_CFLAGS duplicates with CFLAGS
118 MAKE_ARGS:= \
119 AM_CFLAGS="" \
120
121 define Build/Configure
122 $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
123 $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
124 $(call Build/Configure/Default)
125 endef
126
127 define Build/Compile
128 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) DESTDIR="$(PKG_INSTALL_DIR)" all install
129 endef
130
131 define Build/InstallDev
132 mkdir -p $(1)/usr/bin $(2)/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
133 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgnutls{,-extra}-config $(2)/bin/
134 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(1)/usr/include/
135 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(1)/usr/lib/
136 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(1)/usr/lib/pkgconfig/
137 endef
138
139 define Package/certtool/conffiles
140 /etc/gnutls/certtool.cfg
141 endef
142
143 define Package/certtool/install
144 $(INSTALL_DIR) $(1)/etc/gnutls
145 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
146 $(INSTALL_DIR) $(1)/usr/bin
147 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
148 endef
149
150
151 define Package/gnutls-utils/install
152 $(INSTALL_DIR) $(1)/usr/bin
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psktool $(1)/usr/bin/
155 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/srptool $(1)/usr/bin/
156 endef
157
158
159 define Package/libgnutls/install
160 $(INSTALL_DIR) $(1)/usr/lib
161 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
162 endef
163
164
165 define Package/libgnutls-extra/install
166 $(INSTALL_DIR) $(1)/usr/lib
167 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-extra.so.* $(1)/usr/lib/
168 endef
169
170
171 define Package/libgnutls-openssl/install
172 $(INSTALL_DIR) $(1)/usr/lib
173 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
174 endef
175
176
177 $(eval $(call BuildPackage,certtool))
178 $(eval $(call BuildPackage,gnutls-utils))
179 $(eval $(call BuildPackage,libgnutls))
180 $(eval $(call BuildPackage,libgnutls-extra))
181 $(eval $(call BuildPackage,libgnutls-openssl))