added our own pkg-config wrapper, making the sed foo on *.pc files obselete 2/2
[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 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
149 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) DESTDIR="$(PKG_INSTALL_DIR)" install
150 endef
151
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/
161 endef
162
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
168 endef
169
170
171 define Package/certtool/conffiles
172 /etc/gnutls/certtool.cfg
173 endef
174
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/
180 endef
181
182
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/
187 endef
188
189
190 define Package/libgnutls/install
191 $(INSTALL_DIR) $(1)/usr/lib
192 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
193 endef
194
195
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/
199 endef
200
201
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/
205 endef
206
207
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))