%define api 2.0 %define major 16 # The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %if %major <= 2 %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %else %define mklibname(ds) lib%{1}%{?2:%{2}%{?3:_%{3}}}%{-s:-static}%{-d:-devel} %endif %endif %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif %define libname %mklibname xml 2 %{major} %define develname %mklibname xml 2 -d Summary: Library providing XML and HTML support Name: libxml2 # WARNING: Please rebuild perl-XML-LibXML when you upload a new version else # you'll break a ton of perl packages' testsuite!!!!! Version: 2.14.4 Release: %mkrel 1.1 License: MIT Group: System/Libraries URL: http://www.xmlsoft.org/ Source0: https://download.gnome.org/sources/%{name}/2.14/%{name}-%{version}.tar.xz # Patch from openSUSE. # See: https://bugzilla.gnome.org/show_bug.cgi?id=789714 #Patch1: libxml2-2.12.0-python3-unicode-errors.patch #Patch2: d0c3f01e110d54415611c5fa0040cdf4a56053f9.patch #Patch3: 235b15a590eecf97b09e87bdb7e4f8333e9de129.patch #Patch4: d39f78069dff496ec865c73aa44d7110e429bce9.patch BuildRequires: gcc BuildRequires: cmake BuildRequires: make BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(liblzma) BuildRequires: (pkgconfig(readline) or readline-devel) Obsoletes: libxml2-2 <= %{version}-10%{release} %description This library allows you to manipulate XML files. It includes support for reading, modifying and writing XML and HTML files. There is DTDs support: this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. The output can be a simple SAX stream or and in-memory DOM-like representations. In this case one can use the built-in XPath and XPointer implementation to select subnodes or ranges. A flexible Input/Output mechanism is available, with existing HTTP and FTP modules and combined to a URI library. %if "%{libname}" != "%{name}" %package -n %{libname} Summary: Shared libraries providing XML and HTML support Group: System/Libraries Provides: %{name} = %{version}-%{release} %description -n %{libname} This library allows you to manipulate XML files. It includes support for reading, modifying and writing XML and HTML files. There is DTDs support: this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. %endif %package utils Summary: Utilities to manipulate XML files Group: System/Libraries Provides: xmllint = %{version}-%{release} Provides: xmlcatalog = %{version}-%{release} %description utils This packages contains utils to manipulate XML files. %package -n %{develname} Summary: Libraries, includes, etc. to develop XML and HTML applications Group: Development/C Requires: %{libname} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} %description -n %{develname} Libraries, include files, etc you can use to develop XML applications. This library allows you to manipulate XML files. It includes support for reading, modifying and writing XML and HTML files. There is DTDs support: this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. %prep %setup -q %autopatch -p1 # Prep py3 docs %build # The Python bindings will be removed in the near future %cmake -B build -DLIBXML2_WITH_PYTHON=OFF cd build; %make_build %install cd build; %make_install # remove unpackaged files rm -rf %{buildroot}%{_prefix}/doc \ %{buildroot}%{_datadir}/doc #we don't want these find %{buildroot} -name "*.la" -delete %if %{with check} %check # all tests must pass # use TARBALLURL_2="" TARBALLURL="" TESTDIRS="" to disable xstc test which are using remote tarball #make TARBALLURL_2="" TARBALLURL="" TESTDIRS="" check #need to do that after check otherwise it will fail # clean before packaging documentation pushd example make clean rm -rf .deps Makefile popd %endif %if "%{libname}" == "%{name}" %files %else %files -n %{libname} %endif %{_libdir}/lib*.so.%{major}{,.*} %files utils %doc README.md %license Copyright %{_bindir}/xmlcatalog %{_bindir}/xmllint %{_mandir}/man1/xmlcatalog* %{_mandir}/man1/xmllint* %files -n %{develname} %doc NEWS README.md %license Copyright %{_bindir}/xml2-config %{_libdir}/*.so %{_libdir}/pkgconfig/* %{_libdir}/cmake/libxml2-%{version}/ %{_mandir}/man1/xml2-config* %{_includedir}/*