]>
Commit | Line | Data |
---|---|---|
e8966c4b | 1 | # TODO: |
2 | # - fix build without libxml2-devel (python library uses old headers) | |
7b503906 JB |
3 | # |
4 | # Conditional build: | |
3ba0dd16 | 5 | %bcond_without apidocs # do not build and package API docs |
a627f64a JB |
6 | %bcond_without python2 # CPython 2.x module |
7 | %bcond_without python3 # CPython 3.x module | |
8 | %bcond_without static_libs # static library | |
9 | %bcond_without zlib # zlib support | |
10 | %bcond_with mem_debug # libxml2 memory debuging | |
11 | %bcond_without tests # "make check" call | |
3ba0dd16 | 12 | |
8bda37cb | 13 | Summary: libXML library version 2 |
c6cb7fae ER |
14 | Summary(es.UTF-8): Biblioteca libXML version 2 |
15 | Summary(pl.UTF-8): Biblioteka libXML wersja 2 | |
16 | Summary(pt_BR.UTF-8): Biblioteca libXML versão 2 | |
9146e4ca | 17 | Name: libxml2 |
f72857b8 | 18 | Version: 2.9.10 |
2247840c | 19 | Release: 2 |
32bd2aad | 20 | Epoch: 1 |
78f6a9a3 | 21 | License: MIT |
9146e4ca | 22 | Group: Libraries |
f555f133 | 23 | Source0: ftp://xmlsoft.org/libxml2/%{name}-%{version}.tar.gz |
f72857b8 | 24 | # Source0-md5: 10942a1dc23137a8aa07f0639cbfece5 |
74971558 JB |
25 | Patch0: %{name}-man_fixes.patch |
26 | Patch1: %{name}-open.gz.patch | |
27 | Patch2: %{name}-largefile.patch | |
2247840c JB |
28 | Patch3: %{name}-libx32.patch |
29 | # Fedora patches | |
30 | # https://bugzilla.gnome.org/show_bug.cgi?id=789714 | |
31 | Patch11: %{name}-python3-unicode-errors.patch | |
32 | # https://gitlab.gnome.org/GNOME/libxml2/commit/0815302dee2b78139832c2080348086a0564836b.patch | |
33 | Patch12: %{name}-fix-relaxed-approach-to-nested-documents.patch | |
34 | # https://gitlab.gnome.org/GNOME/libxml2/merge_requests/68 | |
35 | Patch13: libxml2-CVE-2019-20388.patch | |
36 | # https://gitlab.gnome.org/GNOME/libxml2/merge_requests/63 | |
37 | Patch14: libxml2-CVE-2020-7595.patch | |
38 | # https://gitlab.gnome.org/GNOME/libxml2/merge_requests/71 | |
39 | Patch15: libxml2-parenthesize-type-checks.patch | |
9146e4ca | 40 | URL: http://xmlsoft.org/ |
e21aa31e | 41 | BuildRequires: autoconf >= 2.68 |
30f31f4d | 42 | BuildRequires: automake >= 1.4 |
e21aa31e | 43 | BuildRequires: libtool >= 2:2.0 |
1317db76 | 44 | %if %{with python2} |
a627f64a JB |
45 | BuildRequires: python-devel >= 2.0 |
46 | BuildRequires: python-modules >= 2.0 | |
1317db76 AM |
47 | BuildRequires: rpm-pythonprov |
48 | %endif | |
49 | %if %{with python3} | |
a627f64a | 50 | BuildRequires: python3-devel >= 1:3.2 |
a627f64a | 51 | BuildRequires: python3-modules >= 1:3.2 |
1317db76 AM |
52 | BuildRequires: rpm-pythonprov |
53 | %endif | |
c95aad23 | 54 | BuildRequires: rpmbuild(macros) >= 1.714 |
7658de52 | 55 | BuildRequires: xz-devel |
b176c2d0 | 56 | %{?with_zlib:BuildRequires: zlib-devel >= 1.2.3.3} |
d00368fa JB |
57 | # history support in xmllint is disabled by default |
58 | #BuildRequires: ncurses-devel | |
59 | #BuildRequires: readline-devel >= 4.2 | |
b176c2d0 | 60 | Requires: zlib >= 1.2.3.3 |
e8966c4b | 61 | Obsoletes: xml-common |
9146e4ca AM |
62 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
63 | ||
9146e4ca AM |
64 | %description |
65 | This library allows you to manipulate XML files. | |
66 | ||
257f3917 JR |
67 | %description -l es.UTF-8 |
68 | Esta biblioteca permite manipulación de archivos XML. | |
326c44e7 | 69 | |
257f3917 JR |
70 | %description -l pl.UTF-8 |
71 | Biblioteka libxml2 umożliwia manipulowanie zawartością plików XML. | |
9146e4ca | 72 | |
257f3917 JR |
73 | %description -l pt_BR.UTF-8 |
74 | Esta biblioteca permite a manipulação de arquivos XML. | |
326c44e7 | 75 | |
9146e4ca AM |
76 | %package devel |
77 | Summary: Header files etc to develop libxml2 applications | |
c6cb7fae ER |
78 | Summary(es.UTF-8): Biblioteca y archivos de inclusión para desarrollo de aplicaciones libXML |
79 | Summary(pl.UTF-8): Pliki nagłówkowe i inne do libxml2 | |
80 | Summary(pt_BR.UTF-8): Bibliotecas e arquivos de inclusão para desenvolvimento de aplicações que usem a biblioteca libxml | |
9146e4ca | 81 | Group: Development/Libraries |
4f124b4c | 82 | Requires: %{name} = %{epoch}:%{version}-%{release} |
7f96f97f | 83 | Requires: xz-devel |
5ff229cc | 84 | Requires: zlib-devel |
9146e4ca AM |
85 | |
86 | %description devel | |
87 | Header files etc you can use to develop libxml2 applications. | |
88 | ||
257f3917 JR |
89 | %description devel -l es.UTF-8 |
90 | Biblioteca y archivos de inclusión para desarrollo de aplicaciones | |
326c44e7 | 91 | libXML. |
92 | ||
257f3917 JR |
93 | %description devel -l pl.UTF-8 |
94 | Pakiet ten zawiera pliki nagłówkowe i inne do libxml2 niezbędne przy | |
95 | tworzeniu aplikacji opartych o tę bibliotekę. | |
9146e4ca | 96 | |
257f3917 JR |
97 | %description devel -l pt_BR.UTF-8 |
98 | Bibliotecas e arquivos de inclusão para desenvolvimento de aplicações | |
326c44e7 | 99 | que usem a biblioteca libxml. |
100 | ||
9146e4ca AM |
101 | %package static |
102 | Summary: Static libxml2 libraries | |
c6cb7fae ER |
103 | Summary(es.UTF-8): Static libraries to develop libxml applications |
104 | Summary(pl.UTF-8): Biblioteka statyczna libxml2 | |
105 | Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento de aplicações que usem a biblioteca libxml | |
9146e4ca | 106 | Group: Development/Libraries |
4f124b4c | 107 | Requires: %{name}-devel = %{epoch}:%{version}-%{release} |
9146e4ca AM |
108 | |
109 | %description static | |
110 | Static libxml2 libraries. | |
111 | ||
257f3917 | 112 | %description static -l es.UTF-8 |
326c44e7 | 113 | Static libraries, you can use to develop libxml applications. |
114 | ||
257f3917 | 115 | %description static -l pl.UTF-8 |
9146e4ca AM |
116 | Biblioteka statyczna libxml2. |
117 | ||
257f3917 JR |
118 | %description static -l pt_BR.UTF-8 |
119 | Bibliotecas estáticas para desenvolvimento de aplicações que usem a | |
326c44e7 | 120 | biblioteca libxml. |
121 | ||
e5fe7879 MB |
122 | %package apidocs |
123 | Summary: libxml2 API documentation | |
124 | Summary(pl.UTF-8): Dokumentacja API libxml2 | |
125 | Group: Documentation | |
126 | Requires: gtk-doc-common | |
2247840c | 127 | %if "%{_rpmversion}" >= "4.6" |
72f37f9b ER |
128 | BuildArch: noarch |
129 | %endif | |
e5fe7879 MB |
130 | |
131 | %description apidocs | |
132 | libxml2 API documentation. | |
133 | ||
134 | %description apidocs -l pl.UTF-8 | |
135 | Dokumentacja API libxml2. | |
136 | ||
fef91692 | 137 | %package progs |
138 | Summary: XML files parser | |
c6cb7fae | 139 | Summary(pl.UTF-8): Analizator składniowy plików XML |
fef91692 | 140 | Group: Applications/Text |
4f124b4c | 141 | Requires: %{name} = %{epoch}:%{version}-%{release} |
fef91692 | 142 | |
143 | %description progs | |
144 | XML files parser. | |
145 | ||
257f3917 JR |
146 | %description progs -l pl.UTF-8 |
147 | Analizator składniowy plików XML. | |
fef91692 | 148 | |
78f6a9a3 | 149 | %package -n python-%{name} |
a627f64a JB |
150 | Summary: libxml2 module for Python 2.x |
151 | Summary(pl.UTF-8): Moduł libxml2 dla Pythona 2.x | |
db6d9c9b | 152 | Group: Libraries/Python |
4f124b4c | 153 | Requires: %{name} = %{epoch}:%{version}-%{release} |
1317db76 | 154 | Requires: python-libs |
560a3de6 | 155 | Obsoletes: libxml2-python |
78f6a9a3 | 156 | |
157 | %description -n python-%{name} | |
a627f64a JB |
158 | This is the libxml2 module for Python 2.x, providing access to the |
159 | libxml2 library. | |
78f6a9a3 | 160 | |
257f3917 | 161 | %description -n python-%{name} -l pl.UTF-8 |
72f37f9b ER |
162 | Ten pakiet zawiera moduł libxml2 dla Pythona 2.x, zapewniający dostęp |
163 | do biblioteki libxml2. | |
78f6a9a3 | 164 | |
1317db76 | 165 | %package -n python3-%{name} |
a627f64a JB |
166 | Summary: libxml2 module for Python 3.x |
167 | Summary(pl.UTF-8): Moduł libxml2 dla Pythona 3.x | |
1317db76 AM |
168 | Group: Libraries/Python |
169 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
170 | Requires: python3-libs | |
171 | ||
172 | %description -n python3-%{name} | |
a627f64a JB |
173 | This is the libxml2 module for Python 3.x, providing access to the |
174 | libxml2 library. | |
1317db76 AM |
175 | |
176 | %description -n python3-%{name} -l pl.UTF-8 | |
72f37f9b ER |
177 | Ten pakiet zawiera moduł libxml2 dla Pythona 3.x, zapewniający dostęp |
178 | do biblioteki libxml2. | |
1317db76 | 179 | |
9146e4ca AM |
180 | %prep |
181 | %setup -q | |
6f41977c | 182 | %patch0 -p1 |
0b339d08 | 183 | %if %{with zlib} |
74971558 | 184 | %patch1 -p1 |
0b339d08 | 185 | %endif |
74971558 | 186 | %patch2 -p1 |
2247840c JB |
187 | %patch3 -p1 |
188 | %patch11 -p1 | |
189 | %patch12 -p1 | |
190 | %patch13 -p1 | |
191 | %patch14 -p1 | |
192 | %patch15 -p1 | |
ccf06610 | 193 | |
9146e4ca | 194 | %build |
c3e0f8bb | 195 | %{__libtoolize} |
194fa592 | 196 | %{__aclocal} |
b65cf538 | 197 | %{__autoconf} |
7b503906 | 198 | %{__autoheader} |
b65cf538 | 199 | %{__automake} |
e0ab6350 | 200 | %configure \ |
74971558 JB |
201 | --disable-silent-rules \ |
202 | %{!?with_static_libs:--disable-static=no} \ | |
1317db76 | 203 | --without-python \ |
74971558 | 204 | %{!?with_zlib:--without-zlib} \ |
7658de52 | 205 | --with-lzma \ |
bb6f7bb6 | 206 | --with%{!?with_mem_debug:out}-mem-debug |
9c79f44a | 207 | |
9146e4ca AM |
208 | %{__make} |
209 | ||
1317db76 AM |
210 | %if %{with python2} |
211 | cd python | |
c95aad23 | 212 | %py_build |
1317db76 AM |
213 | cd .. |
214 | %endif | |
215 | ||
216 | ||
217 | %if %{with python3} | |
218 | cd python | |
c95aad23 | 219 | %py3_build |
1317db76 AM |
220 | cd .. |
221 | %endif | |
222 | ||
223 | %if %{with tests} | |
224 | %{__make} check | |
225 | %endif | |
226 | ||
9146e4ca AM |
227 | %install |
228 | rm -rf $RPM_BUILD_ROOT | |
229 | ||
5d7e8892 JB |
230 | %{__make} install \ |
231 | DESTDIR=$RPM_BUILD_ROOT \ | |
7658de52 | 232 | devhelpdir=%{_gtkdocdir}/libxml2 \ |
5d7e8892 JB |
233 | m4datadir=%{_aclocaldir} \ |
234 | pkgconfigdir=%{_pkgconfigdir} | |
9146e4ca | 235 | |
1317db76 AM |
236 | %if %{with python2} |
237 | cd python | |
c95aad23 | 238 | %py_install |
97e76e01 | 239 | |
1317db76 | 240 | %py_postclean |
64256ca4 | 241 | cd .. |
4b15d29d | 242 | %endif |
1317db76 AM |
243 | |
244 | %if %{with python3} | |
245 | cd python | |
c95aad23 | 246 | %py3_install |
1317db76 | 247 | cd .. |
97e76e01 | 248 | %endif |
4b15d29d | 249 | |
250 | # move html doc to -devel package | |
251 | install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-devel-%{version} | |
a627f64a | 252 | %{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html \ |
4b15d29d | 253 | $RPM_BUILD_ROOT%{_docdir}/%{name}-devel-%{version} |
a627f64a | 254 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} |
4b15d29d | 255 | |
9cad6a31 | 256 | # install catalog file |
257 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/xml | |
258 | LD_LIBRARY_PATH=.libs ./xmlcatalog --create \ | |
259 | > $RPM_BUILD_ROOT%{_sysconfdir}/xml/catalog | |
260 | ||
9146e4ca | 261 | %clean |
7939e1ec | 262 | rm -rf $RPM_BUILD_ROOT |
9146e4ca | 263 | |
e8d2b5b5 | 264 | %post -p /sbin/ldconfig |
265 | %postun -p /sbin/ldconfig | |
9146e4ca AM |
266 | |
267 | %files | |
268 | %defattr(644,root,root,755) | |
d73bc3df | 269 | %doc AUTHORS ChangeLog Copyright NEWS README TODO |
ccba1061 JB |
270 | %attr(755,root,root) %{_libdir}/libxml2.so.*.*.* |
271 | %attr(755,root,root) %ghost %{_libdir}/libxml2.so.2 | |
272 | %{_mandir}/man3/libxml.3* | |
9146e4ca | 273 | |
9cad6a31 | 274 | %dir %{_sysconfdir}/xml |
5a57b590 | 275 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xml/catalog |
9cad6a31 | 276 | |
9146e4ca AM |
277 | %files devel |
278 | %defattr(644,root,root,755) | |
4b15d29d | 279 | %doc %{_docdir}/%{name}-devel-%{version} |
f0e239fb | 280 | %attr(755,root,root) %{_bindir}/xml2-config |
ccba1061 JB |
281 | %attr(755,root,root) %{_libdir}/libxml2.so |
282 | %{_libdir}/libxml2.la | |
74971558 | 283 | %attr(755,root,root) %{_libdir}/xml2Conf.sh |
1317db76 | 284 | %{_libdir}/cmake/libxml2 |
ccba1061 JB |
285 | %{_pkgconfigdir}/libxml-2.0.pc |
286 | %{_aclocaldir}/libxml.m4 | |
326f70c8 | 287 | %{_includedir}/libxml2 |
fef91692 | 288 | %{_mandir}/man1/xml2-config.1* |
9146e4ca | 289 | |
e0ab6350 | 290 | %if %{with static_libs} |
9146e4ca AM |
291 | %files static |
292 | %defattr(644,root,root,755) | |
ccba1061 | 293 | %{_libdir}/libxml2.a |
e0ab6350 | 294 | %endif |
fef91692 | 295 | |
3ba0dd16 | 296 | %if %{with apidocs} |
e5fe7879 MB |
297 | %files apidocs |
298 | %defattr(644,root,root,755) | |
299 | %{_gtkdocdir}/libxml2 | |
3ba0dd16 | 300 | %endif |
e5fe7879 | 301 | |
fef91692 | 302 | %files progs |
303 | %defattr(644,root,root,755) | |
6f41977c | 304 | %attr(755,root,root) %{_bindir}/xmlcatalog |
fef91692 | 305 | %attr(755,root,root) %{_bindir}/xmllint |
6f41977c | 306 | %{_mandir}/man1/xmlcatalog.1* |
fef91692 | 307 | %{_mandir}/man1/xmllint.1* |
78f6a9a3 | 308 | |
1317db76 | 309 | %if %{with python2} |
78f6a9a3 | 310 | %files -n python-%{name} |
311 | %defattr(644,root,root,755) | |
ccba1061 | 312 | %attr(755,root,root) %{py_sitedir}/libxml2mod.so |
30f31f4d JB |
313 | %{py_sitedir}/drv_libxml2.py[co] |
314 | %{py_sitedir}/libxml2.py[co] | |
97e76e01 | 315 | %if "%{py_ver}" > "2.4" |
2247840c | 316 | %{py_sitedir}/libxml2_python-%{version}-py*.egg-info |
97e76e01 | 317 | %endif |
1317db76 AM |
318 | %endif |
319 | ||
320 | %if %{with python3} | |
321 | %files -n python3-%{name} | |
322 | %defattr(644,root,root,755) | |
323 | %{py3_sitedir}/__pycache__/*.py[co] | |
324 | %{py3_sitedir}/drv_libxml2.py | |
325 | %{py3_sitedir}/libxml2.py | |
326 | %{py3_sitedir}/libxml2_python-%{version}-py*.egg-info | |
327 | %attr(755,root,root) %{py3_sitedir}/libxml2mod.cpython-*.so | |
696b50a8 | 328 | %endif |