replace lots of manual install commands with INSTALL_* variables
[packages.git] / libs / gnutls / Makefile
1
2 # Copyright (C) 2006 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:=1.0.25
13 PKG_RELEASE:=0
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.gnutls.org/pub/gnutls/ \
17         ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/ \
18         http://www.mirrors.wiretapped.net/security/network-security/gnutls/ \
19         ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/ \
20         http://josefsson.org/gnutls/releases/
21 PKG_MD5SUM:=3585b5b204135e51e0efc9084b3e028b
22 PKG_CAT:=zcat
23
24 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
25 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/gnutls/Default
30   SECTION:=libs
31   CATEGORY:=Libraries
32   TITLE:=GNU TLS
33   DESCRIPTION:=\
34         GnuTLS is a project that aims to develop a library which provides a \\\
35         secure layer, over a reliable transport layer. Currently the GnuTLS \\\
36         library implements the proposed standards by the IETF's TLS working \\\
37         group.
38   URL:=http://www.gnu.org/software/gnutls/
39 endef
40
41 define Package/gnutls-utils
42   $(call Package/gnutls/Default)
43   SECTION:=utils
44   CATEGORY:=Utilities
45   DEPENDS:=+libgnutls
46   TITLE+= (utilities)
47   DESCRIPTION+=\\\
48         \\\
49         This package contains some GnuTLS utilities.
50 endef
51
52 define Package/libgnutls
53   $(call Package/gnutls/Default)
54   DEPENDS:=+libgcrypt
55   TITLE+= (library)
56   DESCRIPTION+=\\\
57         \\\
58         This package contains the GnuTLS shared libraries, needed by other programs.
59 endef
60
61 define Package/libgnutls-openssl
62   $(call Package/gnutls/Default)
63   DEPENDS:=libgnutls
64   TITLE+= (OpenSSL compat library)
65   DESCRIPTION+=\\\
66         \\\
67         This package contains the GnuTLS OpenSSL compatibility layer shared library.
68 endef
69
70 define Build/Configure
71         (cd $(PKG_BUILD_DIR); touch \
72                 configure.in \
73                 acinclude.m4 \
74                 aclocal.m4 \
75                 Makefile.in \
76                 config.h.in \
77                 configure \
78         )
79         $(call Build/Configure/Default, \
80                 --enable-shared \
81                 --enable-static \
82                 --disable-srp-authentication \
83                 --disable-anon-authentication \
84                 --disable-openpgp-authentication \
85                 --with-included-opencdk=yes \
86                 --with-included-libtasn1=yes \
87                 --with-included-libcfg=yes \
88                 --without-zlib \
89                 --without-lzo \
90         )
91 endef
92
93 define Build/Compile
94         $(MAKE) -C $(PKG_BUILD_DIR) \
95                 DESTDIR="$(PKG_INSTALL_DIR)" \
96                 all install
97 endef
98
99 define Build/InstallDev
100         mkdir -p $(STAGING_DIR)/usr/bin
101         $(CP) $(PKG_INSTALL_DIR)/usr/bin/libgnutls{,-extra}-config $(STAGING_DIR)/usr/bin/
102         mkdir -p $(STAGING_DIR)/usr/include
103         $(CP) $(PKG_INSTALL_DIR)/usr/include/gnutls $(STAGING_DIR)/usr/include/
104         mkdir -p $(STAGING_DIR)/usr/lib
105         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} $(STAGING_DIR)/usr/lib/
106         mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
107         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc $(STAGING_DIR)/usr/lib/pkgconfig/
108         $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc
109         $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc
110         mkdir -p $(STAGING_DIR)/usr/share/aclocal
111         $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/libgnutls{,-extra}.m4 $(STAGING_DIR)/usr/share/aclocal/
112 endef
113
114 define Build/UninstallDev
115         rm -rf  $(STAGING_DIR)/usr/bin/libgnutls{,-extra}-config \
116                 $(STAGING_DIR)/usr/include/gnutls \
117                 $(STAGING_DIR)/usr/lib/libgnutls{,-extra,-openssl}.{a,so*} \
118                 $(STAGING_DIR)/usr/lib/pkgconfig/gnutls{,-extra}.pc \
119                 $(STAGING_DIR)/usr/share/aclocal/libgnutls{,-extra}.m4
120 endef
121
122 define Package/gnutls-utils/install
123         $(INSTALL_DIR) $(1)/usr/bin
124         $(CP) $(PKG_INSTALL_DIR)/usr/bin/certtool $(1)/usr/bin/
125         $(CP) $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} $(1)/usr/bin/
126 endef
127
128 define Package/libgnutls/install
129         $(INSTALL_DIR) $(1)/usr/lib
130         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls{,-extra}.so.* $(1)/usr/lib/
131 endef
132
133 define Package/libgnutls-openssl/install
134         $(INSTALL_DIR) $(1)/usr/lib
135         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnutls-openssl.so.* $(1)/usr/lib/
136 endef
137
138 $(eval $(call BuildPackage,gnutls-utils))
139 $(eval $(call BuildPackage,libgnutls))
140 $(eval $(call BuildPackage,libgnutls-openssl))