Convert microperl to new packaging style
[openwrt.git] / package / libpng / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=libpng
6 PKG_VERSION:=1.2.8
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=e5a39003eed16103cbbd3b6a8bc6b1f9
9
10 PKG_SOURCE_URL:=@SF/libpng
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-config.tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-config
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 include $(TOPDIR)/package/rules.mk
18
19 $(eval $(call PKG_template,LIBPNG,libpng,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20
21 $(PKG_BUILD_DIR)/.configured:
22 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
23 $(TARGET_CONFIGURE_OPTS) \
24 CFLAGS="$(TARGET_CFLAGS)" \
25 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
26 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
27 ./configure \
28 --target=$(GNU_TARGET_NAME) \
29 --host=$(GNU_TARGET_NAME) \
30 --build=$(GNU_HOST_NAME) \
31 --program-prefix="" \
32 --program-suffix="" \
33 --prefix=/usr \
34 --exec-prefix=/usr \
35 --bindir=/usr/bin \
36 --datadir=/usr/share \
37 --includedir=/usr/include \
38 --infodir=/usr/share/info \
39 --libdir=/usr/lib \
40 --libexecdir=/usr/lib \
41 --localstatedir=/var \
42 --mandir=/usr/share/man \
43 --sbindir=/usr/sbin \
44 --sysconfdir=/etc \
45 $(DISABLE_LARGEFILE) \
46 $(DISABLE_NLS) \
47 --enable-shared \
48 --enable-static \
49 --with-zlib=$(STAGING_DIR)/usr/ \
50 )
51 touch $(PKG_BUILD_DIR)/.configured
52
53 $(PKG_BUILD_DIR)/.built:
54 mkdir -p $(PKG_INSTALL_DIR)
55 $(MAKE) -C $(PKG_BUILD_DIR) \
56 DESTDIR="$(PKG_INSTALL_DIR)" \
57 all install
58
59 $(IPKG_LIBPNG):
60 install -d -m0755 $(IDIR_LIBPNG)/usr/lib
61 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.so.* $(IDIR_LIBPNG)/usr/lib/
62 $(RSTRIP) $(IDIR_LIBPNG)
63 $(IPKG_BUILD) $(IDIR_LIBPNG) $(PACKAGE_DIR)
64
65 $(STAGING_DIR)/usr/lib/libpng.so: $(PKG_BUILD_DIR)/.built
66 mkdir -p $(STAGING_DIR)/usr/bin
67 cp -fpR $(PKG_INSTALL_DIR)/usr/bin/libpng{,12}-config $(STAGING_DIR)/usr/bin/
68 mkdir -p $(STAGING_DIR)/usr/include
69 cp -fpR $(PKG_INSTALL_DIR)/usr/include/png{,conf}.h $(STAGING_DIR)/usr/include/
70 cp -fpR $(PKG_INSTALL_DIR)/usr/include/libpng $(STAGING_DIR)/usr/include/
71 mkdir -p $(STAGING_DIR)/usr/lib
72 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.{a,so*} $(STAGING_DIR)/usr/lib/
73 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
74 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,12}.pc $(STAGING_DIR)/usr/lib/pkgconfig/
75
76 install-dev: $(STAGING_DIR)/usr/lib/libpng.so
77
78 uninstall-dev:
79 rm -rf \
80 $(STAGING_DIR)/usr/bin/libpng{,12}-config \
81 $(STAGING_DIR)/usr/include/png{,conf}.h \
82 $(STAGING_DIR)/usr/include/libpng \
83 $(STAGING_DIR)/usr/lib/libpng{,12}.{a,so*} \
84 $(STAGING_DIR)/usr/lib/pkgconfig/libpng{,12}.pc
85
86 compile: install-dev
87 clean: uninstall-dev
88
This page took 0.040489 seconds and 5 git commands to generate.