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