2024-02-06 14:53:32 +00:00
|
|
|
%define major 10
|
2015-08-20 12:51:21 +02:00
|
|
|
%define libname %mklibname %{name} _%{major}
|
|
|
|
%define devname %mklibname %{name} -d
|
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
Summary: Simple, small and efficient C++ XML parser
|
|
|
|
Name: tinyxml2
|
2024-02-06 14:53:32 +00:00
|
|
|
Version: 10.0.0
|
2020-03-04 11:08:24 +03:00
|
|
|
Release: 1
|
2017-12-25 11:58:17 +10:00
|
|
|
License: zlib
|
|
|
|
Group: System/Libraries
|
2024-09-15 08:58:38 +00:00
|
|
|
URL: https://github.com/leethomason/tinyxml2
|
|
|
|
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
2017-12-25 11:58:17 +10:00
|
|
|
Source1: FindTinyXML2.cmake
|
2024-09-15 08:58:38 +00:00
|
|
|
Source1000: %{name}.rpmlintrc
|
2017-12-25 11:58:17 +10:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: doxygen
|
2015-08-20 12:51:21 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
#----------------------------------------------------------------------------
|
2015-08-20 12:51:21 +02:00
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
%package -n %{libname}
|
|
|
|
Summary: Simple, small and efficient C++ XML parser
|
|
|
|
Group: System/Libraries
|
2015-08-20 12:51:21 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
%files -n %{libname}
|
2015-08-20 12:51:21 +02:00
|
|
|
%{_libdir}/lib%{name}.so.%{major}
|
|
|
|
%{_libdir}/lib%{name}.so.%{version}
|
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
#----------------------------------------------------------------------------
|
2015-08-20 12:51:21 +02:00
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
%package -n %{devname}
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
Group: Development/C++
|
|
|
|
Requires: %{libname} = %{EVRD}
|
2015-08-20 12:51:21 +02:00
|
|
|
|
|
|
|
%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
|
2017-12-25 11:58:17 +10:00
|
|
|
%{_libdir}/cmake/%{name}/
|
2015-08-20 12:51:21 +02:00
|
|
|
%{_libdir}/lib%{name}.so
|
|
|
|
%{_libdir}/pkgconfig/%{name}.pc
|
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
#----------------------------------------------------------------------------
|
2015-08-20 12:51:21 +02:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
|
|
|
%build
|
2024-09-15 08:58:38 +00:00
|
|
|
%cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
2020-01-13 19:21:16 +03:00
|
|
|
%make
|
2015-08-20 12:51:21 +02:00
|
|
|
|
|
|
|
# Build the documentation from the "dox" template
|
|
|
|
cd ..
|
|
|
|
doxygen dox
|
|
|
|
|
2017-12-25 11:58:17 +10:00
|
|
|
%install
|
2020-01-13 19:21:16 +03:00
|
|
|
%makeinstall_std -C build
|
2017-12-25 11:58:17 +10:00
|
|
|
|
|
|
|
# Install CMake find module
|
2024-09-15 08:58:38 +00:00
|
|
|
install -Dm0644 %{SOURCE1} %{buildroot}%{_datadir}/cmake/Modules/FindTinyXML2.cmake
|
2017-12-25 11:58:17 +10:00
|
|
|
|
2015-08-20 12:51:21 +02:00
|
|
|
%check
|
|
|
|
pushd build
|
|
|
|
export LD_LIBRARY_PATH=`pwd`
|
2023-03-07 16:48:32 +10:00
|
|
|
./xmltest .././resources/
|
2015-08-20 12:51:21 +02:00
|
|
|
popd
|
2024-09-15 08:58:38 +00:00
|
|
|
|
|
|
|
# fix double slash in pc
|
|
|
|
sed -i 's|//|/|g' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
|