enable $(FPIC) for a few more packages
[packages.git] / libs / libgcrypt / Makefile
1 #
2 # Copyright (C) 2005-2008 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.4.1
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgcrypt/
17 PKG_MD5SUM:=26703ecef4bbe113b8e6a87572b80b32
18
19 PKG_FIXUP:=libtool
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libgcrypt
24   SECTION:=libs
25   CATEGORY:=Libraries
26   DEPENDS:=+libgpg-error
27   TITLE:=GNU crypto library
28   URL:=http://directory.fsf.org/security/libgcrypt.html
29 endef
30
31 define Package/libgcrypt/description
32  This is a general purpose cryptographic library based on the code from 
33  GnuPG. It provides functions for all cryptograhic building blocks: 
34  symmetric ciphers (AES, DES, Arcfour), hash algorithms (MD5, SHA-1,
35  RIPE-MD160, SHA-224/256, SHA-384/512), MACs (HMAC for all hash
36  algorithms), public key algorithms (RSA, DSA), large integer functions,
37  random numbers and a lot of supporting functions. Some algorithms have
38  been disabled to reduce size (Blowfish, CAST5, Twofish, Serpent,
39  RC2, SEED, Camellia, CRC, MD4, TIGER-192, Whirlpool, ElGamal, ECC).
40 endef
41
42 TARGET_CFLAGS += $(FPIC)
43
44 CONFIGURE_ARGS+= \
45         --enable-shared \
46         --enable-static \
47         --disable-asm \
48         --with-gpg-error-prefix="$(STAGING_DIR)/usr" \
49         --enable-digests="md5 rmd160 sha1 sha256 sha512" \
50         --enable-ciphers="arcfour des aes" \
51         --enable-pubkey-ciphers="rsa dsa" \
52
53 define Build/Compile
54         $(MAKE) -C $(PKG_BUILD_DIR) \
55                 DESTDIR="$(PKG_INSTALL_DIR)" \
56                 all install
57 endef
58
59 define Build/InstallDev
60         mkdir -p $(1)/usr/bin $(2)/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/share/aclocal
61         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgcrypt-config $(1)/usr/bin/
62         $(CP) $(PKG_INSTALL_DIR)/usr/include/gcrypt*.h $(1)/usr/include/
63         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.{la,a,so*} $(1)/usr/lib/
64         $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/libgcrypt.m4 $(1)/usr/share/aclocal/
65         $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/libgcrypt-config
66         $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/libgcrypt-config
67         ln -sf $(STAGING_DIR)/usr/bin/libgcrypt-config $(2)/bin/
68 endef
69
70 define Package/libgcrypt/install
71         $(INSTALL_DIR) $(1)/usr/lib
72         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.so.* $(1)/usr/lib/
73 endef
74
75 $(eval $(call BuildPackage,libgcrypt))