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