67f8d564c81e2fbfbe453f88d23be755854372b2
[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.6.4
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:=747111ab0d86e7b06a4bb120ba456ad8
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 endef
71
72 define Package/libgnutls/description
73 $(call Package/gnutls/Default/description)
74 This package contains the GnuTLS shared library, needed by other programs.
75 endef
76
77
78 define Package/libgnutls-extra
79 $(call Package/gnutls/Default)
80 TITLE+= (extra library)
81 DEPENDS+= +libgnutls
82 endef
83
84 define Package/libgnutls-extra/description
85 $(call Package/gnutls/Default/description)
86 This package contains the GnuTLS extra shared library.
87 endef
88
89
90 define Package/libgnutls-openssl
91 $(call Package/gnutls/Default)
92 TITLE+= (OpenSSL compat library)
93 DEPENDS+= +libgnutls
94 endef
95
96 define Package/libgnutls-openssl/description
97 $(call Package/gnutls/Default/description)
98 This package contains the GnuTLS OpenSSL compatibility layer shared library.
99 endef
100
101 TARGET_CFLAGS += $(FPIC)
102
103 CONFIGURE_ARGS+= \
104 --enable-shared \
105 --enable-static \
106 --disable-openpgp-authentication \
107 --disable-guile \
108 --with-included-libcfg \
109 --with-included-libtasn1 \
110 --with-libgcrypt-prefix="$(STAGING_DIR)/usr" \
111 --with-libreadline-prefix="$(STAGING_DIR)/usr" \
112 --with-libz-prefix="$(STAGING_DIR)/usr" \
113
114 # XXX: AM_CFLAGS duplicates with CFLAGS
115 MAKE_ARGS:= \
116 AM_CFLAGS="" \
117
118 define Build/Configure
119 $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
120 $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
121 $(call Build/Configure/Default)
122 endef
123
124 define Build/Compile
125 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) DESTDIR="$(PKG_INSTALL_DIR)" all install
126 endef
127
128 define Build/InstallDev
129 mkdir -p $(1)/usr/bin $(2)/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
130 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgnutls{,-extra}-config $(2)/bin/
131 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(1)/usr/include/
132 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(1)/usr/lib/
133 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(1)/usr/lib/pkgconfig/
134 endef
135
136 define Package/certtool/conffiles
137 /etc/gnutls/certtool.cfg
138 endef
139
140 define Package/certtool/install
141 $(INSTALL_DIR) $(1)/etc/gnutls
142 $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
143 $(INSTALL_DIR) $(1)/usr/bin
144 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
145 endef
146
147
148 define Package/gnutls-utils/install
149 $(INSTALL_DIR) $(1)/usr/bin
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
151 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psktool $(1)/usr/bin/
152 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/srptool $(1)/usr/bin/
153 endef
154
155
156 define Package/libgnutls/install
157 $(INSTALL_DIR) $(1)/usr/lib
158 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
159 endef
160
161
162 define Package/libgnutls-extra/install
163 $(INSTALL_DIR) $(1)/usr/lib
164 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-extra.so.* $(1)/usr/lib/
165 endef
166
167
168 define Package/libgnutls-openssl/install
169 $(INSTALL_DIR) $(1)/usr/lib
170 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
171 endef
172
173
174 $(eval $(call BuildPackage,certtool))
175 $(eval $(call BuildPackage,gnutls-utils))
176 $(eval $(call BuildPackage,libgnutls))
177 $(eval $(call BuildPackage,libgnutls-extra))
178 $(eval $(call BuildPackage,libgnutls-openssl))