2
0

Makefile 2.6 KB

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