diff --git a/cernlib-script.patch b/cernlib-script.patch index 78ab67e..f4530e1 100644 --- a/cernlib-script.patch +++ b/cernlib-script.patch @@ -1,5 +1,8 @@ +diff -up cernlib-2006/2006/src/pawlib/paw/programs/paw.script cernlib-2006/2006/src/pawlib/paw/programs/paw +diff -up cernlib-2006/2006/src/graflib/dzdoc/dzedit/dzedit.script cernlib-2006/2006/src/graflib/dzdoc/dzedit/dzedit +diff -up cernlib-2006/2006/src/scripts/cernlib.script cernlib-2006/2006/src/scripts/cernlib --- cernlib-2006/2006/src/scripts/cernlib.script 2006-12-07 14:26:55.000000000 +0100 -+++ cernlib-2006/2006/src/scripts/cernlib 2007-05-23 09:15:43.000000000 +0200 ++++ cernlib-2006/2006/src/scripts/cernlib 2007-07-25 21:00:54.000000000 +0200 @@ -16,12 +16,17 @@ [ -z "$CERN_LEVEL" ] && gver="pro" || gver="$CERN_LEVEL" @@ -86,7 +89,7 @@ if [ -n "$Gsys" ] ; then case $Msys in -@@ -110,10 +142,8 @@ +@@ -110,10 +142,12 @@ SYSGGL="-lfgl -lgl_s -lm -lbsd" ; SYSGMOTIF="-lXm -lXt -lX11 -lPW" ;; @@ -96,10 +99,14 @@ - [ -d /usr/X11R6/lib ] && SYSGMOTIF="-L/usr/X11R6/lib -lXm -lXt -lXp -lXext -lX11" + Linux) SYSGX11="-lX11" + SYSGMOTIF="-lXm -lXt -lXp -lXext -lX11" ++ [ -d /usr/X11R6/lib ] && SYSGX11="-L/usr/X11R6/lib $SYSGX11" ++ [ -d /usr/X11R6/lib64 ] && SYSGX11="-L/usr/X11R6/lib64 $SYSGX11" ++ [ -d /usr/X11R6/lib ] && SYSGMOTIF="-L/usr/X11R6/lib $SYSGMOTIF" ++ [ -d /usr/X11R6/lib64 ] && SYSGMOTIF="-L/usr/X11R6/lib64 $SYSGMOTIF" [ `uname -m` = ppc ] && SYSGMOTIF="$SYSGMOTIF -lSM -lICE -lXpm" ;; Darwin) [ -d /usr/X11R6/lib ] && SYSGX11="-L/usr/X11R6/lib -lX11" -@@ -150,7 +180,11 @@ +@@ -150,7 +184,11 @@ SYSGMOTIF="-L/usr/lib/X11 -lXm -lXt -lX11 -lm" ;; esac @@ -111,7 +118,7 @@ case $Gsys in X11) CERNLIB="$CERNLIB $SYSGX11" ;; Motif) [ -z "$SYSGMOTIF" ] && SYSGMOTIF="-lXm -lXt $SYSGX11" ; -@@ -212,6 +246,9 @@ +@@ -212,6 +250,9 @@ if [ "$Msys" = "Linux" ] ; then CERNLIB="$CERNLIB -lnsl -lcrypt -ldl" fi @@ -121,3 +128,4 @@ if [ "$Msys" = "Darwin" ] ; then CERNLIB1="$CERNLIB -L/usr/local/lib/system -lcompat -ldl" fi +diff -up cernlib-2006/2006/src/patchy/yexpand.script cernlib-2006/2006/src/patchy/yexpand diff --git a/cernlib.spec b/cernlib.spec index a3011f9..3a49eb1 100644 --- a/cernlib.spec +++ b/cernlib.spec @@ -1,17 +1,59 @@ +%if 0%{?fedora} %if "%fedora" > "6" %bcond_without gfortran %else %bcond_with gfortran %endif +%if "%fedora" <= "3" +%define old_lapack_name 1 +%endif +%if "%fedora" <= "4" +%define monolithic_X 1 +%endif +%if "%fedora" <= "6" +%define g77_default_compiler 1 +%endif +%endif + +%if 0%{?rhel} +%if "%rhel" <= "4" +# set to 1 if the optflags are compatible with what g77 wants. This should +# be true for the releases that use gcc < 4. For newer releases the +# optflags are for gfortran and should be filtered out if g77 is used +%define optflags_for_g77 1 +%define old_lapack_name 1 +%define monolithic_X 1 +# this is set to 1 if g77 has to be used for the cernlib package without +# suffix. +%define g77_default_compiler 1 +# these are not defined, they need to be defined here +%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} +%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} +%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} +%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} +%endif +%if "%rhel" > "4" +%bcond_without gfortran +%else +%bcond_with gfortran +%endif +%endif + # compiler is used to disambiguate package names and executables %if %{with gfortran} # allows to use a suffix for the library different from the suffix # for the utilities # %%define utils_suffix -gfortran +%if 0%{?g77_default_compiler} +%define compiler -gfortran +%define utils_suffix -gfortran +%endif %else +%if ! 0%{?g77_default_compiler} %define compiler -g77 %define utils_suffix -g77 +%endif # no compat prefix, the utilities compiled with gfortran are non functionnal # see Bug 241416 #%%define compat compat- @@ -23,7 +65,7 @@ Name: %{?compat}cernlib%{?compiler} Version: 2006 -Release: 15%{?dist} +Release: 16%{?dist} Summary: General purpose CERN library and associated binaries Group: Development/Libraries # As explained in the cernlib on debian FAQ, cfortran can be considered LGPL. @@ -35,27 +77,23 @@ URL: http://cernlib.web.cern.ch/cernlib/ #BuildRequires: gcc-g77 #Requires: libxorg-x11-devel lesstif-devel libblas3-devel liblapack3-devel # fedora core -%if "%fedora" > "5" -BuildRequires: lesstif-devel -%else -BuildRequires: openmotif-devel -%endif -%if "%fedora" <= "3" +%if 0%{?old_lapack_name} BuildRequires: lapack blas %else BuildRequires: lapack-devel blas-devel %endif -%if "%fedora" <= "4" +%if 0%{?monolithic_X} BuildRequires: xorg-x11-devel %else -BuildRequires: imake +BuildRequires: imake libXaw-devel # workaround #173530 BuildRequires: libXau-devel %endif -BuildRequires: xbae-devel libXaw-devel +# indirectly requires lesstif or openmotif and X libs +BuildRequires: xbae-devel # for patchy build scripts BuildRequires: tcsh @@ -335,16 +373,22 @@ scripts from the utils subpackage. %package devel Summary: General purpose CERN library development package -%if "%fedora" <= "3" + +%if 0%{?old_lapack_name} Requires: lapack blas %else Requires: lapack-devel blas-devel %endif -Requires: xbae-devel libXaw-devel -%if "%fedora" > "4" +# Motif and X devel libs are indirectly required through xbae +Requires: xbae-devel + +%if 0%{?monolithic_X} +Requires: xorg-x11-devel +%else # workaround #173530 Requires: libXau-devel +Requires: libXaw-devel %endif Requires: %{name} = %{version}-%{release} Group: Development/Libraries @@ -785,16 +829,17 @@ mv src/scripts/cernlib src/scripts/cernlib-static # it is found by g77/gfortran if needed. # don't add %{_libdir} to the directory searched in for libraries, # since it is already in the list. -# also remove use of /usr/X11R6/lib*. sed -e 's:@PREFIX@:%{_prefix}:g' \ -e 's:@CERN@:%{_libdir}/cernlib:g' \ -e 's:@VERSION@:%{verdir}:g' \ -e 's:@LIBPREFIX@::g' \ -e 's/-lg2c//' \ - -e 's/-L\$XDIR\(64\)\? //' \ - -e 's:-L/usr/X11R6/lib\(64\)\? ::' \ - -e 's:/usr/X11R6/lib\(64\)\? ::g' \ ../cernlib.in > src/scripts/cernlib +# to remove reference to monolithic X directories +# -e 's/-L\$XDIR\(64\)\? //' \ +# -e 's:-L/usr/X11R6/lib\(64\)\? ::' \ +# -e 's:/usr/X11R6/lib\(64\)\? ::g' \ +# chmod 0755 src/scripts/cernlib touch -r ../cernlib.in src/scripts/cernlib @@ -806,8 +851,12 @@ touch -r ../cernlib.in src/scripts/cernlib FC_OPTFLAGS="%{optflags}" FC_COMPILER=gfortran %else +%if 0%{?optflags_for_g77} +FC_OPTFLAGS="%{optflags}" +%else # optflags are different for g77, so we remove problematic flags FC_OPTFLAGS=`echo "%optflags" | sed -e 's/-mtune=[^ ]\+//' -e 's/-fstack-protector//' -e 's/--param=ssp-buffer-size=[^ ]\+//'` +%endif FC_COMPILER=g77 %endif @@ -843,7 +892,8 @@ $CVSCOSRC/config/imake_boot # Install kuipc and the scripts (cernlib, paw and gxint) in $CERN_ROOT/bin -make %{?_smp_mflags} bin/kuipc +# %{?_smp_mflags} breaks the builds +make bin/kuipc make scripts/Makefile cd scripts make install.bin @@ -851,14 +901,13 @@ make install.bin # Install the libraries cd $CERN_ROOT/build -# %{?_smp_mflags} breaks the build make make install.shlib chmod a+x ../shlib/*.so.* # Build dynamic paw cd $CERN_ROOT/build/pawlib -make %{?_smp_mflags} install.bin +make install.bin cd $CERN_ROOT/ mv bin/pawX11 bin/pawX11.dynamic mv bin/paw++ bin/paw++.dynamic @@ -871,10 +920,10 @@ $FC_COMPILER $FC_OPTFLAGS $CERN_ROOT/build/pawlib/paw/programs/0pamainm.o \ # Build packlib cd $CERN_ROOT/build/packlib -make %{?_smp_mflags} install.bin +make install.bin cd $CERN_ROOT/build/graflib -make %{?_smp_mflags} install.bin +make install.bin # bootstrap npatchy mkdir -p $CERN_ROOT/build/p5boot @@ -1092,6 +1141,7 @@ touch --no-create %{_datadir}/icons/hicolor || : %{_datadir}/aclocal/cernlib.m4 %files static +%defattr(-,root,root,-) %{_libdir}/cernlib/%{verdir}/lib/*.a %files utils @@ -1191,6 +1241,11 @@ touch --no-create %{_datadir}/icons/hicolor || : %changelog +* Wed Jul 25 2007 Patrice Dumas 2006-16 +- add rhel conditionals +- bring back support for monolithic X +- don't build anything in parallel + * Sun May 27 2007 Patrice Dumas 2006-15 - split out static libraries, as per FESCO decision