]> git.pld-linux.org Git - packages/libxml2.git/blob - libxml2.spec
1b629427fe16be4afdb9aedf43ff490d2f53d838
[packages/libxml2.git] / libxml2.spec
1 # TODO:
2 # - fix build without libxml2-devel (python library uses old headers)
3 #
4 # Conditional build:
5 %bcond_without  apidocs         # do not build and package API docs
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
12
13 Summary:        libXML library version 2
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
17 Name:           libxml2
18 Version:        2.9.2
19 Release:        5
20 Epoch:          1
21 License:        MIT
22 Group:          Libraries
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
25 # Source0-md5:  9e6a9aca9d155737868b3dc5fd82f788
26 Patch0:         %{name}-man_fixes.patch
27 Patch1:         %{name}-open.gz.patch
28 Patch2:         %{name}-largefile.patch
29 Patch3:         %{name}-xmlcatalog-regression.patch
30 URL:            http://xmlsoft.org/
31 BuildRequires:  autoconf >= 2.68
32 BuildRequires:  automake >= 1.4
33 BuildRequires:  libtool >= 2:2.0
34 %if %{with python2}
35 BuildRequires:  python-devel >= 2.0
36 BuildRequires:  python-modules >= 2.0
37 BuildRequires:  rpm-pythonprov
38 %endif
39 %if %{with python3}
40 BuildRequires:  python3-devel >= 1:3.2
41 BuildRequires:  python3-modules >= 1:3.2
42 BuildRequires:  rpm-pythonprov
43 %endif
44 BuildRequires:  rpmbuild(macros) >= 1.219
45 BuildRequires:  xz-devel
46 %{?with_zlib:BuildRequires:     zlib-devel >= 1.2.3.3}
47 # history support in xmllint is disabled by default
48 #BuildRequires: ncurses-devel
49 #BuildRequires: readline-devel >= 4.2
50 Requires:       zlib >= 1.2.3.3
51 Obsoletes:      xml-common
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %description
55 This library allows you to manipulate XML files.
56
57 %description -l es.UTF-8
58 Esta biblioteca permite manipulación de archivos XML.
59
60 %description -l pl.UTF-8
61 Biblioteka libxml2 umożliwia manipulowanie zawartością plików XML.
62
63 %description -l pt_BR.UTF-8
64 Esta biblioteca permite a manipulação de arquivos XML.
65
66 %package devel
67 Summary:        Header files etc to develop libxml2 applications
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
71 Group:          Development/Libraries
72 Requires:       %{name} = %{epoch}:%{version}-%{release}
73 Requires:       xz-devel
74 Requires:       zlib-devel
75
76 %description devel
77 Header files etc you can use to develop libxml2 applications.
78
79 %description devel -l es.UTF-8
80 Biblioteca y archivos de inclusión para desarrollo de aplicaciones
81 libXML.
82
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ę.
86
87 %description devel -l pt_BR.UTF-8
88 Bibliotecas e arquivos de inclusão para desenvolvimento de aplicações
89 que usem a biblioteca libxml.
90
91 %package static
92 Summary:        Static libxml2 libraries
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
96 Group:          Development/Libraries
97 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
98
99 %description static
100 Static libxml2 libraries.
101
102 %description static -l es.UTF-8
103 Static libraries, you can use to develop libxml applications.
104
105 %description static -l pl.UTF-8
106 Biblioteka statyczna libxml2.
107
108 %description static -l pt_BR.UTF-8
109 Bibliotecas estáticas para desenvolvimento de aplicações que usem a
110 biblioteca libxml.
111
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
124 %package progs
125 Summary:        XML files parser
126 Summary(pl.UTF-8):      Analizator składniowy plików XML
127 Group:          Applications/Text
128 Requires:       %{name} = %{epoch}:%{version}-%{release}
129
130 %description progs
131 XML files parser.
132
133 %description progs -l pl.UTF-8
134 Analizator składniowy plików XML.
135
136 %package -n python-%{name}
137 Summary:        libxml2 module for Python 2.x
138 Summary(pl.UTF-8):      Moduł libxml2 dla Pythona 2.x
139 Group:          Libraries/Python
140 Requires:       %{name} = %{epoch}:%{version}-%{release}
141 Requires:       python-libs
142 Obsoletes:      libxml2-python
143
144 %description -n python-%{name}
145 This is the libxml2 module for Python 2.x, providing access to the
146 libxml2 library.
147
148 %description -n python-%{name} -l pl.UTF-8
149 Ten pakiet zawiera moduł libxml2 dla Pythona 2.x, zapewniający
150 dostęp do biblioteki libxml2.
151
152 %package -n python3-%{name}
153 Summary:        libxml2 module for Python 3.x
154 Summary(pl.UTF-8):      Moduł libxml2 dla Pythona 3.x
155 Group:          Libraries/Python
156 Requires:       %{name} = %{epoch}:%{version}-%{release}
157 Requires:       python3-libs
158
159 %description -n python3-%{name}
160 This is the libxml2 module for Python 3.x, providing access to the
161 libxml2 library.
162
163 %description -n python3-%{name} -l pl.UTF-8
164 Ten pakiet zawiera moduł libxml2 dla Pythona 3.x, zapewniający
165 dostęp do biblioteki libxml2.
166
167 %prep
168 %setup -q
169 %patch0 -p1
170 %if %{with zlib}
171 %patch1 -p1
172 %endif
173 %patch2 -p1
174 %patch3 -p1
175
176 %build
177 %{__libtoolize}
178 %{__aclocal}
179 %{__autoconf}
180 %{__autoheader}
181 %{__automake}
182 %configure \
183         --disable-silent-rules \
184         %{!?with_static_libs:--disable-static=no} \
185         --without-python \
186         %{!?with_zlib:--without-zlib} \
187         --with-lzma \
188         --with%{!?with_mem_debug:out}-mem-debug
189
190 %{__make}
191
192 %if %{with python2}
193 cd python
194 CC="%{__cc}" \
195 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
196 %{__python} setup.py build --build-base build-2
197 cd ..
198 %endif
199
200
201 %if %{with python3}
202 cd python
203 CC="%{__cc}" \
204 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
205 %{__python3} setup.py build --build-base build-3
206 cd ..
207 %endif
208
209 %if %{with tests}
210 %{__make} check
211 %endif
212
213 %install
214 rm -rf $RPM_BUILD_ROOT
215
216 %{__make} install \
217         DESTDIR=$RPM_BUILD_ROOT \
218         devhelpdir=%{_gtkdocdir}/libxml2 \
219         m4datadir=%{_aclocaldir} \
220         pkgconfigdir=%{_pkgconfigdir}
221
222 %if %{with python2}
223 cd python
224 %{__python} setup.py \
225         build --build-base build-2 \
226         install --skip-build \
227         --optimize=2 \
228         --root=$RPM_BUILD_ROOT
229
230 %py_postclean
231 cd ..
232 %endif
233
234 %if %{with python3}
235 cd python
236 %{__python3} setup.py \
237         build --build-base build-3 \
238         install --skip-build \
239         --optimize=2 \
240         --root=$RPM_BUILD_ROOT
241 cd ..
242 %endif
243
244 # move html doc to -devel package
245 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-devel-%{version}
246 %{__mv} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/html \
247         $RPM_BUILD_ROOT%{_docdir}/%{name}-devel-%{version}
248 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
249
250 # install catalog file
251 install -d $RPM_BUILD_ROOT%{_sysconfdir}/xml
252 LD_LIBRARY_PATH=.libs ./xmlcatalog --create \
253         > $RPM_BUILD_ROOT%{_sysconfdir}/xml/catalog
254
255 %clean
256 rm -rf $RPM_BUILD_ROOT
257
258 %post   -p /sbin/ldconfig
259 %postun -p /sbin/ldconfig
260
261 %files
262 %defattr(644,root,root,755)
263 %doc AUTHORS ChangeLog Copyright NEWS README TODO
264 %attr(755,root,root) %{_libdir}/libxml2.so.*.*.*
265 %attr(755,root,root) %ghost %{_libdir}/libxml2.so.2
266 %{_mandir}/man3/libxml.3*
267
268 %dir %{_sysconfdir}/xml
269 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xml/catalog
270
271 %files devel
272 %defattr(644,root,root,755)
273 %doc %{_docdir}/%{name}-devel-%{version}
274 %attr(755,root,root) %{_bindir}/xml2-config
275 %attr(755,root,root) %{_libdir}/libxml2.so
276 %{_libdir}/libxml2.la
277 %attr(755,root,root) %{_libdir}/xml2Conf.sh
278 %{_libdir}/cmake/libxml2
279 %{_pkgconfigdir}/libxml-2.0.pc
280 %{_aclocaldir}/libxml.m4
281 %{_includedir}/libxml2
282 %{_mandir}/man1/xml2-config.1*
283
284 %if %{with static_libs}
285 %files static
286 %defattr(644,root,root,755)
287 %{_libdir}/libxml2.a
288 %endif
289
290 %if %{with apidocs}
291 %files apidocs
292 %defattr(644,root,root,755)
293 %{_gtkdocdir}/libxml2
294 %endif
295
296 %files progs
297 %defattr(644,root,root,755)
298 %attr(755,root,root) %{_bindir}/xmlcatalog
299 %attr(755,root,root) %{_bindir}/xmllint
300 %{_mandir}/man1/xmlcatalog.1*
301 %{_mandir}/man1/xmllint.1*
302
303 %if %{with python2}
304 %files -n python-%{name}
305 %defattr(644,root,root,755)
306 %attr(755,root,root) %{py_sitedir}/libxml2mod.so
307 %{py_sitedir}/drv_libxml2.py[co]
308 %{py_sitedir}/libxml2.py[co]
309 %if "%{py_ver}" > "2.4"
310 %{py_sitedir}/libxml2_python-*.egg-info
311 %endif
312 %endif
313
314 %if %{with python3}
315 %files -n python3-%{name}
316 %defattr(644,root,root,755)
317 %{py3_sitedir}/__pycache__/*.py[co]
318 %{py3_sitedir}/drv_libxml2.py
319 %{py3_sitedir}/libxml2.py
320 %{py3_sitedir}/libxml2_python-%{version}-py*.egg-info
321 %attr(755,root,root) %{py3_sitedir}/libxml2mod.cpython-*.so
322 %endif
This page took 0.043318 seconds and 2 git commands to generate.