689d0a0370682e8a48596623a71dac184a7a4110
[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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=gnutls
11 PKG_VERSION:=2.8.5
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@GNU/gnutls \
16 ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/
17 PKG_MD5SUM:=
18
19 PKG_FIXUP = libtool
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/gnutls/Default
24 SECTION:=libs
25 CATEGORY:=Libraries
26 TITLE:=GNU TLS
27 URL:=http://www.gnu.org/software/gnutls/
28 endef
29
30 define Package/gnutls/Default/description
31 GnuTLS is a project that aims to develop a library which provides a
32 secure layer, over a reliable transport layer. Currently the GnuTLS
33 library implements the SSL 3.0, TLS 1.0, and TLS 1.1 protocols.
34 endef
35
36
37 define Package/certtool
38 $(call Package/gnutls/Default)
39 SECTION:=utils
40 CATEGORY:=Utilities
41 TITLE+= (certool utility)
42 DEPENDS+= +libgnutls +libncurses +libreadline
43 endef
44
45 define Package/certtool/description
46 $(call Package/gnutls/Default/description)
47 This package contains the GnuTLS certtool utility.
48 endef
49
50
51 define Package/gnutls-utils
52 $(call Package/gnutls/Default)
53 SECTION:=utils
54 CATEGORY:=Utilities
55 TITLE+= (utilities)
56 DEPENDS+= +libgnutls +libgnutls-extra
57 endef
58
59 define Package/gnutls-utils/description
60 $(call Package/gnutls/Default/description)
61 This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
62 and srptool utilities.
63 endef
64
65
66 define Package/libgnutls
67 $(call Package/gnutls/Default)
68 TITLE+= (library)
69 DEPENDS+= +zlib +libgcrypt +libgpg-error
70 SUBMENU:=SSL
71 endef
72
73 define Package/libgnutls/description
74 $(call Package/gnutls/Default/description)
75 This package contains the GnuTLS shared library, needed by other programs.
76 endef
77
78
79 define Package/libgnutls-extra
80 $(call Package/gnutls/Default)
81 TITLE+= (extra library)
82 DEPENDS+= +libgnutls
83 SUBMENU:=SSL
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 SUBMENU:=SSL
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 TARGET_CFLAGS += $(FPIC)
105
106 CONFIGURE_ARGS+= \
107 --enable-shared \
108 --enable-static \
109 --disable-openpgp-authentication \
110 --disable-guile \
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 $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
133 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(1)/usr/include/
134 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(1)/usr/lib/
135 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(1)/usr/lib/pkgconfig/
136 endef
137
138 define Package/certtool/conffiles
139 /etc/gnutls/certtool.cfg
140 endef
141
142 define Package/certtool/install
143 $(INSTALL_DIR) $(1)/etc/gnutls
144 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
145 $(INSTALL_DIR) $(1)/usr/bin
146 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
147 endef
148
149
150 define Package/gnutls-utils/install
151 $(INSTALL_DIR) $(1)/usr/bin
152 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psktool $(1)/usr/bin/
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/srptool $(1)/usr/bin/
155 endef
156
157
158 define Package/libgnutls/install
159 $(INSTALL_DIR) $(1)/usr/lib
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
161 endef
162
163
164 define Package/libgnutls-extra/install
165 $(INSTALL_DIR) $(1)/usr/lib
166 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-extra.so.* $(1)/usr/lib/
167 endef
168
169
170 define Package/libgnutls-openssl/install
171 $(INSTALL_DIR) $(1)/usr/lib
172 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
173 endef
174
175
176 $(eval $(call BuildPackage,certtool))
177 $(eval $(call BuildPackage,gnutls-utils))
178 $(eval $(call BuildPackage,libgnutls))
179 $(eval $(call BuildPackage,libgnutls-extra))
180 $(eval $(call BuildPackage,libgnutls-openssl))