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