41be6cc83072412e3065da707fa965086318a39f
[openwrt.git] / package / zlib / 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:=zlib
12 PKG_VERSION:=1.2.3
13 PKG_RELEASE:=3
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://www.zlib.net @SF/zlib
18 PKG_MD5SUM:=dee233bf288ee795ac96a98cc2e369b6
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/zlib
26 SECTION:=base
27 CATEGORY:=Libraries
28 TITLE:=Library implementing the deflate compression method
29 DESCRIPTION:=A library implementing the 'deflate' compression method
30 URL:=http://www.zlib.net/
31 endef
32
33 define Build/Configure
34         (cd $(PKG_BUILD_DIR); \
35                 $(TARGET_CONFIGURE_OPTS) \
36                 LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
37                 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
38                 ./configure \
39                 --prefix=/usr \
40                 --shared \
41         );
42 endef
43
44 define Build/Compile
45         $(MAKE) -C $(PKG_BUILD_DIR) \
46                 $(TARGET_CONFIGURE_OPTS) \
47                 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
48                 libz.a libz.so
49         mkdir -p $(PKG_INSTALL_DIR)
50         $(MAKE) -C $(PKG_BUILD_DIR) \
51                 DESTDIR="$(PKG_INSTALL_DIR)" \
52                 install
53 endef
54
55 define Build/InstallDev
56         mkdir -p $(STAGING_DIR)/usr/include
57         $(CP)   $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
58                 $(STAGING_DIR)/usr/include/
59         mkdir -p $(STAGING_DIR)/usr/lib
60         $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
61                 $(STAGING_DIR)/usr/lib/
62 endef
63         
64 define Build/UninstallDev
65         rm -rf  $(STAGING_DIR)/usr/include/z{conf,lib}.h \
66                 $(STAGING_DIR)/usr/lib/libz.{a,so*}
67 endef
68
69 define Package/zlib/install
70         install -m0755 -d $(1)/usr/lib
71         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
72 endef
73
74 $(eval $(call BuildPackage,zlib))