add libtool fixes, tweak sed-ifications for pkgconfig file and build-time config...
[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
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 $(SED) 's,^includedir=.*,includedir=$(STAGING_DIR)/usr/include,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
95 $(SED) 's,^libdir=.*,libdir=$(STAGING_DIR)/usr/lib,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
96 endef
97
98 define Build/UninstallDev
99 rm -rf $(STAGING_DIR)/usr/bin/xml2-config \
100 $(STAGING_DIR)/usr/include/libxml2 \
101 $(STAGING_DIR)/usr/lib/libxml2.{a,so*} \
102 $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
103 endef
104
105
106 define Package/libxml2/install
107 $(INSTALL_DIR) $(1)/usr/lib
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* $(1)/usr/lib/
109 endef
110
111
112 $(eval $(call BuildPackage,libxml2))
113