[tinyxml2] Fix build on EPEL.

Susi Lehtola jussilehtola at fedoraproject.org
Mon Oct 14 08:30:14 UTC 2013


commit f24b297724abe17c44a144e6245349f5b2600495
Author: Susi Lehtola <jussilehtola at fedoraproject.org>
Date:   Mon Oct 14 11:30:08 2013 +0300

    Fix build on EPEL.

 .gitignore               |    1 +
 sources                  |    1 +
 tinyxml2-epelbuild.patch |   11 +++++++++++
 tinyxml2.spec            |   21 +++++++++++++++++++--
 4 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 232563f..57bce72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /tinyxml2-1.0.11-0323851.tar.gz
+/GNUInstallDirs.cmake
diff --git a/sources b/sources
index 7cce46c..07711f7 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
 10655584c11180916c1f4febd57bae4c  tinyxml2-1.0.11-0323851.tar.gz
+fd9602db874aa96abcb81fa752f052e5  GNUInstallDirs.cmake
diff --git a/tinyxml2-epelbuild.patch b/tinyxml2-epelbuild.patch
new file mode 100644
index 0000000..d3b398c
--- /dev/null
+++ b/tinyxml2-epelbuild.patch
@@ -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()
+ 
diff --git a/tinyxml2.spec b/tinyxml2.spec
index 261ddaf..da5a791 100644
--- a/tinyxml2.spec
+++ b/tinyxml2.spec
@@ -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 at fedoraproject.org> - 1.0.11-4.20130805git0323851
+- Patch to build in EPEL branches.
+
 * Mon Aug 12 2013 François Cami <fcami at fedoraproject.org> - 1.0.11-3.20130805git0323851
 - Fixes by Susi Lehtola: build in a separate directory and don't build anything static.
 


More information about the scm-commits mailing list