blob: d5f5ccbb7dd2805474d52854ca0d26c209521931 [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
Daniel Veillardbdec2182016-05-23 16:04:52 +08009Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
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
Daniel Veillard1a123612001-09-19 08:06:23 +000018URL: http://xmlsoft.org/
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
131make runtests
Daniel Veillardea898282001-11-04 22:13:45 +0000132
133%clean
Daniel Veillard366a9152002-10-23 20:43:53 +0000134rm -fr %{buildroot}
Daniel Veillardea898282001-11-04 22:13:45 +0000135
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800136%post -p /sbin/ldconfig
Daniel Veillardea898282001-11-04 22:13:45 +0000137
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800138%postun -p /sbin/ldconfig
Daniel Veillardea898282001-11-04 22:13:45 +0000139
140%files
141%defattr(-, root, root)
142
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800143%doc AUTHORS NEWS README Copyright TODO
Daniel Veillardea898282001-11-04 22:13:45 +0000144%doc %{_mandir}/man1/xmllint.1*
145%doc %{_mandir}/man1/xmlcatalog.1*
Daniel Veillarde915b2d2002-03-06 18:42:40 +0000146%doc %{_mandir}/man3/libxml.3*
Daniel Veillardea898282001-11-04 22:13:45 +0000147
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000148%{_libdir}/lib*.so.*
Daniel Veillard29341682009-09-10 18:23:39 +0200149%{_bindir}/xmllint
150%{_bindir}/xmlcatalog
Daniel Veillardea898282001-11-04 22:13:45 +0000151
152%files devel
153%defattr(-, root, root)
154
155%doc %{_mandir}/man1/xml2-config.1*
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800156%doc AUTHORS NEWS README Copyright
Daniel Veillardf5a457a2002-03-07 10:25:29 +0000157%doc doc/*.html doc/html doc/*.gif doc/*.png
Daniel Veillard771971f2005-04-02 10:49:51 +0000158%doc doc/tutorial doc/libxml2-api.xml.gz
Daniel Veillard8d7b5c72003-11-15 18:24:36 +0000159%doc doc/examples
Daniel Veillard29341682009-09-10 18:23:39 +0200160%doc %dir %{_datadir}/gtk-doc/html/libxml2
Daniel Veillard1db4a662005-09-12 13:10:09 +0000161%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
Daniel Veillardea898282001-11-04 22:13:45 +0000165
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000166%{_libdir}/lib*.so
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000167%{_libdir}/*.sh
Daniel Veillard29341682009-09-10 18:23:39 +0200168%{_includedir}/*
169%{_bindir}/xml2-config
170%{_datadir}/aclocal/libxml.m4
Daniel Veillard5643b5a2002-09-04 12:27:06 +0000171%{_libdir}/pkgconfig/libxml-2.0.pc
Daniel Veillard2fcdb422014-10-16 15:39:41 +0800172%{_libdir}/cmake/libxml2/libxml2-config.cmake
Daniel Veillard87b4d6f2012-10-11 14:44:22 +0800173
174%files static
175%defattr(-, root, root)
176
177%{_libdir}/*a
178
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200179%files -n python-%{name}
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000180%defattr(-, root, root)
181
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800182%{_libdir}/python2*/site-packages/libxml2.py*
183%{_libdir}/python2*/site-packages/drv_libxml2.py*
184%{_libdir}/python2*/site-packages/libxml2mod*
Daniel Veillard253aa2c2002-02-02 09:17:16 +0000185%doc python/TODO
186%doc python/libxml2class.txt
187%doc python/tests/*.py
Daniel Veillardf9c4cad2002-11-22 15:57:07 +0000188%doc doc/*.py
189%doc doc/python.html
Michael Fulbright62e8e801998-09-25 16:58:38 +0000190
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800191%if 0%{?with_python3}
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200192%files -n python3-%{name}
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800193%defattr(-, root, root)
194
195%{_libdir}/python3*/site-packages/libxml2.py*
196%{_libdir}/python3*/site-packages/drv_libxml2.py*
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200197%{_libdir}/python3*/site-packages/__pycache__/*py*
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800198%{_libdir}/python3*/site-packages/libxml2mod*
199%doc python/TODO
200%doc python/libxml2class.txt
Daniel Veillarde29e50e2017-08-29 12:40:54 +0200201%doc py3doc/*.py
Tomas Radejfb8e9e22015-02-18 22:47:13 +0800202%doc doc/python.html
203%endif # with_python3
204
Michael Fulbright62e8e801998-09-25 16:58:38 +0000205%changelog
Daniel Veillard9715c172002-11-25 16:33:40 +0000206* @RELDATE@ Daniel Veillard <veillard@redhat.com>
207- upstream release @VERSION@ see http://xmlsoft.org/news.html
208