curl: backport fix for CVE-2019-15601
[librecmc/librecmc.git] / package / libs / libxml2 / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libxml2
11 PKG_VERSION:=2.9.9
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://xmlsoft.org/sources/
16 PKG_HASH:=94fb70890143e3c6549f265cee93ec064c80a84c42ad0f23e85ee1fd6540a871
17
18 PKG_LICENSE:=MIT
19 PKG_LICENSE_FILES:=COPYING
20 PKG_CPE_ID:=cpe:/a:xmlsoft:libxml2
21
22 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
23
24 PKG_FIXUP:=autoreconf
25 PKG_INSTALL:=1
26 PKG_BUILD_PARALLEL:=0
27
28 include $(INCLUDE_DIR)/host-build.mk
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/libxml2
32   SECTION:=libs
33   CATEGORY:=Libraries
34   TITLE:=Gnome XML library
35   URL:=http://xmlsoft.org/
36   DEPENDS:=+libpthread +zlib
37 endef
38
39 define Package/libxml2/description
40   A library for manipulating XML and HTML resources.
41 endef
42
43 define Package/libxml2-dev
44   SECTION:=devel
45   CATEGORY:=Development
46   SUBMENU:=Libraries
47   TITLE:=Development files for libxml2
48   URL:=http://xmlsoft.org/
49   DEPENDS:=+libxml2
50 endef
51
52 define Package/libxml2-dev/description
53   A library for manipulating XML and HTML resources.
54
55   This package contains the headers and xml2-config binary.
56 endef
57
58 define Package/libxml2-utils
59   SECTION:=utils
60   CATEGORY:=Utilities
61   TITLE:=XML command line utilities (xmllint...)
62   URL:=http://xmlsoft.org/
63   DEPENDS:=+libxml2
64 endef
65
66 define Package/libxml2-utils/description
67   This package contains the binaries xmllint and xmlcatalog
68   from libxml2, a library for manipulating XML and HTML resources.
69 endef
70
71 TARGET_CFLAGS += $(FPIC)
72
73 CONFIGURE_ARGS += \
74         --enable-shared \
75         --enable-static \
76         --with-c14n \
77         --without-catalog \
78         --with-debug \
79         --without-docbook \
80         --with-html \
81         --without-ftp \
82         --without-http \
83         --without-iconv \
84         --without-iso8859x \
85         --without-legacy \
86         --with-output \
87         --without-pattern \
88         --without-push \
89         --without-python \
90         --with-reader \
91         --without-readline \
92         --without-regexps \
93         --with-sax1 \
94         --with-schemas \
95         --with-threads \
96         --with-tree \
97         --with-valid \
98         --with-writer \
99         --with-xinclude \
100         --with-xpath \
101         --with-xptr \
102         --with-zlib=$(STAGING_DIR)/usr \
103         --without-lzma
104
105 HOST_CONFIGURE_ARGS += \
106         --enable-shared \
107         --enable-static \
108         --with-c14n \
109         --without-catalog \
110         --with-debug \
111         --without-docbook \
112         --with-html \
113         --without-ftp \
114         --without-http \
115         --without-iconv \
116         --without-iso8859x \
117         --without-legacy \
118         --with-output \
119         --without-pattern \
120         --without-push \
121         --without-python \
122         --with-reader \
123         --without-readline \
124         --without-regexps \
125         --with-sax1 \
126         --with-schemas \
127         --with-threads \
128         --with-tree \
129         --with-valid \
130         --with-writer \
131         --with-xinclude \
132         --with-xpath \
133         --with-xptr \
134         --with-zlib \
135         --without-lzma
136
137 define Build/InstallDev
138         $(INSTALL_DIR) $(2)/bin
139         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(2)/bin/
140         $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(2)/bin/xml2-config
141
142         $(INSTALL_DIR) $(1)/usr/include
143         $(CP) $(PKG_INSTALL_DIR)/usr/include/libxml2 $(1)/usr/include/
144
145         $(INSTALL_DIR) $(1)/usr/lib
146         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.{la,a,so*} $(1)/usr/lib/
147
148         $(INSTALL_DIR) $(1)/usr/lib/cmake/libxml2
149         $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libxml2/libxml2-config.cmake \
150                 $(1)/usr/lib/cmake/libxml2
151
152         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
153         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc $(1)/usr/lib/pkgconfig/
154
155         $(INSTALL_DIR) $(2)/share/aclocal/
156         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(2)/share/aclocal
157 endef
158
159 define Package/libxml2/install
160         $(INSTALL_DIR) $(1)/usr/lib
161         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* $(1)/usr/lib/
162 endef
163
164 define Package/libxml2-dev/install
165         $(INSTALL_DIR) $(1)/usr/bin
166         $(CP) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(1)/usr/bin/
167         $(SED) "s,$(STAGING_DIR),,g" $(1)/usr/bin/xml2-config
168
169         $(INSTALL_DIR) $(1)/usr/include/
170         $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
171
172         $(INSTALL_DIR) $(1)/usr/lib
173         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so $(1)/usr/lib/
174
175         $(INSTALL_DIR) $(1)/usr/lib/{cmake,pkgconfig}
176         $(CP) $(PKG_INSTALL_DIR)/usr/lib/{cmake,pkgconfig} $(1)/usr/lib/
177         $(SED) "s,$(STAGING_DIR),,g" $(1)/usr/lib/pkgconfig/*.pc
178
179         $(INSTALL_DIR) $(1)/usr/share/aclocal
180         $(CP) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal
181 endef
182
183 define Package/libxml2-utils/install
184         $(INSTALL_DIR) $(1)/usr/bin
185         $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmllint $(1)/usr/bin/
186         $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmlcatalog $(1)/usr/bin/
187 endef
188
189 define Host/Install
190         $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(HOST_BUILD_DIR)/xml2-config
191         $(call Host/Install/Default)
192 endef
193
194 $(eval $(call HostBuild))
195 $(eval $(call BuildPackage,libxml2))
196 $(eval $(call BuildPackage,libxml2-dev))
197 $(eval $(call BuildPackage,libxml2-utils))