commit 0bd59adf304f2257b7daffe58b84a2b55bbb5416 Author: abfonly Date: Thu Aug 20 12:51:21 2015 +0200 Imported from SRPM diff --git a/.abf.yml b/.abf.yml new file mode 100644 index 0000000..4995b63 --- /dev/null +++ b/.abf.yml @@ -0,0 +1,2 @@ +sources: + tinyxml2-3.0.0.tar.gz: 07acaae49f7dd3dab790da4fe72d0c7ef0d116d1 diff --git a/FindTinyXML2.cmake b/FindTinyXML2.cmake new file mode 100644 index 0000000..b057c12 --- /dev/null +++ b/FindTinyXML2.cmake @@ -0,0 +1,31 @@ +# - Try to find TinyXML2 +# This module finds TinyXML2 if it is installed and determines where +# the library and header files are. This code sets the following variables: +# +# TINYXML2_FOUND - System has TinyXML2 +# TINYXML2_INCLUDE_DIRS - The TinyXML2 include directories +# TINYXML2_LIBRARIES - The libraries needed to use TinyXML2 +# TINYXML2_DEFINITIONS - Compiler switches required for using TinyXML2 +# +# Based on http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules + +find_package(PkgConfig) +pkg_check_modules(PC_TINYXML2 tinyxml2) + +find_path(TINYXML2_INCLUDE_DIR tinyxml2.h + HINTS ${PC_TINYXML2_INCLUDEDIR} + PATH_SUFFIXES include + PATHS /usr /usr/local) + +find_library(TINYXML2_LIBRARY tinyxml2 + HINTS ${PC_TINYXML2_LIBDIR} + PATH_SUFFIXES lib64 lib + PATHS /usr /usr/local) + +set(TINYXML2_LIBRARIES ${TINYXML2_LIBRARY}) +set(TINYXML2_INCLUDE_DIRS ${TINYXML2_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TinyXML2 DEFAULT_MSG + TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR) +mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_LIBRARY) diff --git a/tinyxml2.spec b/tinyxml2.spec new file mode 100644 index 0000000..96ba15e --- /dev/null +++ b/tinyxml2.spec @@ -0,0 +1,92 @@ +%define major 3 +%define libname %mklibname %{name} _%{major} +%define devname %mklibname %{name} -d +%define debug_package %{nil} + +Name: tinyxml2 +Version: 3.0.0 +Release: 1 +Summary: Simple, small and efficient C++ XML parser +Group: System/Libraries +License: zlib +URL: http://www.grinninglizard.com/tinyxml2/ +Source0: https://github.com/leethomason/tinyxml2/archive/%{version}/%{name}-%{version}.tar.gz +Source1: FindTinyXML2.cmake + +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} +%doc readme.md +%{_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}/lib%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + +#------------------------------------------------------------------ + +%prep +%setup -q + +%build +%cmake +%make + +# Build the documentation from the "dox" template +cd .. +doxygen dox + +%check +pushd build +export LD_LIBRARY_PATH=`pwd` +./xmltest +popd + +%install +%makeinstall_std -C build + +# Install CMake find module +install -D -m644 %{SOURCE1} \ + %{buildroot}%{_datadir}/cmake/Modules/FindTinyXML2.cmake +