Fix build on EPEL.

This commit is contained in:
Susi Lehtola 2013-10-14 11:30:08 +03:00
parent 3d05313476
commit f24b297724
4 changed files with 32 additions and 2 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/tinyxml2-1.0.11-0323851.tar.gz
/GNUInstallDirs.cmake

View File

@ -1 +1,2 @@
10655584c11180916c1f4febd57bae4c tinyxml2-1.0.11-0323851.tar.gz
fd9602db874aa96abcb81fa752f052e5 GNUInstallDirs.cmake

11
tinyxml2-epelbuild.patch Normal file
View File

@ -0,0 +1,11 @@
diff -up tinyxml2-03238517b3718f0c977bb061747faa8ebfc4fb44/CMakeLists.txt.orig tinyxml2-03238517b3718f0c977bb061747faa8ebfc4fb44/CMakeLists.txt
--- tinyxml2-03238517b3718f0c977bb061747faa8ebfc4fb44/CMakeLists.txt.orig 2013-08-05 23:04:27.000000000 +0300
+++ tinyxml2-03238517b3718f0c977bb061747faa8ebfc4fb44/CMakeLists.txt 2013-10-14 11:17:45.403298279 +0300
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6 FATAL
cmake_policy(VERSION 2.6)
project(tinyxml2)
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH})
include(GNUInstallDirs)
#enable_testing()

View File

@ -10,7 +10,7 @@
Name: tinyxml2
Version: 1.0.11
Release: 3%{gitversion}%{?dist}
Release: 4%{gitversion}%{?dist}
Summary: Simple, small and efficient C++ XML parser
Group: Development/Libraries
@ -18,6 +18,11 @@ License: zlib
URL: https://github.com/%{githubparent}/%{name}
Source0: https://github.com/%{githubparent}/%{name}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
# EPEL has a too old CMake which is missing GNUInstallDirs (copied from Fedora 19 CMake)
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Source1: GNUInstallDirs.cmake
Patch0: tinyxml2-epelbuild.patch
BuildRequires: cmake
%description
@ -45,6 +50,10 @@ for writing applications with the %{name} library.
%prep
%setup -q -n %{name}-%{commit}
chmod -c -x *.cpp *.h
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
%patch0 -p1 -b .epel
cp -p %{SOURCE1} .
%endif
%build
mkdir objdir
@ -55,11 +64,16 @@ make %{?_smp_mflags}
%check
cd objdir
make test
export LD_LIBRARY_PATH=`pwd`
./test
%install
rm -rf %{buildroot}
cd objdir
make install DESTDIR=$RPM_BUILD_ROOT
make install DESTDIR=%{buildroot}
%clean
rm -rf %{buildroot}
%post -p /sbin/ldconfig
@ -76,6 +90,9 @@ make install DESTDIR=$RPM_BUILD_ROOT
%{_libdir}/pkgconfig/%{name}.pc
%changelog
* Mon Oct 14 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.0.11-4.20130805git0323851
- Patch to build in EPEL branches.
* Mon Aug 12 2013 François Cami <fcami@fedoraproject.org> - 1.0.11-3.20130805git0323851
- Fixes by Susi Lehtola: build in a separate directory and don't build anything static.