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