package/zlib: update to zlib-1.2.5
[openwrt/svn-archive/archive.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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=zlib
11 PKG_VERSION:=1.2.5
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.zlib.net @SF/libpng
16 PKG_MD5SUM:=be1e89810e66150f5b0327984d8625a0
17
18 PKG_BUILD_PARALLEL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/zlib
23 SECTION:=libs
24 CATEGORY:=Libraries
25 TITLE:=Library implementing the deflate compression method
26 URL:=http://www.zlib.net/
27 endef
28
29 define Build/Configure
30 (cd $(PKG_BUILD_DIR); \
31 $(TARGET_CONFIGURE_OPTS) \
32 LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
33 CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
34 UNAME_S="Linux" \
35 ./configure \
36 --prefix=/usr \
37 --shared \
38 );
39 endef
40
41 define Build/Compile
42 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
43 $(TARGET_CONFIGURE_OPTS) \
44 LDSHARED="$(TARGET_CROSS)ld -shared" \
45 CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
46 libz.a
47 mkdir -p $(PKG_INSTALL_DIR)
48 $(MAKE) -C $(PKG_BUILD_DIR) \
49 DESTDIR="$(PKG_INSTALL_DIR)" \
50 install
51 endef
52
53 define Build/InstallDev
54 mkdir -p $(1)/usr/include
55 $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
56 $(1)/usr/include/
57 mkdir -p $(1)/usr/lib
58 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
59 $(1)/usr/lib/
60 endef
61
62 # libz.so is needed for openssl (zlib-dynamic)
63 define Package/zlib/install
64 $(INSTALL_DIR) $(1)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so $(1)/usr/lib/
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
67 endef
68
69 $(eval $(call BuildPackage,zlib))