365d0855bbefeab0d36a8f60f41445634fb15b27
[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.1
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://ftp.gnupg.org/gcrypt/libgcrypt/
18 PKG_MD5SUM:=b6d3217c9333c520fe54d2e8dc5e60ec
19 PKG_CAT:=bzcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
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 DESCRIPTION:=The GNU crypto library.\\\
31 This is a general purpose cryptographic library based on the code from \\\
32 GnuPG. It provides functions for all cryptograhic building blocks: \\\
33 symmetric ciphers (AES, DES, Blowfish, CAST5, Twofish, Arcfour), hash \\\
34 algorithms (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192), MACs (HMAC for all \\\
35 hash algorithms), public key algorithms (RSA, ElGamal, DSA), large \\\
36 integer functions, random numbers and a lot of supporting functions.
37 URL:=http://directory.fsf.org/security/libgcrypt.html
38 endef
39
40 define Build/Configure
41 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
42 $(TARGET_CONFIGURE_OPTS) \
43 CFLAGS="$(TARGET_CFLAGS)" \
44 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
45 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
46 ./configure \
47 --target=$(GNU_TARGET_NAME) \
48 --host=$(GNU_TARGET_NAME) \
49 --build=$(GNU_HOST_NAME) \
50 --program-prefix="" \
51 --program-suffix="" \
52 --prefix=/usr \
53 --exec-prefix=/usr \
54 --bindir=/usr/bin \
55 --datadir=/usr/share \
56 --includedir=/usr/include \
57 --infodir=/usr/share/info \
58 --libdir=/usr/lib \
59 --libexecdir=/usr/lib \
60 --localstatedir=/var \
61 --mandir=/usr/share/man \
62 --sbindir=/usr/sbin \
63 --sysconfdir=/etc \
64 $(DISABLE_NLS) \
65 $(DISABLE_LARGEFILE) \
66 --enable-shared \
67 --enable-static \
68 --disable-rpath \
69 --disable-asm \
70 --with-gpg-error-prefix="$(STAGING_DIR)/usr" \
71 );
72 endef
73
74 define Build/Compile
75 rm -rf $(PKG_INSTALL_DIR)
76 mkdir -p $(PKG_INSTALL_DIR)
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
79 all install
80 endef
81
82 define Package/libgcrypt/install
83 install -m0755 -d $(1)/usr/lib
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.so.* $(1)/usr/lib/
85 endef
86
87 define Build/InstallDev
88 mkdir -p $(STAGING_DIR)/usr/bin
89 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libgcrypt-config $(STAGING_DIR)/usr/bin/
90 mkdir -p $(STAGING_DIR)/usr/include
91 $(CP) $(PKG_INSTALL_DIR)/usr/include/gcrypt*.h $(STAGING_DIR)/usr/include/
92 mkdir -p $(STAGING_DIR)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgcrypt.{a,so*} $(STAGING_DIR)/usr/lib/
94 mkdir -p $(STAGING_DIR)/usr/share/aclocal
95 $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/libgcrypt.m4 $(STAGING_DIR)/usr/share/aclocal/
96 endef
97
98 define Build/UninstallDev
99 rm -rf \
100 $(STAGING_DIR)/usr/bin/libgcrypt-config \
101 $(STAGING_DIR)/usr/include/gcrypt*.h \
102 $(STAGING_DIR)/usr/lib/libgcrypt.{a,so*} \
103 $(STAGING_DIR)/usr/share/aclocal/libgcrypt.m4
104 endef
105
106 $(eval $(call BuildPackage,libgcrypt))