blob: 73c6fd9e5a1931571c341d11ffc205ed69633aea [file] [log] [blame]
Tomas Radejfb8e9e22015-02-18 22:47:13 +08001%global with_python3 1
2
Daniel Veillard1a123612001-09-19 08:06:23 +00003Summary: Library providing XML and HTML support
4Name: libxml2
Daniel Veillardea898282001-11-04 22:13:45 +00005Version: @VERSION@
Daniel Veillardbdec2182016-05-23 16:04:52 +08006Release: 1%{?dist}%{?extra_release}
Daniel Veillardc575b992002-02-08 13:28:40 +00007License: MIT
Daniel Veillard1a123612001-09-19 08:06:23 +00008Group: Development/Libraries
Elliott Hughesecdab2a2022-02-23 14:33:50 -08009Source: https://download.gnome.org/sources/libxml2/@LIBXML_MAJOR_VERSION@.@LIBXML_MINOR_VERSION@/libxml2-%{version}.tar.xz
Daniel Veillard87b4d6f2012-10-11 14:44:22 +080010BuildRoot: %{_tmppath}/%{name}-%{version}-root
Tomas Radejfb8e9e22015-02-18 22:47:13 +080011BuildRequires: python-devel
12%if 0%{?with_python3}
13BuildRequires: python3-devel
14%endif # with_python3
15BuildRequires: zlib-devel
16BuildRequires: pkgconfig
17BuildRequires: xz-devel
Elliott Hughesecdab2a2022-02-23 14:33:50 -080018URL: https://gitlab.gnome.org/GNOME/libxml2
Michael Fulbright62e8e801998-09-25 16:58:38 +000019
20%description
Daniel Veillard87b4d6f2012-10-11 14:44:22 +080021This library allows to manipulate XML files. It includes support
Daniel Veillard6db58192000-10-30 09:27:53 +000022to 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
Daniel Veillard87b4d6f2012-10-11 14:44:22 +080027to select sub nodes or ranges. A flexible Input/Output mechanism is
Daniel Veillard6db58192000-10-30 09:27:53 +000028available, with existing HTTP and FTP modules and combined to an
29URI library.
Michael Fulbright62e8e801998-09-25 16:58:38 +000030
31%package devel
Daniel Veillard1a123612001-09-19 08:06:23 +000032Summary: Libraries, includes, etc. to develop XML and HTML applications
33Group: Development/Libraries
Daniel Veillardda629342007-08-01 07:49:06 +000034Requires: libxml2 = %{version}-%{release}
Daniel Veillardc6924812002-05-24 11:10:43 +000035Requires: zlib-devel
Daniel Veillardadf5ec92012-01-26 16:56:22 +080036Requires: xz-devel
Daniel Veillard69839ba2006-06-06 13:27:03 +000037Requires: pkgconfig
Michael Fulbright62e8e801998-09-25 16:58:38 +000038
39%description devel
Daniel Veillard6db58192000-10-30 09:27:53 +000040Libraries, include files, etc you can use to develop XML applications.
Daniel Veillard87b4d6f2012-10-11 14:44:22 +080041This library allows to manipulate XML files. It includes support
Daniel Veillard6db58192000-10-30 09:27:53 +000042to 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
Daniel Veillard87b4d6f2012-10-11 14:44:22 +080047to select sub nodes or ranges. A flexible Input/Output mechanism is
Daniel Veillard6db58192000-10-30 09:27:53 +000048available, with existing HTTP and FTP modules and combined to an
49URI library.
Michael Fulbright62e8e801998-09-25 16:58:38 +000050
Daniel Veillard87b4d6f2012-10-11 14:44:22 +080051%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
Daniel Veillarde29e50e2017-08-29 12:40:54 +020060%package -n python-%{name}
61%{?python_provide:%python_provide python-%{name}}
Daniel Veillard253aa2c2002-02-02 09:17:16 +000062Summary: Python bindings for the libxml2 library
63Group: Development/Libraries
Daniel Veillardda629342007-08-01 07:49:06 +000064Requires: libxml2 = %{version}-%{release}
Daniel Veillarde29e50e2017-08-29 12:40:54 +020065Obsoletes: %{name}-python < %{version}-%{release}
66Provides: %{name}-python = %{version}-%{release}
Daniel Veillard253aa2c2002-02-02 09:17:16 +000067
Daniel Veillarde29e50e2017-08-29 12:40:54 +020068%description -n python-%{name}
Tomas Radejfb8e9e22015-02-18 22:47:13 +080069The libxml2-python package contains a Python 2 module that permits applications
70written in the Python programming language, version 2, to use the interface
Daniel Veillard253aa2c2002-02-02 09:17:16 +000071supplied by the libxml2 library to manipulate XML files.
72
Daniel Veillard87b4d6f2012-10-11 14:44:22 +080073This library allows to manipulate XML files. It includes support
Daniel Veillard253aa2c2002-02-02 09:17:16 +000074to 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.
Daniel Veillard366a9152002-10-23 20:43:53 +000077
Tomas Radejfb8e9e22015-02-18 22:47:13 +080078%if 0%{?with_python3}
Daniel Veillarde29e50e2017-08-29 12:40:54 +020079%package -n python3-%{name}
Tomas Radejfb8e9e22015-02-18 22:47:13 +080080Summary: Python 3 bindings for the libxml2 library
81Group: Development/Libraries
82Requires: libxml2 = %{version}-%{release}
Daniel Veillarde29e50e2017-08-29 12:40:54 +020083Obsoletes: %{name}-python3 < %{version}-%{release}
84Provides: %{name}-python3 = %{version}-%{release}
Tomas Radejfb8e9e22015-02-18 22:47:13 +080085
Daniel Veillarde29e50e2017-08-29 12:40:54 +020086%description -n python3-%{name}
Tomas Radejfb8e9e22015-02-18 22:47:13 +080087The 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
Daniel Veillardea898282001-11-04 22:13:45 +000097%prep
98%setup -q
99
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200100mkdir py3doc
101cp doc/*.py py3doc
102sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py
103
Daniel Veillardea898282001-11-04 22:13:45 +0000104%build
Daniel Veillardbaad7882005-08-25 22:52:51 +0000105%configure
Daniel Veillard29341682009-09-10 18:23:39 +0200106make %{_smp_mflags}
Daniel Veillardea898282001-11-04 22:13:45 +0000107
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200108find doc -type f -exec chmod 0644 \{\} \;
109
Daniel Veillardea898282001-11-04 22:13:45 +0000110%install
Daniel Veillard366a9152002-10-23 20:43:53 +0000111rm -fr %{buildroot}
Daniel Veillardea898282001-11-04 22:13:45 +0000112
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800113make install DESTDIR=%{buildroot}
114
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800115%if 0%{?with_python3}
116make clean
117%configure --with-python=%{__python3}
118make install DESTDIR=%{buildroot}
119%endif # with_python3
120
121
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800122rm -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}/*
Daniel Veillard29341682009-09-10 18:23:39 +0200127(cd doc/examples ; make clean ; rm -rf .deps Makefile)
Mark Salter60adeea2013-02-11 12:45:56 +0800128gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
129
130%check
Haibo Huangcfd91dc2020-07-30 23:01:33 -0700131#disabling python tests from rpm build as broken in Fedora 30
132make PYTHON_SUBDIR="" runtests
Daniel Veillardea898282001-11-04 22:13:45 +0000133
134%clean
Daniel Veillard366a9152002-10-23 20:43:53 +0000135rm -fr %{buildroot}
Daniel Veillardea898282001-11-04 22:13:45 +0000136
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800137%post -p /sbin/ldconfig
Daniel Veillardea898282001-11-04 22:13:45 +0000138
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800139%postun -p /sbin/ldconfig
Daniel Veillardea898282001-11-04 22:13:45 +0000140
141%files
142%defattr(-, root, root)
143
Elliott Hughesecdab2a2022-02-23 14:33:50 -0800144%doc NEWS README.md Copyright TODO
Daniel Veillardea898282001-11-04 22:13:45 +0000145%doc %{_mandir}/man1/xmllint.1*
146%doc %{_mandir}/man1/xmlcatalog.1*
Daniel Veillarde915b2d2002-03-06 18:42:40 +0000147%doc %{_mandir}/man3/libxml.3*
Daniel Veillardea898282001-11-04 22:13:45 +0000148
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000149%{_libdir}/lib*.so.*
Daniel Veillard29341682009-09-10 18:23:39 +0200150%{_bindir}/xmllint
151%{_bindir}/xmlcatalog
Daniel Veillardea898282001-11-04 22:13:45 +0000152
153%files devel
154%defattr(-, root, root)
155
156%doc %{_mandir}/man1/xml2-config.1*
Elliott Hughesecdab2a2022-02-23 14:33:50 -0800157%doc NEWS README.md Copyright
Daniel Veillardf5a457a2002-03-07 10:25:29 +0000158%doc doc/*.html doc/html doc/*.gif doc/*.png
Daniel Veillard771971f2005-04-02 10:49:51 +0000159%doc doc/tutorial doc/libxml2-api.xml.gz
Daniel Veillard8d7b5c72003-11-15 18:24:36 +0000160%doc doc/examples
Daniel Veillard29341682009-09-10 18:23:39 +0200161%doc %dir %{_datadir}/gtk-doc/html/libxml2
Daniel Veillard1db4a662005-09-12 13:10:09 +0000162%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
Daniel Veillardea898282001-11-04 22:13:45 +0000166
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000167%{_libdir}/lib*.so
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000168%{_libdir}/*.sh
Daniel Veillard29341682009-09-10 18:23:39 +0200169%{_includedir}/*
170%{_bindir}/xml2-config
171%{_datadir}/aclocal/libxml.m4
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000172%{_libdir}/pkgconfig/libxml-2.0.pc
Daniel Veillard2fcdb422014-10-16 15:39:41 +0800173%{_libdir}/cmake/libxml2/libxml2-config.cmake
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800174
175%files static
176%defattr(-, root, root)
177
178%{_libdir}/*a
179
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200180%files -n python-%{name}
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000181%defattr(-, root, root)
182
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800183%{_libdir}/python2*/site-packages/libxml2.py*
184%{_libdir}/python2*/site-packages/drv_libxml2.py*
185%{_libdir}/python2*/site-packages/libxml2mod*
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000186%doc python/TODO
187%doc python/libxml2class.txt
188%doc python/tests/*.py
Daniel Veillardf9c4cad2002-11-22 15:57:07 +0000189%doc doc/*.py
190%doc doc/python.html
Michael Fulbright62e8e801998-09-25 16:58:38 +0000191
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800192%if 0%{?with_python3}
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200193%files -n python3-%{name}
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800194%defattr(-, root, root)
195
196%{_libdir}/python3*/site-packages/libxml2.py*
197%{_libdir}/python3*/site-packages/drv_libxml2.py*
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200198%{_libdir}/python3*/site-packages/__pycache__/*py*
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800199%{_libdir}/python3*/site-packages/libxml2mod*
200%doc python/TODO
201%doc python/libxml2class.txt
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200202%doc py3doc/*.py
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800203%doc doc/python.html
204%endif # with_python3
205
Michael Fulbright62e8e801998-09-25 16:58:38 +0000206%changelog
Daniel Veillard9715c172002-11-25 16:33:40 +0000207* @RELDATE@ Daniel Veillard <veillard@redhat.com>
Elliott Hughesecdab2a2022-02-23 14:33:50 -0800208- upstream release @VERSION@
Daniel Veillard9715c172002-11-25 16:33:40 +0000209