gnutls:
[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 define Package/gnutls-utils
40 $(call Package/gnutls/Default)
41 SECTION:=utils
42 CATEGORY:=Utilities
43 DEPENDS:=+libgnutls +libgpg-error
44 TITLE+= (utilities)
45 DESCRIPTION+=\\\
46 \\\
47 This package contains some GnuTLS utilities.
48 endef
49
50 define Package/libgnutls
51 $(call Package/gnutls/Default)
52 DEPENDS:=+libgcrypt
53 TITLE+= (library)
54 DESCRIPTION+=\\\
55 \\\
56 This package contains the GnuTLS shared libraries, needed by other programs.
57 endef
58
59 define Package/libgnutls-openssl
60 $(call Package/gnutls/Default)
61 DEPENDS:=libgnutls
62 TITLE+= (OpenSSL compat library)
63 DESCRIPTION+=\\\
64 \\\
65 This package contains the GnuTLS OpenSSL compatibility layer shared library.
66 endef
67
68 define Build/Configure
69 $(call Build/Configure/Default, \
70 --enable-shared \
71 --enable-static \
72 --disable-srp-authentication \
73 --with-included-libtasn1=yes \
74 --with-included-libcfg=yes \
75 --without-libopencdk-prefix \
76 --without-zlib \
77 --without-lzo \
78 )
79 $(call libtool_disable_rpath)
80 endef
81
82 define Build/Compile
83 $(MAKE) -C $(PKG_BUILD_DIR) all
84 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
85 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
86 endef
87
88 define Build/InstallDev
89 mkdir -p $(STAGING_DIR)/usr/bin
90 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libgnutls{,-extra}-config $(STAGING_DIR)/usr/bin/
91 mkdir -p $(STAGING_DIR)/usr/include
92 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(STAGING_DIR)/usr/include/
93 mkdir -p $(STAGING_DIR)/usr/lib
94 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(STAGING_DIR)/usr/lib/
95 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(STAGING_DIR)/usr/lib/pkgconfig/
97 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc
98 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc
99 $(SED) "s,"prefix\=/usr",prefix=$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/lib/pkgconfig/gnutls-extra.pc
100 $(SED) "s,"exec_prefix\=/usr",exec_prefix=$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/lib/pkgconfig/gnutls-extra.pc
101 endef
102
103 define Build/UninstallDev
104 rm -rf $(STAGING_DIR)/usr/bin/libgnutls{,-extra}-config \
105 $(STAGING_DIR)/usr/include/gnutls \
106 $(STAGING_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} \
107 $(STAGING_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc \
108 $(STAGING_DIR)/usr/share/aclocal/libgnutls{,-extra}.m4
109 endef
110
111 define Package/gnutls-utils/install
112 $(INSTALL_DIR) $(1)/usr/bin
113 $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
114 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
115 endef
116
117 define Package/libgnutls/install
118 $(INSTALL_DIR) $(1)/usr/lib
119 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra}.so.* $(1)/usr/lib/
120 endef
121
122 define Package/libgnutls-openssl/install
123 $(INSTALL_DIR) $(1)/usr/lib
124 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
125 endef
126
127 $(eval $(call BuildPackage,gnutls-utils))
128 $(eval $(call BuildPackage,libgnutls))
129 $(eval $(call BuildPackage,libgnutls-openssl))