[root/f16] Backport fixes for using aclic with versioned libraries

Mattias Ellert ellert at fedoraproject.org
Fri Jun 29 10:44:22 UTC 2012


commit 380269c3e75c333b9cdde00a5ced7e8cbf2deb5d
Author: Mattias Ellert <mattias.ellert at fysast.uu.se>
Date:   Fri Jun 29 06:51:04 2012 +0200

    Backport fixes for using aclic with versioned libraries
    
    - New sub-package: root-io-gfal

 root-aclic-versioned-libs.patch |   82 +++++++++++++++++++++++++++++++++++++++
 root.spec                       |   32 +++++++++++++--
 2 files changed, 110 insertions(+), 4 deletions(-)
---
diff --git a/root-aclic-versioned-libs.patch b/root-aclic-versioned-libs.patch
new file mode 100644
index 0000000..935bf49
--- /dev/null
+++ b/root-aclic-versioned-libs.patch
@@ -0,0 +1,82 @@
+diff -ur root-5.30.06.orig/core/unix/src/TUnixSystem.cxx root-5.30.06/core/unix/src/TUnixSystem.cxx
+--- root-5.30.06.orig/core/unix/src/TUnixSystem.cxx	2012-01-10 16:14:31.000000000 +0100
++++ root-5.30.06/core/unix/src/TUnixSystem.cxx	2012-06-29 06:29:42.030017840 +0200
+@@ -440,6 +440,9 @@
+ 
+    TString lib = _dyld_get_image_name(i++);
+ 
++   TRegexp sovers = "libCore\\.[0-9]+\\.*[0-9]*\\.so";
++   TRegexp dyvers = "libCore\\.[0-9]+\\.*[0-9]*\\.dylib";
++
+ #ifndef ROOTPREFIX
+ #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
+    // first loaded is the app so set ROOTSYS to app bundle
+@@ -454,7 +457,8 @@
+       }
+    }
+ #else
+-   if (lib.EndsWith("libCore.dylib") || lib.EndsWith("libCore.so")) {
++   if (lib.EndsWith("libCore.dylib") || lib.EndsWith("libCore.so") ||
++       lib.Index(sovers) != kNPOS    || lib.Index(dyvers) != kNPOS) {
+       char respath[kMAXPATHLEN];
+       if (!realpath(lib, respath)) {
+          if (!gSystem->Getenv("ROOTSYS"))
+@@ -476,9 +480,23 @@
+ 
+    // add all libs loaded before libSystem.B.dylib
+    if (!gotFirstSo && (lib.EndsWith(".dylib") || lib.EndsWith(".so"))) {
+-      if (linkedDylibs.Length())
+-         linkedDylibs += " ";
+-      linkedDylibs += lib;
++      sovers = "\\.[0-9]+\\.*[0-9]*\\.so";
++      Ssiz_t idx = lib.Index(sovers);
++      if (idx != kNPOS) {
++         lib.Remove(idx);
++         lib += ".so";
++      }
++      dyvers = "\\.[0-9]+\\.*[0-9]*\\.dylib";
++      idx = lib.Index(dyvers);
++      if (idx != kNPOS) {
++         lib.Remove(idx);
++         lib += ".dylib";
++      }
++      if (!gSystem->AccessPathName(lib, kReadPermission)) {
++         if (linkedDylibs.Length())
++            linkedDylibs += " ";
++         linkedDylibs += lib;
++      }
+    }
+ }
+ #endif
+@@ -2838,9 +2856,11 @@
+       delete [] exe;
+       exe = longerexe;
+    }
++   TRegexp sovers = "\\.so\\.[0-9]+";
+ #else
+    const char *cLDD="ldd";
+    const char *cSOEXT=".so";
++   TRegexp sovers = "\\.so\\.[0-9]+";
+ #endif
+    FILE *p = OpenPipe(TString::Format("%s %s", cLDD, exe), "r");
+    TString ldd;
+@@ -2858,10 +2878,15 @@
+       }
+       if (solibName) {
+          TString solib = solibName->String();
+-         if (solib.EndsWith(cSOEXT)) {
+-            if (!linkedLibs.IsNull())
+-               linkedLibs += " ";
+-            linkedLibs += solib;
++         Ssiz_t idx = solib.Index(sovers);
++         if (solib.EndsWith(cSOEXT) || idx != kNPOS) {
++            if (idx != kNPOS)
++               solib.Remove(idx+3);
++            if (!AccessPathName(solib, kReadPermission)) {
++               if (!linkedLibs.IsNull())
++                  linkedLibs += " ";
++               linkedLibs += solib;
++            }
+          }
+       }
+       delete tok;
diff --git a/root.spec b/root.spec
index 35271e2..89f6964 100644
--- a/root.spec
+++ b/root.spec
@@ -20,7 +20,7 @@
 Name:		root
 Version:	5.30.06
 %global libversion %(cut -d. -f 1-2 <<< %{version})
-Release:	2%{?dist}
+Release:	3%{?dist}
 Summary:	Numerical data analysis framework
 
 Group:		Applications/Engineering
@@ -52,6 +52,8 @@ Patch3:		%{name}-xrootd.patch
 #		Fix hardcoded include path
 #		https://savannah.cern.ch/bugs/index.php?91463
 Patch4:		%{name}-meta.patch
+#		Backport fixes for using aclic with versioned libraries
+Patch5:		%{name}-aclic-versioned-libs.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 #		The build segfaults on ppc64 during an invocation of cint:
 #		https://savannah.cern.ch/bugs/index.php?70542
@@ -114,6 +116,8 @@ BuildRequires:	dcap-devel
 BuildRequires:	dpm-devel
 BuildRequires:	xrootd-devel
 BuildRequires:	cfitsio-devel
+BuildRequires:	gfal-devel
+BuildRequires:	srm-ifce-devel
 BuildRequires:	emacs
 BuildRequires:	emacs-el
 BuildRequires:	gcc-gfortran
@@ -557,6 +561,13 @@ Group:		Applications/Engineering
 %description io-dcache
 This package contains the dCache extension for ROOT.
 
+%package io-gfal
+Summary:	Grid File Access Library input/output library for ROOT
+Group:		Applications/Engineering
+
+%description io-gfal
+This package contains the Grid File Access Library extension for ROOT.
+
 %package io-rfio
 Summary:	Remote File input/output library for ROOT
 Group:		Applications/Engineering
@@ -1028,6 +1039,7 @@ fi
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 find . '(' -name '*.cxx' -o -name '*.cpp' -o -name '*.C' -o -name '*.c' -o \
 	   -name '*.h' -o -name '*.hh' -o -name '*.hi' -o -name '*.py' -o \
@@ -1135,6 +1147,9 @@ unset QTINC
 	    --enable-fftw3 \
 	    --enable-fitsio \
 	    --enable-gdml \
+	    --enable-gfal \
+	      --with-gfal-incdir=%{_includedir} \
+	      --with-gfal-libdir=%{_libdir} \
 	    --enable-genvector \
 	    --enable-globus \
 	    --enable-gsl-shared \
@@ -1171,8 +1186,8 @@ unset QTINC
 	    --enable-tmva \
 	    --enable-unuran \
 	    --enable-x11 \
-	    --enable-xml \
 	    --enable-xft \
+	    --enable-xml \
 	    --enable-xrootd \
 	      --with-xrootd-incdir=%{_includedir}/xrootd \
 	      --with-xrootd-libdir=%{_libdir} \
@@ -1188,7 +1203,6 @@ unset QTINC
 	    --disable-castor \
 	    --disable-chirp \
 	    --disable-cling \
-	    --disable-gfal \
 	    --disable-glite \
 	    --disable-hdfs \
 	    --disable-monalisa \
@@ -1348,7 +1362,6 @@ pushd ${RPM_BUILD_ROOT}%{_datadir}/%{name}/plugins
 rm TAFS/P010_TAFS.C
 rm TDataProgressDialog/P010_TDataProgressDialog.C
 rm TFile/P030_TCastorFile.C
-rm TFile/P050_TGFALFile.C
 rm TFile/P060_TChirpFile.C
 rm TFile/P070_TAlienFile.C
 rm TFile/P110_THDFSFile.C
@@ -1582,6 +1595,8 @@ fi
 %postun io -p /sbin/ldconfig
 %post io-dcache -p /sbin/ldconfig
 %postun io-dcache -p /sbin/ldconfig
+%post io-gfal -p /sbin/ldconfig
+%postun io-gfal -p /sbin/ldconfig
 %post io-rfio -p /sbin/ldconfig
 %postun io-rfio -p /sbin/ldconfig
 %post io-sql -p /sbin/ldconfig
@@ -2010,6 +2025,11 @@ fi
 %{_datadir}/%{name}/plugins/TFile/P040_TDCacheFile.C
 %{_datadir}/%{name}/plugins/TSystem/P020_TDCacheSystem.C
 
+%files io-gfal -f includelist-io-gfal
+%defattr(-,root,root,-)
+%{_libdir}/%{name}/libGFAL.*
+%{_datadir}/%{name}/plugins/TFile/P050_TGFALFile.C
+
 %files io-rfio -f includelist-io-rfio
 %defattr(-,root,root,-)
 %{_libdir}/%{name}/libRFIO.*
@@ -2290,6 +2310,10 @@ fi
 %{emacs_lispdir}/root/*.el
 
 %changelog
+* Fri Jun 29 2012 Mattias Ellert <mattias.ellert at fysast.uu.se> - 5.30.06-3
+- Backport fixes for using aclic with versioned libraries
+- New sub-package: root-io-gfal
+
 * Sat Mar 17 2012 Mattias Ellert <mattias.ellert at fysast.uu.se> - 5.30.06-2
 - Rebuild for xrootd 3.1.1
 


More information about the scm-commits mailing list