lots of package cleanups/fixes
[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 PKG_FIXUP:=libtool
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libgcrypt
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+libgpg-error
29 TITLE:=GNU crypto library
30 URL:=http://directory.fsf.org/security/libgcrypt.html
31 endef
32
33 define Package/libgcrypt/description
34 This is a general purpose cryptographic library based on the code from
35 GnuPG. It provides functions for all cryptograhic building blocks:
36 symmetric ciphers (AES, DES, Blowfish, CAST5, Twofish, Arcfour), hash
37 algorithms (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192), MACs (HMAC for all
38 hash algorithms), public key algorithms (RSA, ElGamal, DSA), large
39 integer functions, random numbers and a lot of supporting functions.
40 endef
41
42 define Build/Configure
43 $(call Build/Configure/Default, \
44 --enable-shared \
45 --enable-static \
46 --disable-asm \
47 --with-gpg-error-prefix="$(STAGING_DIR)/usr" \
48 )
49 endef
50
51 define Build/Compile
52 $(MAKE) -C $(PKG_BUILD_DIR) \
53 DESTDIR="$(PKG_INSTALL_DIR)" \
54 all install
55 endef
56
57 define Build/InstallDev
58 mkdir -p $(1)/usr/bin $(2)/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/share/aclocal
59 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libgcrypt-config $(1)/usr/bin/
60 $(CP) $(PKG_INSTALL_DIR)/usr/include/gcrypt*.h $(1)/usr/include/
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.{la,a,so*} $(1)/usr/lib/
62 $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/libgcrypt.m4 $(1)/usr/share/aclocal/
63 $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/libgcrypt-config
64 $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/libgcrypt-config
65 ln -sf $(1)/usr/bin/libgcrypt-config $(2)/bin/
66 endef
67
68 define Package/libgcrypt/install
69 $(INSTALL_DIR) $(1)/usr/lib
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.so.* $(1)/usr/lib/
71 endef
72
73 $(eval $(call BuildPackage,libgcrypt))