zlib: Update to 1.2.9
[openwrt/staging/yousong.git] / package / libs / zlib / Makefile
1 #
2 # Copyright (C) 2006-2013 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.9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://www.zlib.net @SF/libpng
16 PKG_HASH:=03d9c7f67976cf1389589782de46f45011053ea7f4222c2fb8c2cf9fd813bb68
17
18 PKG_LICENSE:=Zlib
19 PKG_LICENSE_FILES:=README
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/zlib
24 SECTION:=libs
25 CATEGORY:=Libraries
26 TITLE:=Library implementing the deflate compression method
27 URL:=http://www.zlib.net/
28 endef
29
30 define Package/zlib-dev
31 SECTION:=devel
32 CATEGORY:=Development
33 SUBMENU:=Libraries
34 DEPENDS:=zlib
35 TITLE:=Development files for the zlib library
36 endef
37
38 define Package/zlib/description
39 zlib is a lossless data-compression library.
40 This package includes the shared library.
41 endef
42
43 define Package/zlib-dev/description
44 zlib is a lossless data-compression library.
45 This package includes the development support files.
46 endef
47
48 define Build/Configure
49 (cd $(PKG_BUILD_DIR); \
50 $(TARGET_CONFIGURE_OPTS) \
51 LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
52 CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
53 ./configure \
54 --prefix=/usr \
55 --shared \
56 --uname=Linux \
57 );
58 endef
59
60 define Build/Compile
61 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
62 $(TARGET_CONFIGURE_OPTS) \
63 CFLAGS="$(TARGET_CFLAGS)" \
64 libz.a libz.so.$(PKG_VERSION)
65 mkdir -p $(PKG_INSTALL_DIR)
66 $(MAKE) -C $(PKG_BUILD_DIR) \
67 DESTDIR="$(PKG_INSTALL_DIR)" \
68 install
69 endef
70
71 define Build/InstallDev
72 mkdir -p $(1)/usr/include
73 $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
74 $(1)/usr/include/
75 mkdir -p $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
77 $(1)/usr/lib/
78 mkdir -p $(1)/usr/lib/pkgconfig
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
80 $(1)/usr/lib/pkgconfig/
81 endef
82
83 # libz.so is needed for openssl (zlib-dynamic)
84 define Package/zlib/install
85 $(INSTALL_DIR) $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so $(1)/usr/lib/
87 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
88 endef
89
90 define Package/zlib-dev/install
91 $(INSTALL_DIR) $(1)/usr/include
92 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zconf.h \
93 $(1)/usr/include/
94 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zlib.h \
95 $(1)/usr/include/
96 $(INSTALL_DIR) $(1)/usr/lib
97 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.a $(1)/usr/lib/
98 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
99 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
100 $(1)/usr/lib/pkgconfig/
101 endef
102
103 $(eval $(call BuildPackage,zlib))
104 $(eval $(call BuildPackage,zlib-dev))