lots of package cleanups/fixes
[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 PKG_FIXUP = libtool
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/gnutls/Default
28 SECTION:=libs
29 CATEGORY:=Libraries
30 TITLE:=GNU TLS
31 URL:=http://www.gnu.org/software/gnutls/
32 endef
33
34 define Package/gnutls/Default/description
35 GnuTLS is a project that aims to develop a library which provides a
36 secure layer, over a reliable transport layer. Currently the GnuTLS
37 library implements the proposed standards by the IETF's TLS working
38 group.
39 endef
40
41
42 define Package/certtool
43 $(call Package/gnutls/Default)
44 SECTION:=utils
45 CATEGORY:=Utilities
46 TITLE+= (certool utility)
47 DEPENDS+= +libgnutls +libncurses +libreadline
48 endef
49
50 define Package/certtool/description
51 $(call Package/gnutls/Default/description)
52 This package contains the GnuTLS certtool utility.
53 endef
54
55
56 define Package/gnutls-utils
57 $(call Package/gnutls/Default)
58 SECTION:=utils
59 CATEGORY:=Utilities
60 TITLE+= (utilities)
61 DEPENDS+= +libgnutls +libgnutls-extra
62 endef
63
64 define Package/gnutls-utils/description
65 $(call Package/gnutls/Default/description)
66 This package contains the GnuTLS gnutls-cli, gnutls-serv and psktool
67 utilities.
68 endef
69
70
71 define Package/libgnutls
72 $(call Package/gnutls/Default)
73 TITLE+= (library)
74 DEPENDS+= +libgcrypt +libgpg-error
75 endef
76
77 define Package/libgnutls/description
78 $(call Package/gnutls/Default/description)
79 This package contains the GnuTLS shared library, needed by other programs.
80 endef
81
82
83 define Package/libgnutls-extra
84 $(call Package/gnutls/Default)
85 TITLE+= (extra library)
86 DEPENDS+= +libgnutls
87 endef
88
89 define Package/libgnutls-extra/description
90 $(call Package/gnutls/Default/description)
91 This package contains the GnuTLS extra shared library.
92 endef
93
94
95 define Package/libgnutls-openssl
96 $(call Package/gnutls/Default)
97 TITLE+= (OpenSSL compat library)
98 DEPENDS+= +libgnutls
99 endef
100
101 define Package/libgnutls-openssl/description
102 $(call Package/gnutls/Default/description)
103 This package contains the GnuTLS OpenSSL compatibility layer shared library.
104 endef
105
106
107 # XXX: configure will disable any of theese if they're present regardless of
108 # the "--enable" prefix
109 # --enable-anon-authentication \
110 # --enable-openpgp-authentication \
111 # --enable-psk-authentication \
112 # --enable-srp-authentication \
113 # --enable-tls-authorization \
114 #
115 # and the following prevents the library from building so it's ommited
116 # --disable-tls-authorization
117
118 CONFIGURE_ARGS+= \
119 --enable-shared \
120 --enable-static \
121 --disable-anon-authentication \
122 --disable-openpgp-authentication \
123 --disable-psk-authentication \
124 --disable-srp-authentication \
125 --with-included-libtasn1 \
126 --with-included-libcfg \
127 --without-included-opencdk \
128 --with-libgcrypt \
129 --with-libgcrypt-prefix="$(STAGING_DIR)/usr" \
130 --without-libiconv-prefix \
131 --without-libintl-prefix \
132 --without-libopencdk-prefix \
133 --with-libreadline-prefix="$(STAGING_DIR)/usr" \
134 --without-lzo \
135 --without-zlib \
136
137 # XXX: AM_CFLAGS duplicates with CFLAGS
138 MAKE_ARGS:= \
139 AM_CFLAGS="" \
140
141 define Build/Configure
142 $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
143 $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
144 $(call Build/Configure/Default)
145 endef
146
147 define Build/Compile
148 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) DESTDIR="$(PKG_INSTALL_DIR)" all install
149 endef
150
151 define Build/InstallDev
152 mkdir -p $(1)/usr/bin $(2)/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgnutls{,-extra}-config $(2)/bin/
154 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(1)/usr/include/
155 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(1)/usr/lib/
156 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(1)/usr/lib/pkgconfig/
157 endef
158
159 define Package/certtool/conffiles
160 /etc/gnutls/certtool.cfg
161 endef
162
163 define Package/certtool/install
164 $(INSTALL_DIR) $(1)/etc/gnutls
165 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
166 $(INSTALL_DIR) $(1)/usr/bin
167 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
168 endef
169
170
171 define Package/gnutls-utils/install
172 $(INSTALL_DIR) $(1)/usr/bin
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
174 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psktool $(1)/usr/bin/
175 endef
176
177
178 define Package/libgnutls/install
179 $(INSTALL_DIR) $(1)/usr/lib
180 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
181 endef
182
183
184 define Package/libgnutls-extra/install
185 $(INSTALL_DIR) $(1)/usr/lib
186 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-extra.so.* $(1)/usr/lib/
187 endef
188
189
190 define Package/libgnutls-openssl/install
191 $(INSTALL_DIR) $(1)/usr/lib
192 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
193 endef
194
195
196 $(eval $(call BuildPackage,certtool))
197 $(eval $(call BuildPackage,gnutls-utils))
198 $(eval $(call BuildPackage,libgnutls))
199 $(eval $(call BuildPackage,libgnutls-extra))
200 $(eval $(call BuildPackage,libgnutls-openssl))