use Build/Configure/Default macro, Makefile cleanup
[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_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-config.tar.gz
16 PKG_SOURCE_URL:=@SF/libpng
17 PKG_MD5SUM:=e5a39003eed16103cbbd3b6a8bc6b1f9
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-config
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 URL:=http://www.libpng.org/pub/png/libpng.html
31 endef
32
33 define Build/Configure
34 $(call Build/Configure/Default, \
35 --enable-shared \
36 --enable-static \
37 --with-zlib="$(STAGING_DIR)/usr" \
38 )
39 endef
40
41 define Build/Compile
42 $(MAKE) -C $(PKG_BUILD_DIR) \
43 DESTDIR="$(PKG_INSTALL_DIR)" \
44 all install
45 endef
46
47 define Build/InstallDev
48 mkdir -p $(STAGING_DIR)/usr/bin
49 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libpng{,12}-config $(STAGING_DIR)/usr/bin/
50 mkdir -p $(STAGING_DIR)/usr/include
51 $(CP) $(PKG_INSTALL_DIR)/usr/include/png{,conf}.h $(STAGING_DIR)/usr/include/
52 $(CP) $(PKG_INSTALL_DIR)/usr/include/libpng $(STAGING_DIR)/usr/include/
53 mkdir -p $(STAGING_DIR)/usr/lib
54 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.{a,so*} $(STAGING_DIR)/usr/lib/
55 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
56 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,12}.pc $(STAGING_DIR)/usr/lib/pkgconfig/
57 $(SED) 's,^[ILR]_opts=".\+",,g' $(STAGING_DIR)/usr/bin/libpng*-config
58 $(SED) 's,-I$$$${includedir}/libpng12,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libpng{,12}.pc
59 endef
60
61 define Build/UninstallDev
62 rm -rf \
63 $(STAGING_DIR)/usr/bin/libpng{,12}-config \
64 $(STAGING_DIR)/usr/include/png{,conf}.h \
65 $(STAGING_DIR)/usr/include/libpng \
66 $(STAGING_DIR)/usr/lib/libpng{,12}.{a,so*} \
67 $(STAGING_DIR)/usr/lib/pkgconfig/libpng{,12}.pc
68 endef
69
70 define Package/libpng/install
71 install -d -m0755 $(1)/usr/lib
72 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.so.* $(1)/usr/lib/
73 endef
74
75 $(eval $(call BuildPackage,libpng))