Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. CONFIGURE_VARS := \
  39. $(TARGET_CONFIGURE_OPTS) \
  40. LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
  41. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  42. CONFIGURE_ARGS := \
  43. --prefix=/usr \
  44. --shared \
  45. --uname=Linux \
  46. define Build/Compile
  47. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  48. $(TARGET_CONFIGURE_OPTS) \
  49. CFLAGS="$(TARGET_CFLAGS)" \
  50. libz.a libz.so.$(PKG_VERSION)
  51. mkdir -p $(PKG_INSTALL_DIR)
  52. $(MAKE) -C $(PKG_BUILD_DIR) \
  53. DESTDIR="$(PKG_INSTALL_DIR)" \
  54. install
  55. endef
  56. define Build/InstallDev
  57. mkdir -p $(1)/usr/include
  58. $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \
  59. $(1)/usr/include/
  60. mkdir -p $(1)/usr/lib
  61. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
  62. $(1)/usr/lib/
  63. mkdir -p $(1)/usr/lib/pkgconfig
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
  65. $(1)/usr/lib/pkgconfig/
  66. endef
  67. # libz.so is needed for openssl (zlib-dynamic)
  68. define Package/zlib/install
  69. $(INSTALL_DIR) $(1)/usr/lib
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so $(1)/usr/lib/
  71. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(1)/usr/lib/
  72. endef
  73. define Package/zlib-dev/install
  74. $(INSTALL_DIR) $(1)/usr/include
  75. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zconf.h \
  76. $(1)/usr/include/
  77. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zlib.h \
  78. $(1)/usr/include/
  79. $(INSTALL_DIR) $(1)/usr/lib
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.a $(1)/usr/lib/
  81. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  82. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
  83. $(1)/usr/lib/pkgconfig/
  84. endef
  85. $(eval $(call BuildPackage,zlib))
  86. $(eval $(call BuildPackage,zlib-dev))