port opencdk to buildroot-ng
[openwrt/svn-archive/archive.git] / libs / opencdk / 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:=opencdk
12 PKG_VERSION:=0.5.5
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:=ftp://ftp.gnutls.org/pub/gnutls/opencdk/ \
18 ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/opencdk/ \
19 http://www.mirrors.wiretapped.net/security/network-security/gnutls/opencdk/ \
20 ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/opencdk/ \
21 http://josefsson.org/gnutls/releases/opencdk/
22 PKG_MD5SUM:=aaff60107f0153873192ffda00699a96
23 PKG_CAT:=bzcat
24
25 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/libopencdk
30 SECTION:=libs
31 CATEGORY:=Libraries
32 DEPENDS:=+libgcrypt
33 TITLE:=The Open Crypto Development Kit library
34 DESCRIPTION:=The Open Crypto Development Kit library.\\\
35 This library provides basic parts of the OpenPGP message format.\\\
36 For reference, please read the rfc2440.txt in the doc/ directory.\\\
37 Due to some possible security problems, the library also implements \\\
38 parts of draft-ietf-openpgp-rfc2440bis-08.txt. If you want to exchange \\\
39 messages with earlier PGP version < 7, you should use the compat mode.
40 URL:=ftp://ftp.gnutls.org/pub/gnutls/opencdk/
41 endef
42
43 define Build/Configure
44 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
45 touch configure.ac ; \
46 touch acinclude.m4 ; \
47 touch aclocal.m4 ; \
48 touch Makefile.in ; \
49 touch config.h.in ; \
50 touch configure ; \
51 $(TARGET_CONFIGURE_OPTS) \
52 CFLAGS="$(TARGET_CFLAGS)" \
53 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
54 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
55 ./configure \
56 --target=$(GNU_TARGET_NAME) \
57 --host=$(GNU_TARGET_NAME) \
58 --build=$(GNU_HOST_NAME) \
59 --program-prefix="" \
60 --program-suffix="" \
61 --prefix=/usr \
62 --exec-prefix=/usr \
63 --bindir=/usr/bin \
64 --datadir=/usr/share \
65 --includedir=/usr/include \
66 --infodir=/usr/share/info \
67 --libdir=/usr/lib \
68 --libexecdir=/usr/lib \
69 --localstatedir=/var \
70 --mandir=/usr/share/man \
71 --sbindir=/usr/sbin \
72 --sysconfdir=/etc \
73 $(DISABLE_NLS) \
74 $(DISABLE_LARGEFILE) \
75 --enable-shared \
76 --enable-static \
77 --disable-rpath \
78 --with-libgcrypt-prefix="$(STAGING_DIR)/usr" \
79 );
80 endef
81
82 define Build/Compile
83 rm -rf $(PKG_INSTALL_DIR)
84 mkdir -p $(PKG_INSTALL_DIR)
85 $(MAKE) -C $(PKG_BUILD_DIR) \
86 DESTDIR="$(PKG_INSTALL_DIR)" \
87 all install
88 endef
89
90 define Package/libopencdk/install
91 install -m0755 -d $(1)/usr/lib
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopencdk.so.* $(1)/usr/lib/
93 endef
94
95 define Build/InstallDev
96 mkdir -p $(STAGING_DIR)/usr/bin
97 $(CP) $(PKG_INSTALL_DIR)/usr/bin/opencdk-config $(STAGING_DIR)/usr/bin/
98 mkdir -p $(STAGING_DIR)/usr/include
99 $(CP) $(PKG_INSTALL_DIR)/usr/include/opencdk.h $(STAGING_DIR)/usr/include/
100 mkdir -p $(STAGING_DIR)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopencdk.{a,so*} $(STAGING_DIR)/usr/lib/
102 endef
103
104 define Build/UninstallDev
105 rm -rf \
106 $(STAGING_DIR)/usr/bin/opencdk-config \
107 $(STAGING_DIR)/usr/include/opencdk.h \
108 $(STAGING_DIR)/usr/lib/libopencdk.{a,so*}
109 endef
110
111 $(eval $(call BuildPackage,libopencdk))