0322f4f97e87302e8148ece824c97b9577e45b34
[packages.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 PKG_LIBTOOL_PATHS:=. lib libextra
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 SSL 3.0, TLS 1.0, and TLS 1.1 protocols.
35 endef
36
37
38 define Package/certtool
39 $(call Package/gnutls/Default)
40   SECTION:=utils
41   CATEGORY:=Utilities
42   TITLE+= (certool utility)
43   DEPENDS+= +libgnutls +libncurses +libreadline
44 endef
45
46 define Package/certtool/description
47 $(call Package/gnutls/Default/description)
48  This package contains the GnuTLS certtool utility.
49 endef
50
51
52 define Package/gnutls-utils
53 $(call Package/gnutls/Default)
54   SECTION:=utils
55   CATEGORY:=Utilities
56   TITLE+= (utilities)
57   DEPENDS+= +libgnutls +libgnutls-extra
58 endef
59
60 define Package/gnutls-utils/description
61 $(call Package/gnutls/Default/description)
62  This package contains the GnuTLS gnutls-cli, gnutls-serv, psktool,
63  and srptool utilities.
64 endef
65
66
67 define Package/libgnutls
68 $(call Package/gnutls/Default)
69  TITLE+= (library)
70  DEPENDS+= +zlib +libgcrypt +libgpg-error
71  SUBMENU:=SSL
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  SUBMENU:=SSL
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  SUBMENU:=SSL
98 endef
99
100 define Package/libgnutls-openssl/description
101 $(call Package/gnutls/Default/description)
102  This package contains the GnuTLS OpenSSL compatibility layer shared library.
103 endef
104
105 TARGET_CFLAGS += $(FPIC)
106
107 CONFIGURE_ARGS+= \
108         --enable-shared \
109         --enable-static \
110         --disable-openpgp-authentication \
111         --disable-guile \
112         --with-included-libcfg \
113         --with-included-libtasn1 \
114         --with-libgcrypt-prefix="$(STAGING_DIR)/usr" \
115         --with-libreadline-prefix="$(STAGING_DIR)/usr" \
116         --with-libz-prefix="$(STAGING_DIR)/usr" \
117
118 # XXX: AM_CFLAGS duplicates with CFLAGS
119 MAKE_ARGS:= \
120         AM_CFLAGS="" \
121
122 define Build/Configure
123         $(SED) 's,-I$$$${includedir},,g' $(PKG_BUILD_DIR)/configure
124         $(SED) 's,-L$$$${libdir},,g' $(PKG_BUILD_DIR)/configure
125         $(call Build/Configure/Default)
126 endef
127
128 define Build/Compile
129         $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) DESTDIR="$(PKG_INSTALL_DIR)" all install
130 endef
131
132 define Build/InstallDev
133         $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
134         $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(1)/usr/include/
135         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(1)/usr/lib/
136         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(1)/usr/lib/pkgconfig/
137 endef
138
139 define Package/certtool/conffiles
140 /etc/gnutls/certtool.cfg
141 endef
142
143 define Package/certtool/install
144         $(INSTALL_DIR) $(1)/etc/gnutls
145         $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/certtool.cfg $(1)/etc/gnutls/
146         $(INSTALL_DIR) $(1)/usr/bin
147         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
148 endef
149
150
151 define Package/gnutls-utils/install
152         $(INSTALL_DIR) $(1)/usr/bin
153         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
154         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psktool $(1)/usr/bin/
155         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/srptool $(1)/usr/bin/
156 endef
157
158
159 define Package/libgnutls/install
160         $(INSTALL_DIR) $(1)/usr/lib
161         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls.so.* $(1)/usr/lib/
162 endef
163
164
165 define Package/libgnutls-extra/install
166         $(INSTALL_DIR) $(1)/usr/lib
167         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-extra.so.* $(1)/usr/lib/
168 endef
169
170
171 define Package/libgnutls-openssl/install
172         $(INSTALL_DIR) $(1)/usr/lib
173         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
174 endef
175
176
177 $(eval $(call BuildPackage,certtool))
178 $(eval $(call BuildPackage,gnutls-utils))
179 $(eval $(call BuildPackage,libgnutls))
180 $(eval $(call BuildPackage,libgnutls-extra))
181 $(eval $(call BuildPackage,libgnutls-openssl))