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

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


commit 43094d8676818b2725474128dd5c18e2d404a14c
Author: Mattias Ellert <mattias.ellert at fysast.uu.se>
Date:   Fri Jun 29 06:20:19 2012 +0200

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

 root-aclic-versioned-libs.patch |   86 +++++++++++++++++++++++++++++++++++++++
 root.spec                       |   32 +++++++++++++--
 2 files changed, 114 insertions(+), 4 deletions(-)
---
diff --git a/root-aclic-versioned-libs.patch b/root-aclic-versioned-libs.patch
new file mode 100644
index 0000000..acf9650
--- /dev/null
+++ b/root-aclic-versioned-libs.patch
@@ -0,0 +1,86 @@
+diff -ur root-5.32.03.orig/core/unix/src/TUnixSystem.cxx root-5.32.03/core/unix/src/TUnixSystem.cxx
+--- root-5.32.03.orig/core/unix/src/TUnixSystem.cxx	2012-05-09 12:59:38.000000000 +0200
++++ root-5.32.03/core/unix/src/TUnixSystem.cxx	2012-06-28 19:25:22.486639614 +0200
+@@ -453,6 +453,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
+@@ -467,7 +470,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"))
+@@ -489,9 +493,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
+@@ -2849,12 +2867,15 @@
+       delete [] exe;
+       exe = longerexe;
+    }
++   TRegexp sovers = "\\.so\\.[0-9]+";
+ #else
+    const char *cLDD="ldd";
+ #if defined(R__AIX)
+    const char *cSOEXT=".a";
++   TRegexp sovers = "\\.a\\.[0-9]+";
+ #else
+    const char *cSOEXT=".so";
++   TRegexp sovers = "\\.so\\.[0-9]+";
+ #endif
+ #endif
+    FILE *p = OpenPipe(TString::Format("%s %s", cLDD, exe), "r");
+@@ -2874,10 +2895,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 44d4ab2..f8d587d 100644
--- a/root.spec
+++ b/root.spec
@@ -28,7 +28,7 @@
 Name:		root
 Version:	5.32.03
 %global libversion %(cut -d. -f 1-2 <<< %{version})
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Numerical data analysis framework
 
 Group:		Applications/Engineering
@@ -60,6 +60,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
@@ -122,6 +124,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
@@ -565,6 +569,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
@@ -1036,6 +1047,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 \
@@ -1143,6 +1155,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 \
@@ -1179,8 +1194,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} \
@@ -1196,7 +1211,6 @@ unset QTINC
 	    --disable-castor \
 	    --disable-chirp \
 	    --disable-cling \
-	    --disable-gfal \
 	    --disable-glite \
 	    --disable-hdfs \
 	    --disable-monalisa \
@@ -1349,7 +1363,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
@@ -1584,6 +1597,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
@@ -2013,6 +2028,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.*
@@ -2295,6 +2315,10 @@ fi
 %{emacs_lispdir}/root/*.el
 
 %changelog
+* Thu Jun 28 2012 Mattias Ellert <mattias.ellert at fysast.uu.se> - 5.32.03-2
+- Backport fixes for using aclic with versioned libraries
+- New sub-package: root-io-gfal
+
 * Thu May 17 2012 Mattias Ellert <mattias.ellert at fysast.uu.se> - 5.32.03-1
 - Update to 5.32.03
 


More information about the scm-commits mailing list