0419e192f0a6d5ee9755d12a1414191c5940e30f
[openwrt/svn-archive/archive.git] / libs / gnutls / Makefile
1 #
2 # Copyright (C) 2007 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.0.0
13 PKG_RELEASE:=1
14
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
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/gnutls/Default
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=GNU TLS
29 URL:=http://www.gnu.org/software/gnutls/
30 endef
31
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
36 group.
37 endef
38
39
40 define Package/certtool
41 $(call Package/gnutls/Default)
42 SECTION:=utils
43 CATEGORY:=Utilities
44 TITLE+= (certool utility)
45 DEPENDS+= +libgnutls +libncurses +libreadline
46 endef
47
48 define Package/certtool/description
49 $(call Package/gnutls/Default/description)
50 This package contains the GnuTLS certtool utility.
51 endef
52
53
54 define Package/gnutls-utils
55 $(call Package/gnutls/Default)
56 SECTION:=utils
57 CATEGORY:=Utilities
58 TITLE+= (utilities)
59 DEPENDS+= +libgnutls +libgnutls-extra
60 endef
61
62 define Package/gnutls-utils/description
63 $(call Package/gnutls/Default/description)
64 This package contains the GnuTLS gnutls-cli, gnutls-serv and psktool
65 utilities.
66 endef
67
68
69 define Package/libgnutls
70 $(call Package/gnutls/Default)
71 TITLE+= (library)
72 DEPENDS+= +libgcrypt +libgpg-error
73 endef
74
75 define Package/libgnutls/description
76 $(call Package/gnutls/Default/description)
77 This package contains the GnuTLS shared library, needed by other programs.
78 endef
79
80
81 define Package/libgnutls-extra
82 $(call Package/gnutls/Default)
83 TITLE+= (extra library)
84 DEPENDS+= +libgnutls
85 endef
86
87 define Package/libgnutls-extra/description
88 $(call Package/gnutls/Default/description)
89 This package contains the GnuTLS extra shared library.
90 endef
91
92
93 define Package/libgnutls-openssl
94 $(call Package/gnutls/Default)
95 TITLE+= (OpenSSL compat library)
96 DEPENDS+= +libgnutls
97 endef
98
99 define Package/libgnutls-openssl/description
100 $(call Package/gnutls/Default/description)
101 This package contains the GnuTLS OpenSSL compatibility layer shared library.
102 endef
103
104
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 \
112 #
113 # and the following prevents the library from building so it's ommited
114 # --disable-tls-authorization
115
116 CONFIGURE_ARGS+= \
117 --enable-shared \
118 --enable-static \
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 \
126 --with-libgcrypt \
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" \
132 --without-lzo \
133 --without-zlib \
134
135 # XXX: AM_CFLAGS duplicates with CFLAGS
136 MAKE_ARGS:= \
137 AM_CFLAGS="" \
138
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)
144 endef
145
146 define Build/Compile
147 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) all
148 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) DESTDIR="$(PKG_INSTALL_DIR)" install
149 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
150 endef
151
152 define Build/InstallDev
153 mkdir -p $(1)/usr/bin
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgnutls{,-extra}-config $(2)/bin/
155 mkdir -p $(1)/usr/include
156 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(1)/usr/include/
157 mkdir -p $(1)/usr/lib
158 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(1)/usr/lib/
159 mkdir -p $(1)/usr/lib/pkgconfig
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(1)/usr/lib/pkgconfig/
161 endef
162
163 define Package/certtool/conffiles
164 /etc/gnutls/certtool.cfg
165 endef
166
167 define Package/certtool/install
168 $(INSTALL_DIR) $(1)/etc/gnutls
169 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
170 $(INSTALL_DIR) $(1)/usr/bin
171 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
172 endef
173
174
175 define Package/gnutls-utils/install
176 $(INSTALL_DIR) $(1)/usr/bin
177 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psktool $(1)/usr/bin/
179 endef
180
181
182 define Package/libgnutls/install
183 $(INSTALL_DIR) $(1)/usr/lib
184 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
185 endef
186
187
188 define Package/libgnutls-extra/install
189 $(INSTALL_DIR) $(1)/usr/lib
190 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-extra.so.* $(1)/usr/lib/
191 endef
192
193
194 define Package/libgnutls-openssl/install
195 $(INSTALL_DIR) $(1)/usr/lib
196 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
197 endef
198
199
200 $(eval $(call BuildPackage,certtool))
201 $(eval $(call BuildPackage,gnutls-utils))
202 $(eval $(call BuildPackage,libgnutls))
203 $(eval $(call BuildPackage,libgnutls-extra))
204 $(eval $(call BuildPackage,libgnutls-openssl))