added our own pkg-config wrapper, making the sed foo on *.pc files obselete 2/2
[packages.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
27 define Package/libxml2
28   SECTION:=libs
29   CATEGORY:=Libraries
30   DEPENDS:=+libpthread +zlib
31   TITLE:=Gnome XML library
32   URL:=http://xmlsoft.org/
33 endef
34
35 define Package/libxml2/description
36  A library for manipulating XML and HTML resources.
37 endef
38
39
40 CONFIGURE_ARGS += \
41         --enable-shared \
42         --enable-static \
43         --without-c14n \
44         --without-catalog \
45         --without-debug \
46         --without-docbook \
47         --with-html \
48         --without-ftp \
49         --without-http \
50         --without-iconv \
51         --without-iso8859x \
52         --without-legacy \
53         --with-output \
54         --without-pattern \
55         --without-push \
56         --without-python \
57         --with-reader \
58         --without-readline \
59         --without-regexps \
60         --with-sax1 \
61         --with-schemas \
62         --with-threads \
63         --with-tree \
64         --with-valid \
65         --with-writer \
66         --with-xinclude \
67         --with-xpath \
68         --with-xptr \
69         --with-zlib \
70
71
72 define Build/Configure
73         $(call Build/Configure/Default)
74         $(call libtool_disable_rpath)
75 endef
76
77 define Build/Compile
78         $(MAKE) -C $(PKG_BUILD_DIR) all
79         $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
80         $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
81 endef
82
83 define Build/InstallDev
84         mkdir -p $(STAGING_DIR)/usr/bin
85         $(CP) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(STAGING_DIR)/usr/bin/
86         mkdir -p $(STAGING_DIR)/usr/include
87         $(CP) $(PKG_INSTALL_DIR)/usr/include/libxml2 $(STAGING_DIR)/usr/include/
88         mkdir -p $(STAGING_DIR)/usr/lib
89         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.{a,so*} $(STAGING_DIR)/usr/lib/
90         mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
91         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc $(STAGING_DIR)/usr/lib/pkgconfig/
92         $(SED) 's,-I$$$${includedir}/libxml2,-I$(STAGING_DIR)/usr/include/libxml2,g' $(STAGING_DIR)/usr/bin/xml2-config
93         $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/bin/xml2-config
94 endef
95
96 define Build/UninstallDev
97         rm -rf  $(STAGING_DIR)/usr/bin/xml2-config \
98                 $(STAGING_DIR)/usr/include/libxml2 \
99                 $(STAGING_DIR)/usr/lib/libxml2.{a,so*} \
100                 $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
101 endef
102
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
110 $(eval $(call BuildPackage,libxml2))
111