%define major 5 %define libname %mklibname %{name} _%{major} %define devname %mklibname %{name} -d Summary: Simple, small and efficient C++ XML parser Name: tinyxml2 Version: 5.0.1 Release: 3 License: zlib Group: System/Libraries Url: http://www.grinninglizard.com/tinyxml2/ Source0: https://github.com/leethomason/tinyxml2/archive/%{version}/%{name}-%{version}.tar.gz Source1: FindTinyXML2.cmake # https://github.com/leethomason/tinyxml2/pull/587 Patch0: 0001-CMake-Respect-libdir-for-config-files.patch BuildRequires: cmake BuildRequires: doxygen %description TinyXML-2 is a simple, small, efficient, C++ XML parser that can be easily integrated into other programs. It uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. #---------------------------------------------------------------------------- %package -n %{libname} Summary: Simple, small and efficient C++ XML parser Group: System/Libraries %description -n %{libname} TinyXML-2 is a simple, small, efficient, C++ XML parser that can be easily integrated into other programs. It uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. TinyXML-2 doesn't parse or use DTDs (Document Type Definitions) nor XSLs (eXtensible Stylesheet Language). TinyXML-2 uses a similar API to TinyXML-1, But the implementation of the parser was completely re-written to make it more appropriate for use in a game. It uses less memory, is faster, and uses far fewer memory allocations. %files -n %{libname} %{_libdir}/lib%{name}.so.%{major} %{_libdir}/lib%{name}.so.%{version} #---------------------------------------------------------------------------- %package -n %{devname} Summary: Development files for %{name} Group: Development/C++ Requires: %{libname} = %{EVRD} %description -n %{devname} This package contains the libraries and header files that are needed for writing applications with the %{name} library. %files -n %{devname} %doc readme.md docs/* %{_datadir}/cmake/Modules/FindTinyXML2.cmake %{_includedir}/%{name}.h %{_libdir}/cmake/%{name}/ %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/%{name}.pc #---------------------------------------------------------------------------- %prep %setup -q %patch0 -p1 %build %cmake %make_build # Build the documentation from the "dox" template cd .. doxygen dox %install %make_install -C build # Install CMake find module install -D -m644 %{SOURCE1} %{buildroot}%{_datadir}/cmake/Modules/FindTinyXML2.cmake %check pushd build export LD_LIBRARY_PATH=`pwd` ./xmltest popd