47cbf579df555d83a07b204215ae027b971241cb
[openwrt/svn-archive/archive.git] / libs / libpng / 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:=libpng
12 PKG_VERSION:=1.2.8
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-config
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-config.tar.gz
17 PKG_SOURCE_URL:=@SF/libpng
18 PKG_MD5SUM:=e5a39003eed16103cbbd3b6a8bc6b1f9
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libpng
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+zlib
29 TITLE:=A PNG format files handling library
30 DESCRIPTION:=A PNG (Portable Network Graphics) format files handling library.
31 URL:=http://www.libpng.org/pub/png/libpng.html
32 endef
33
34 define Build/Configure
35 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
36 $(TARGET_CONFIGURE_OPTS) \
37 CFLAGS="$(TARGET_CFLAGS)" \
38 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
39 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
40 ./configure \
41 --target=$(GNU_TARGET_NAME) \
42 --host=$(GNU_TARGET_NAME) \
43 --build=$(GNU_HOST_NAME) \
44 --program-prefix="" \
45 --program-suffix="" \
46 --prefix=/usr \
47 --exec-prefix=/usr \
48 --bindir=/usr/bin \
49 --datadir=/usr/share \
50 --includedir=/usr/include \
51 --infodir=/usr/share/info \
52 --libdir=/usr/lib \
53 --libexecdir=/usr/lib \
54 --localstatedir=/var \
55 --mandir=/usr/share/man \
56 --sbindir=/usr/sbin \
57 --sysconfdir=/etc \
58 $(DISABLE_LARGEFILE) \
59 $(DISABLE_NLS) \
60 --enable-shared \
61 --enable-static \
62 --with-zlib=$(STAGING_DIR)/usr/ \
63 );
64 endef
65
66 define Build/Compile
67 rm -rf $(PKG_INSTALL_DIR)
68 mkdir -p $(PKG_INSTALL_DIR)
69 $(MAKE) -C $(PKG_BUILD_DIR) \
70 DESTDIR="$(PKG_INSTALL_DIR)" \
71 all install
72 endef
73
74 define Package/libpng/install
75 install -d -m0755 $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.so.* $(1)/usr/lib/
77 endef
78
79 define Build/InstallDev
80 mkdir -p $(STAGING_DIR)/usr/bin
81 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libpng{,12}-config $(STAGING_DIR)/usr/bin/
82 mkdir -p $(STAGING_DIR)/usr/include
83 $(CP) $(PKG_INSTALL_DIR)/usr/include/png{,conf}.h $(STAGING_DIR)/usr/include/
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/libpng $(STAGING_DIR)/usr/include/
85 mkdir -p $(STAGING_DIR)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.{a,so*} $(STAGING_DIR)/usr/lib/
87 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,12}.pc $(STAGING_DIR)/usr/lib/pkgconfig/
89 $(SED) 's,^[ILR]_opts=".\+",,g' $(STAGING_DIR)/usr/bin/libpng*-config
90 endef
91
92 define Build/UninstallDev
93 rm -rf \
94 $(STAGING_DIR)/usr/bin/libpng{,12}-config \
95 $(STAGING_DIR)/usr/include/png{,conf}.h \
96 $(STAGING_DIR)/usr/include/libpng \
97 $(STAGING_DIR)/usr/lib/libpng{,12}.{a,so*} \
98 $(STAGING_DIR)/usr/lib/pkgconfig/libpng{,12}.pc
99 endef
100
101 $(eval $(call BuildPackage,libpng))