fix gcrypt staging
[openwrt/svn-archive/archive.git] / libs / libgcrypt / 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:=libgcrypt
12 PKG_VERSION:=1.2.3
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://ftp.gnupg.org/gcrypt/libgcrypt/
17 PKG_MD5SUM:=49810175ab672b19a02509d2a670b156
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libgcrypt
25 SECTION:=libs
26 CATEGORY:=Libraries
27 DEPENDS:=+libgpg-error
28 TITLE:=GNU crypto library
29 URL:=http://directory.fsf.org/security/libgcrypt.html
30 endef
31
32 define Package/libgcrypt/description
33 This is a general purpose cryptographic library based on the code from
34 GnuPG. It provides functions for all cryptograhic building blocks:
35 symmetric ciphers (AES, DES, Blowfish, CAST5, Twofish, Arcfour), hash
36 algorithms (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192), MACs (HMAC for all
37 hash algorithms), public key algorithms (RSA, ElGamal, DSA), large
38 integer functions, random numbers and a lot of supporting functions.
39 endef
40
41 define Build/Configure
42 $(call Build/Configure/Default, \
43 --enable-shared \
44 --enable-static \
45 --disable-asm \
46 --with-gpg-error-prefix="$(STAGING_DIR)/usr" \
47 )
48 endef
49
50 define Build/Compile
51 $(MAKE) -C $(PKG_BUILD_DIR) \
52 DESTDIR="$(PKG_INSTALL_DIR)" \
53 all install
54 endef
55
56 define Build/InstallDev
57 mkdir -p $(2)/bin
58 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgcrypt-config $(2)/bin/
59 mkdir -p $(1)/usr/include
60 $(CP) $(PKG_INSTALL_DIR)/usr/include/gcrypt*.h $(1)/usr/include/
61 mkdir -p $(1)/usr/lib
62 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.{a,so*} $(1)/usr/lib/
63 mkdir -p $(1)/usr/share/aclocal
64 $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/libgcrypt.m4 $(1)/usr/share/aclocal/
65 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(1)/usr/lib,g' $(2)/bin/libgcrypt-config
66 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(1)/usr/include/,g' $(2)/bin/libgcrypt-config
67 endef
68
69 define Build/UninstallDev
70 rm -rf \
71 $(2)/bin/libgcrypt-config \
72 $(1)/usr/include/gcrypt*.h \
73 $(1)/usr/lib/libgcrypt.{a,so*} \
74 $(1)/usr/share/aclocal/libgcrypt.m4
75 endef
76
77 define Package/libgcrypt/install
78 $(INSTALL_DIR) $(1)/usr/lib
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.so.* $(1)/usr/lib/
80 endef
81
82 $(eval $(call BuildPackage,libgcrypt))