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