• 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
131make runtests
132
133%clean
134rm -fr %{buildroot}
135
136%post -p /sbin/ldconfig
137
138%postun -p /sbin/ldconfig
139
140%files
141%defattr(-, root, root)
142
143%doc AUTHORS NEWS README Copyright TODO
144%doc %{_mandir}/man1/xmllint.1*
145%doc %{_mandir}/man1/xmlcatalog.1*
146%doc %{_mandir}/man3/libxml.3*
147
148%{_libdir}/lib*.so.*
149%{_bindir}/xmllint
150%{_bindir}/xmlcatalog
151
152%files devel
153%defattr(-, root, root)
154
155%doc %{_mandir}/man1/xml2-config.1*
156%doc AUTHORS NEWS README Copyright
157%doc doc/*.html doc/html doc/*.gif doc/*.png
158%doc doc/tutorial doc/libxml2-api.xml.gz
159%doc doc/examples
160%doc %dir %{_datadir}/gtk-doc/html/libxml2
161%doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp
162%doc %{_datadir}/gtk-doc/html/libxml2/*.html
163%doc %{_datadir}/gtk-doc/html/libxml2/*.png
164%doc %{_datadir}/gtk-doc/html/libxml2/*.css
165
166%{_libdir}/lib*.so
167%{_libdir}/*.sh
168%{_includedir}/*
169%{_bindir}/xml2-config
170%{_datadir}/aclocal/libxml.m4
171%{_libdir}/pkgconfig/libxml-2.0.pc
172%{_libdir}/cmake/libxml2/libxml2-config.cmake
173
174%files static
175%defattr(-, root, root)
176
177%{_libdir}/*a
178
179%files -n python-%{name}
180%defattr(-, root, root)
181
182%{_libdir}/python2*/site-packages/libxml2.py*
183%{_libdir}/python2*/site-packages/drv_libxml2.py*
184%{_libdir}/python2*/site-packages/libxml2mod*
185%doc python/TODO
186%doc python/libxml2class.txt
187%doc python/tests/*.py
188%doc doc/*.py
189%doc doc/python.html
190
191%if 0%{?with_python3}
192%files -n python3-%{name}
193%defattr(-, root, root)
194
195%{_libdir}/python3*/site-packages/libxml2.py*
196%{_libdir}/python3*/site-packages/drv_libxml2.py*
197%{_libdir}/python3*/site-packages/__pycache__/*py*
198%{_libdir}/python3*/site-packages/libxml2mod*
199%doc python/TODO
200%doc python/libxml2class.txt
201%doc py3doc/*.py
202%doc doc/python.html
203%endif # with_python3
204
205%changelog
206* @RELDATE@ Daniel Veillard <veillard@redhat.com>
207- upstream release @VERSION@ see http://xmlsoft.org/news.html
208
209