[fts/epel7] Fixes to build fts in EPEL7

Alejandro Alvarez aalvarez at fedoraproject.org
Thu Feb 20 15:22:19 UTC 2014


commit e6f71a0cb23885ce339600289c697ffc47041dda
Author: aalvarez <aalvarez at cern.ch>
Date:   Thu Feb 20 16:20:51 2014 +0100

    Fixes to build fts in EPEL7

 fts-build-without-pugixml.patch |  229 +++++++++++++++++++++++++++++++++++++++
 fts.spec                        |   20 +++-
 2 files changed, 247 insertions(+), 2 deletions(-)
---
diff --git a/fts-build-without-pugixml.patch b/fts-build-without-pugixml.patch
new file mode 100644
index 0000000..ee0c8d9
--- /dev/null
+++ b/fts-build-without-pugixml.patch
@@ -0,0 +1,229 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 66e8e0d..f42392e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -67,14 +67,20 @@ find_package(OCCI)
+ find_package(APR 1.2.7 REQUIRED)
+ find_package(APRUtil 1.2.7 REQUIRED)
+ find_package(ActiveMQcpp 3.2.0 REQUIRED)
++find_package(PugiXML)
+ endif ()
+ 
+ if (MAINBUILD STREQUAL "ON")
+ find_package(APR 1.2.7 REQUIRED)
+ find_package(APRUtil 1.2.7 REQUIRED)
+ find_package(ActiveMQcpp 3.2.0 REQUIRED)
++find_package(PugiXML)
+ endif ()
+ 
++if (NOT PUGIXML_FOUND)
++    add_definitions(-DWITHOUT_PUGI)
++endif (NOT PUGIXML_FOUND)
++
+ find_package(Threads)
+ find_package(OpenSSL)
+ 
+diff --git a/cmake/modules/FindPugiXML.cmake b/cmake/modules/FindPugiXML.cmake
+new file mode 100644
+index 0000000..18f37f2
+--- /dev/null
++++ b/cmake/modules/FindPugiXML.cmake
+@@ -0,0 +1,42 @@
++#
++# This module detects if pugixml is installed and determines where the
++# include files and libraries are.
++#
++# This code sets the following variables:
++# 
++# PUGIXML_LIBRARIES   = full path to the pugixml libraries
++# PUGIXML_INCLUDE_DIR = include dir to be used when using the pugixml library
++# PUGIXML_FOUND       = set to true if pugixml was found successfully
++#
++# PUGIXML_LOCATION
++#   setting this enables search for pugixml libraries / headers in this location
++
++
++# -----------------------------------------------------
++# PUGIXML Libraries
++# -----------------------------------------------------
++find_library(PUGIXML_LIBRARIES
++    NAMES pugixml
++    HINTS ${PUGIXML_LOCATION}/lib ${PUGIXML_LOCATION}/lib64 ${PUGIXML_LOCATION}/lib32
++    DOC "The main pugixml library"
++)
++
++# -----------------------------------------------------
++# PUGIXML Include Directories
++# -----------------------------------------------------
++find_path(PUGIXML_INCLUDE_DIR 
++    NAMES pugixml.hpp
++    HINTS ${PUGIXML_LOCATION} ${PUGIXML_LOCATION}/include ${PUGIXML_LOCATION}/include/* /usr/include
++    DOC "The pugixml include directory"
++)
++if(PUGIXML_INCLUDE_DIR)
++    message(STATUS "pugixml includes found in ${PUGIXML_INCLUDE_DIR}")
++endif()
++
++# -----------------------------------------------------
++# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if 
++# all listed variables are TRUE
++# -----------------------------------------------------
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(pugixml DEFAULT_MSG PUGIXML_LIBRARIES PUGIXML_INCLUDE_DIR)
++mark_as_advanced(PUGIXML_INCLUDE_DIR PUGIXML_LIBRARIES)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 6af0868..5b47e4f 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -46,7 +46,10 @@ add_subdirectory(scripts)
+ add_subdirectory(dbClear)
+ add_subdirectory(glue2-publisher)
+ add_subdirectory(myosg-update)
+-add_subdirectory(bdii-cache-update)
++
++if (PUGIXML_FOUND)
++    add_subdirectory(bdii-cache-update)
++endif (PUGIXML_FOUND)
+ ENDIF()
+ 
+ IF (ALLBUILD STREQUAL "ON")
+@@ -66,7 +69,10 @@ add_subdirectory(scripts)
+ add_subdirectory(dbClear)
+ add_subdirectory(glue2-publisher)
+ add_subdirectory(myosg-update)
+-add_subdirectory(bdii-cache-update)
++
++if (PUGIXML_FOUND)
++    add_subdirectory(bdii-cache-update)
++endif (PUGIXML_FOUND)
+ ENDIF()
+ 
+ 
+diff --git a/src/infosys/CMakeLists.txt b/src/infosys/CMakeLists.txt
+index a648497..4a795b3 100644
+--- a/src/infosys/CMakeLists.txt
++++ b/src/infosys/CMakeLists.txt
+@@ -28,7 +28,16 @@ include_directories (BEFORE ${PROJECT_SOURCE_DIR}/src/config/)
+ include_directories (BEFORE ${PROJECT_BINARY_DIR}/src/config/)
+ include_directories (BEFORE ${PROJECT_BINARY_DIR}/src/infosys/)
+ 
+-file(GLOB fts_infosys_sources "*.cpp")
++set(fts_infosys_sources
++    BdiiBrowser.cpp
++    SiteNameCacheRetriever.cpp
++    SiteNameRetriever.cpp
++)
++
++if (PUGIXML_FOUND)
++    list(APPEND fts_infosys_sources BdiiCacheParser.cpp)
++    list(APPEND fts_infosys_sources OsgParser.cpp)
++endif (PUGIXML_FOUND)
+ 
+ find_package (Boost COMPONENTS thread)
+ 
+@@ -36,7 +45,11 @@ add_library(fts_infosys SHARED ${fts_infosys_sources})
+ add_dependencies(fts_infosys fts_common fts_config)
+ target_link_libraries(fts_infosys fts_common fts_config)
+ target_link_libraries(fts_infosys ${Boost_LIBRARIES} )
+-target_link_libraries(fts_infosys -lldap_r 	-lpugixml)
++target_link_libraries(fts_infosys -lldap_r)
++
++if (PUGIXML_FOUND)
++    target_link_libraries(fts_infosys -lpugixml)
++endif (PUGIXML_FOUND)
+ 
+ 
+ set_target_properties(fts_infosys             PROPERTIES
+diff --git a/src/infosys/SiteNameCacheRetriever.h b/src/infosys/SiteNameCacheRetriever.h
+index 1527976..5ce5145 100644
+--- a/src/infosys/SiteNameCacheRetriever.h
++++ b/src/infosys/SiteNameCacheRetriever.h
+@@ -31,7 +31,6 @@
+ #include <boost/property_tree/ptree.hpp>
+ 
+ #include "BdiiBrowser.h"
+-#include "OsgParser.h"
+ 
+ #include "common/ThreadSafeInstanceHolder.h"
+ 
+diff --git a/src/infosys/SiteNameRetriever.cpp b/src/infosys/SiteNameRetriever.cpp
+index 6ef03b6..da0b8d6 100644
+--- a/src/infosys/SiteNameRetriever.cpp
++++ b/src/infosys/SiteNameRetriever.cpp
+@@ -131,8 +131,11 @@ string SiteNameRetriever::getSiteName(string se)
+             return it->second;
+         }
+ 
++    string site;
++
++#ifndef WITHOUT_PUGI
+     // check in BDII cache
+-    string site = BdiiCacheParser::getInstance().getSiteName(se);
++    site = BdiiCacheParser::getInstance().getSiteName(se);
+     if (!site.empty())
+         {
+             // save it in cache
+@@ -141,6 +144,7 @@ string SiteNameRetriever::getSiteName(string se)
+             if(seToSite.size() > 5000) seToSite.clear();
+             return site;
+         }
++#endif
+ 
+     // check in BDII
+     site = getFromBdii(se);
+@@ -153,6 +157,7 @@ string SiteNameRetriever::getSiteName(string se)
+             return site;
+         }
+ 
++#ifndef WITHOUT_PUGI
+     // check in MyOSG
+     site = OsgParser::getInstance().getSiteName(se);
+ 
+@@ -164,6 +169,7 @@ string SiteNameRetriever::getSiteName(string se)
+             // clear the cache if there are too many entries
+             if(seToSite.size() > 5000) seToSite.clear();
+         }
++#endif
+ 
+     return site;
+ }
+diff --git a/src/infosys/SiteNameRetriever.h b/src/infosys/SiteNameRetriever.h
+index 4613402..a7f44ed 100644
+--- a/src/infosys/SiteNameRetriever.h
++++ b/src/infosys/SiteNameRetriever.h
+@@ -31,8 +31,11 @@
+ #include <boost/thread.hpp>
+ 
+ #include "BdiiBrowser.h"
+-#include "OsgParser.h"
+-#include "BdiiCacheParser.h"
++
++#ifndef WITHOUT_PUGI
++#  include "OsgParser.h"
++#  include "BdiiCacheParser.h"
++#endif
+ 
+ #include "common/ThreadSafeInstanceHolder.h"
+ 
+diff --git a/src/server/ws/transfer/JobSubmitter.cpp b/src/server/ws/transfer/JobSubmitter.cpp
+index bac8aa1..2e85d59 100644
+--- a/src/server/ws/transfer/JobSubmitter.cpp
++++ b/src/server/ws/transfer/JobSubmitter.cpp
+@@ -36,8 +36,7 @@
+ #include "ws/CGsiAdapter.h"
+ #include "ws/delegation/GSoapDelegationHandler.h"
+ 
+-#include "infosys/OsgParser.h"
+-
++#include "profiler/Macros.h"
+ 
+ #include <boost/lexical_cast.hpp>
+ 
+@@ -53,7 +52,6 @@
+ 
+ using namespace db;
+ using namespace config;
+-using namespace fts3::infosys;
+ using namespace fts3::ws;
+ using namespace boost;
+ using namespace boost::assign;
diff --git a/fts.spec b/fts.spec
index cb3a6dd..7f8c014 100644
--- a/fts.spec
+++ b/fts.spec
@@ -15,6 +15,10 @@ URL: https://svnweb.cern.ch/trac/fts3/wiki
 #  tar -czvf fts-0.0.1-60.tar.gz fts-00160
 Source0: https://grid-deployment.web.cern.ch/grid-deployment/dms/fts3/tar/%{name}-%{version}.tar.gz
 
+# Fixed in upstream already
+# https://svnweb.cern.ch/trac/fts3/changeset/4062/trunk
+Patch0: fts-build-without-pugixml.patch
+
 %if 0%{?el5}
 BuildRequires:  activemq-cpp-library
 %else
@@ -39,7 +43,9 @@ BuildRequires:  gsoap-devel
 BuildRequires:  is-interface-devel
 BuildRequires:  libcurl-devel
 BuildRequires:  openldap-devel
+%if 0%{?el6}
 BuildRequires:  pugixml-devel
+%endif
 BuildRequires:  python2-devel
 BuildRequires:  voms-devel
 Requires(pre):  shadow-utils
@@ -122,7 +128,7 @@ administering purposes.
 
 %prep
 %setup -qc
-
+%patch0 -p1
 
 %build
 # Make sure the version in the spec file and the version used
@@ -169,7 +175,9 @@ exit 0
 /sbin/chkconfig --add fts-records-cleaner
 /sbin/chkconfig --add fts-info-publisher
 /sbin/chkconfig --add fts-myosg-updater
+%if 0%{?el6}
 /sbin/chkconfig --add fts-bdii-cache-updater
+%endif
 exit 0
 
 %preun server
@@ -188,8 +196,10 @@ if [ $1 -eq 0 ] ; then
     /sbin/chkconfig --del fts-info-publisher
     /sbin/service fts-myosg-updater stop >/dev/null 2>&1
     /sbin/chkconfig --del fts-myosg-updater
+%if 0%{?el6}
     /sbin/service fts-bdii-cache-updater stop >/dev/null 2>&1
     /sbin/chkconfig --del fts-bdii-cache-updater
+%endif
 fi
 exit 0
 
@@ -202,7 +212,9 @@ if [ "$1" -ge "1" ] ; then
     /sbin/service fts-records-cleaner condrestart >/dev/null 2>&1 || :
     /sbin/service fts-info-publisher condrestart >/dev/null 2>&1 || :
     /sbin/service fts-myosg-updater condrestart >/dev/null 2>&1 || :
+%if 0%{?el6}
     /sbin/service fts-bdii-cache-updater condrestart >/dev/null 2>&1 || :
+%endif
 fi
 exit 0
 
@@ -220,7 +232,9 @@ exit 0
 %dir %attr(0755,fts3,root) %{_var}/lib/fts3/logs
 %dir %attr(0755,fts3,root) %{_var}/log/fts3
 %dir %attr(0755,fts3,root) %{_sysconfdir}/fts3
+%if 0%{?el6}
 %config(noreplace) %attr(0644,fts3,root) %{_var}/lib/fts3/bdii_cache.xml
+%endif
 %config(noreplace) %attr(0644,fts3,root) %{_var}/lib/fts3/myosg.xml
 %{_sbindir}/fts*
 %attr(0755,root,root) %{_initddir}/fts-msg-bulk
@@ -230,12 +244,14 @@ exit 0
 %attr(0755,root,root) %{_initddir}/fts-records-cleaner
 %attr(0755,root,root) %{_initddir}/fts-info-publisher
 %attr(0755,root,root) %{_initddir}/fts-myosg-updater
-%attr(0755,root,root) %{_initddir}/fts-bdii-cache-updater
 %attr(0755,root,root) %{_sysconfdir}/cron.daily/fts-records-cleaner
 %attr(0755,root,root) %{_sysconfdir}/cron.hourly/fts-msg-cron
 %attr(0755,root,root) %{_sysconfdir}/cron.hourly/fts-info-publisher
 %attr(0755,root,root) %{_sysconfdir}/cron.daily/fts-myosg-updater
+%if 0%{?el6}
+%attr(0755,root,root) %{_initddir}/fts-bdii-cache-updater
 %attr(0755,root,root) %{_sysconfdir}/cron.daily/fts-bdii-cache-updater
+%endif
 %config(noreplace) %attr(0640,root,fts3) %{_sysconfdir}/fts3/fts-msg-monitoring.conf
 %config(noreplace) %attr(0640,root,fts3) %{_sysconfdir}/fts3/fts3config
 %config(noreplace) %{_sysconfdir}/logrotate.d/fts-server


More information about the scm-commits mailing list