92a9b0ee79401ba8c78a0da6e3b2d5f2637a7d1d
[openwrt/svn-archive/archive.git] / libs / libmcrypt / 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:=libmcrypt
12 PKG_VERSION:=2.5.7
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/mcrypt
18 PKG_MD5SUM:=b1be163143f8e8ed0474beeb642b3bad
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libmcrypt
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Cryptographic library
29 DESCRIPTION:=Cryptographic library.\\\
30 libmcrypt is a cryptographic library that conveniently brings \\\
31 together a variety of ciphers for convenient use.
32 URL:=http://mcrypt.sourceforge.net/
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
37 $(TARGET_CONFIGURE_OPTS) \
38 CFLAGS="$(TARGET_CFLAGS)" \
39 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
40 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -lm" \
41 ./configure \
42 --target=$(GNU_TARGET_NAME) \
43 --host=$(GNU_TARGET_NAME) \
44 --build=$(GNU_HOST_NAME) \
45 --prefix=$(PKG_INSTALL_DIR) \
46 --program-prefix="" \
47 --program-suffix="" \
48 --prefix=/usr \
49 --exec-prefix=/usr \
50 --bindir=/usr/bin \
51 --datadir=/usr/share \
52 --includedir=/usr/include \
53 --infodir=/usr/share/info \
54 --libdir=/usr/lib \
55 --libexecdir=/usr/lib \
56 --localstatedir=/var \
57 --mandir=/usr/share/man \
58 --sbindir=/usr/sbin \
59 --sysconfdir=/etc \
60 $(DISABLE_NLS) \
61 $(DISABLE_LARGEFILE) \
62 --enable-shared \
63 --enable-static \
64 --disable-rpath \
65 );
66 endef
67
68 define Build/Compile
69 rm -rf $(PKG_INSTALL_DIR)
70 mkdir -p $(PKG_INSTALL_DIR)
71 $(MAKE) -C $(PKG_BUILD_DIR) \
72 DESTDIR="$(PKG_INSTALL_DIR)" \
73 all install
74 endef
75
76 define Package/libmcrypt/install
77 install -d -m0755 $(1)/usr/lib
78 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmcrypt.so.* $(1)/usr/lib
79 endef
80
81 define Build/InstallDev
82 mkdir -p $(STAGING_DIR)/usr/include
83 $(CP) $(PKG_INSTALL_DIR)/usr/include/mcrypt.h $(STAGING_DIR)/usr/include/
84 mkdir -p $(STAGING_DIR)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmcrypt.{a,so*} $(STAGING_DIR)/usr/lib/
86 mkdir -p $(STAGING_DIR)/usr/bin
87 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libmcrypt-config $(STAGING_DIR)/usr/bin/
88 $(SED) 's,-I/usr/include,,g' $(STAGING_DIR)/usr/bin/libmcrypt-config
89 $(SED) 's,-L/usr/lib,,g' $(STAGING_DIR)/usr/bin/libmcrypt-config
90 endef
91
92 define Build/UninstallDev
93 rm -rf \
94 $(STAGING_DIR)/usr/include/mcrypt.h \
95 $(STAGING_DIR)/usr/lib/libmcrypt.{a,so*} \
96 $(STAGING_DIR)/usr/bin/mcrypt-config
97 endef
98
99 $(eval $(call BuildPackage,libmcrypt))