Fix libtool pkg-config paths #1716
[openwrt/svn-archive/archive.git] / libs / libxml2 / 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:=libxml2
12 PKG_VERSION:=2.6.20
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://xmlsoft.org/sources/ \
17 ftp://fr.rpmfind.net/pub/libxml/
18 PKG_MD5SUM:=8f0b3ce721bda11401e656b90ba4e78c
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/libxml2
27 SECTION:=libs
28 CATEGORY:=Libraries
29 DEPENDS:=+libpthread +zlib
30 TITLE:=Gnome XML library
31 DESCRIPTION:=\
32 A library for manipulating XML and HTML resources.
33 URL:=http://xmlsoft.org/
34 endef
35
36 define Build/Configure
37 $(call Build/Configure/Default, \
38 --enable-shared \
39 --enable-static \
40 --without-c14n \
41 --without-catalog \
42 --without-debug \
43 --without-docbook \
44 --with-html \
45 --without-ftp \
46 --without-http \
47 --without-iconv \
48 --without-iso8859x \
49 --without-legacy \
50 --with-output \
51 --without-pattern \
52 --without-push \
53 --without-python \
54 --with-reader \
55 --without-readline \
56 --without-regexps \
57 --with-sax1 \
58 --with-schemas \
59 --with-threads \
60 --with-tree \
61 --with-valid \
62 --with-writer \
63 --with-xinclude \
64 --with-xpath \
65 --with-xptr \
66 --with-zlib \
67 )
68 endef
69
70 define Build/Compile
71 $(MAKE) -C $(PKG_BUILD_DIR) \
72 DESTDIR="$(PKG_INSTALL_DIR)" \
73 all install
74 endef
75
76 define Build/InstallDev
77 mkdir -p $(STAGING_DIR)/usr/bin
78 $(CP) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(STAGING_DIR)/usr/bin/
79 mkdir -p $(STAGING_DIR)/usr/include
80 $(CP) $(PKG_INSTALL_DIR)/usr/include/libxml2 $(STAGING_DIR)/usr/include/
81 mkdir -p $(STAGING_DIR)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.{a,so*} $(STAGING_DIR)/usr/lib/
83 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc $(STAGING_DIR)/usr/lib/pkgconfig/
85 $(SED) 's,-I$$$${includedir}/libxml2,,g' $(STAGING_DIR)/usr/bin/xml2-config
86 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/bin/xml2-config
87 $(SED) 's,-I$(STAGING_DIR)/usr/include,,g' $(STAGING_DIR)/usr/bin/xml2-config
88 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/bin/xml2-config
89 $(SED) 's,-L$(STAGING_DIR)/usr/lib,,g' $(STAGING_DIR)/usr/bin/xml2-config
90 $(SED) 's,-I$$$${includedir}/libxml2,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
91 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
92 $(SED) "s,"prefix\=/usr",prefix=$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
93 $(SED) "s,"exec_prefix\=/usr",exec_prefix=$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
94 endef
95
96 define Build/UninstallDev
97 rm -rf \
98 $(STAGING_DIR)/usr/bin/xml2-config \
99 $(STAGING_DIR)/usr/include/libxml2 \
100 $(STAGING_DIR)/usr/lib/libxml2.{a,so*} \
101 $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
102 endef
103
104 define Package/libxml2/install
105 $(INSTALL_DIR) $(1)/usr/lib
106 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* $(1)/usr/lib/
107 endef
108
109 $(eval $(call BuildPackage,libxml2))