• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%global with_python3 1
2
3Summary: Library providing XML and HTML support
4Name: libxml2
5Version: @VERSION@
6Release: 1%{?dist}%{?extra_release}
7License: MIT
8Group: Development/Libraries
9Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
10BuildRoot: %{_tmppath}/%{name}-%{version}-root
11BuildRequires: python-devel
12%if 0%{?with_python3}
13BuildRequires: python3-devel
14%endif # with_python3
15BuildRequires: zlib-devel
16BuildRequires: pkgconfig
17BuildRequires: xz-devel
18URL: http://xmlsoft.org/
19
20%description
21This library allows to manipulate XML files. It includes support
22to read, modify and write XML and HTML files. There is DTDs support
23this includes parsing and validation even with complex DtDs, either
24at parse time or later once the document has been modified. The output
25can be a simple SAX stream or and in-memory DOM like representations.
26In this case one can use the built-in XPath and XPointer implementation
27to select sub nodes or ranges. A flexible Input/Output mechanism is
28available, with existing HTTP and FTP modules and combined to an
29URI library.
30
31%package devel
32Summary: Libraries, includes, etc. to develop XML and HTML applications
33Group: Development/Libraries
34Requires: libxml2 = %{version}-%{release}
35Requires: zlib-devel
36Requires: xz-devel
37Requires: pkgconfig
38
39%description devel
40Libraries, include files, etc you can use to develop XML applications.
41This library allows to manipulate XML files. It includes support
42to read, modify and write XML and HTML files. There is DTDs support
43this includes parsing and validation even with complex DtDs, either
44at parse time or later once the document has been modified. The output
45can be a simple SAX stream or and in-memory DOM like representations.
46In this case one can use the built-in XPath and XPointer implementation
47to select sub nodes or ranges. A flexible Input/Output mechanism is
48available, with existing HTTP and FTP modules and combined to an
49URI library.
50
51%package static
52Summary: Static library for libxml2
53Group: Development/Libraries
54Requires: libxml2 = %{version}-%{release}
55
56%description static
57Static library for libxml2 provided for specific uses or shaving a few
58microseconds when parsing, do not link to them for generic purpose packages.
59
60%package -n python-%{name}
61%{?python_provide:%python_provide python-%{name}}
62Summary: Python bindings for the libxml2 library
63Group: Development/Libraries
64Requires: libxml2 = %{version}-%{release}
65Obsoletes: %{name}-python < %{version}-%{release}
66Provides: %{name}-python = %{version}-%{release}
67
68%description -n python-%{name}
69The libxml2-python package contains a Python 2 module that permits applications
70written in the Python programming language, version 2, to use the interface
71supplied by the libxml2 library to manipulate XML files.
72
73This library allows to manipulate XML files. It includes support
74to read, modify and write XML and HTML files. There is DTDs support
75this includes parsing and validation even with complex DTDs, either
76at parse time or later once the document has been modified.
77
78%if 0%{?with_python3}
79%package -n python3-%{name}
80Summary: Python 3 bindings for the libxml2 library
81Group: Development/Libraries
82Requires: libxml2 = %{version}-%{release}
83Obsoletes: %{name}-python3 < %{version}-%{release}
84Provides: %{name}-python3 = %{version}-%{release}
85
86%description -n python3-%{name}
87The libxml2-python3 package contains a Python 3 module that permits
88applications written in the Python programming language, version 3, to use the
89interface supplied by the libxml2 library to manipulate XML files.
90
91This library allows to manipulate XML files. It includes support
92to read, modify and write XML and HTML files. There is DTDs support
93this includes parsing and validation even with complex DTDs, either
94at parse time or later once the document has been modified.
95%endif # with_python3
96
97%prep
98%setup -q
99
100mkdir py3doc
101cp doc/*.py py3doc
102sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py
103
104%build
105%configure
106make %{_smp_mflags}
107
108find doc -type f -exec chmod 0644 \{\} \;
109
110%install
111rm -fr %{buildroot}
112
113make install DESTDIR=%{buildroot}
114
115%if 0%{?with_python3}
116make clean
117%configure --with-python=%{__python3}
118make install DESTDIR=%{buildroot}
119%endif # with_python3
120
121
122rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
123rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
124rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
125rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
126rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
127(cd doc/examples ; make clean ; rm -rf .deps Makefile)
128gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
129
130%check
131#disabling python tests from rpm build as broken in Fedora 30
132make PYTHON_SUBDIR="" runtests
133
134%clean
135rm -fr %{buildroot}
136
137%post -p /sbin/ldconfig
138
139%postun -p /sbin/ldconfig
140
141%files
142%defattr(-, root, root)
143
144%doc AUTHORS NEWS README Copyright TODO
145%doc %{_mandir}/man1/xmllint.1*
146%doc %{_mandir}/man1/xmlcatalog.1*
147%doc %{_mandir}/man3/libxml.3*
148
149%{_libdir}/lib*.so.*
150%{_bindir}/xmllint
151%{_bindir}/xmlcatalog
152
153%files devel
154%defattr(-, root, root)
155
156%doc %{_mandir}/man1/xml2-config.1*
157%doc AUTHORS NEWS README Copyright
158%doc doc/*.html doc/html doc/*.gif doc/*.png
159%doc doc/tutorial doc/libxml2-api.xml.gz
160%doc doc/examples
161%doc %dir %{_datadir}/gtk-doc/html/libxml2
162%doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp
163%doc %{_datadir}/gtk-doc/html/libxml2/*.html
164%doc %{_datadir}/gtk-doc/html/libxml2/*.png
165%doc %{_datadir}/gtk-doc/html/libxml2/*.css
166
167%{_libdir}/lib*.so
168%{_libdir}/*.sh
169%{_includedir}/*
170%{_bindir}/xml2-config
171%{_datadir}/aclocal/libxml.m4
172%{_libdir}/pkgconfig/libxml-2.0.pc
173%{_libdir}/cmake/libxml2/libxml2-config.cmake
174
175%files static
176%defattr(-, root, root)
177
178%{_libdir}/*a
179
180%files -n python-%{name}
181%defattr(-, root, root)
182
183%{_libdir}/python2*/site-packages/libxml2.py*
184%{_libdir}/python2*/site-packages/drv_libxml2.py*
185%{_libdir}/python2*/site-packages/libxml2mod*
186%doc python/TODO
187%doc python/libxml2class.txt
188%doc python/tests/*.py
189%doc doc/*.py
190%doc doc/python.html
191
192%if 0%{?with_python3}
193%files -n python3-%{name}
194%defattr(-, root, root)
195
196%{_libdir}/python3*/site-packages/libxml2.py*
197%{_libdir}/python3*/site-packages/drv_libxml2.py*
198%{_libdir}/python3*/site-packages/__pycache__/*py*
199%{_libdir}/python3*/site-packages/libxml2mod*
200%doc python/TODO
201%doc python/libxml2class.txt
202%doc py3doc/*.py
203%doc doc/python.html
204%endif # with_python3
205
206%changelog
207* @RELDATE@ Daniel Veillard <veillard@redhat.com>
208- upstream release @VERSION@ see http://xmlsoft.org/news.html
209
210