ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-common.spec
(Generate patch)

Comparing COMP/CMSDIST/cms-common.spec (file contents):
Revision 1.9 by muzaffar, Wed Feb 6 16:18:45 2008 UTC vs.
Revision 1.20 by elmer, Tue Dec 1 11:09:54 2009 UTC

# Line 1 | Line 1
1 < ### RPM cms cms-common 1.0
1 > ### RPM cms cms-common 1.0
2 > ## REVISION 1054
3 > ## NOCOMPILER
4 > %define closingbrace )
5 > %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo false;; esac)
6   Source: cmsos
7   %prep
8   %build
9   echo $SCRAM_ROOT
10   %install
11  
12 < mkdir -p %instroot/common %instroot/bin %{instroot}/%{cmsplatf}/etc/profile.d
12 > mkdir -p %instroot/common %instroot/bin %instroot/%{cmsplatf}/etc/profile.d
13  
14   # Do not create these common files if already exist
15   # This is to avoid different arch creating these files
16   if [ ! -f %instroot/common/.cms-common ]; then
17   install -m 755 %_sourcedir/cmsos %instroot/common/cmsos
18   ### Detects the SCRAM_ARCH to be used.
19 + %if "%online" != "true"
20   cat << \EOF_CMSARCH_SH >%instroot/common/cmsarch
21   #!/bin/sh
22   osarch=`%instroot/common/cmsos`
23 < compilerv=gcc323
23 > compilerv=gcc434
24   # We need to assume 1 compiler per platform.
25   # There is no other way around this.
26   if [ ! "$SCRAM_ARCH" ]
27   then
28      case $osarch in
24        slc3_ia32) compilerv=gcc323;;
25        slc3_amd64) compilerv=gcc344;;
26        slc4_ia32) compilerv=gcc345;;
27        slc4_amd64) compilerv=gcc345; osarch=slc4_ia32;;
29          osx104_ia32) compilerv=gcc401;;
30          osx104_ppc32) compilerv=gcc400;;
31 +        osx105_*) compilerv=gcc401;;
32 +        slc5_*) compilerv=gcc434; osarch=slc5_ia32;;
33 +        slc4_*) compilerv=gcc345; osarch=slc4_ia32;;
34 +        *) compilerv=gcc434; osarch=slc5_ia32;;
35      esac
36      echo ${osarch}_${compilerv}
37   else
# Line 34 | Line 39 | else
39   fi
40  
41   EOF_CMSARCH_SH
42 + %else
43 + cat << \EOF_CMSARCH_SH >%instroot/common/cmsarch
44 + #!/bin/sh
45 + if [ ! "$SCRAM_ARCH" ] ; then
46 +    echo %cmsplatf
47 + else
48 +    echo $SCRAM_ARCH
49 + fi
50 +
51 + EOF_CMSARCH_SH
52 + %endif
53   chmod 755 %instroot/common/cmsarch
54  
55   ### BASH code
# Line 86 | Line 102 | fi
102  
103   if [ ! $CVSROOT ]
104   then
105 <    CVSROOT=:kserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
105 >    CVSROOT=:gserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
106      export CVSROOT
107   fi
108  
# Line 139 | Line 155 | if( -e $CMS_PATH/SITECONF/local/JobConfi
155   endif
156  
157   if ( ! ${?CVSROOT}) then
158 <  setenv CVSROOT :kserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
158 >  setenv CVSROOT :gserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
159   endif
160  
161   unset here
# Line 148 | Line 164 | EOF_CMSSET_DEFAULT_CSH
164   cat << \EOF_COMMON_SCRAM > %instroot/common/scram
165   #!/bin/sh
166   CMSARCH=`cmsarch`
167 < srbase=
168 < if [ "X$SCRAM_VERSION" = "X" ] ; then
169 <  sver=`cat  %{instroot}/$CMSARCH/etc/default-scramv1-version`
170 <  dir=`/bin/pwd`
171 <  while [ ! -d ${dir}/.SCRAM -a "$dir" != "/" ] ; do
172 <    dir=`dirname $dir`
173 <  done
174 <  if [ -f ${dir}/config/scram_version ] ; then
175 <    ver=`cat ${dir}/config/scram_version`
176 <    if [ "X$ver" = "XV1_0_3-p1" ] ; then
177 <      if [ "X$CMSARCH" = "Xslc4_ia32_gcc345" ] ; then
178 <        ver=V1_0_3-p2
179 <      fi
180 <    fi
181 <    case $ver in
182 <      V0_* ) srbase=lcg/SCRAM/${ver};;
183 <      * ) srbase=lcg/SCRAMV1/${ver};;
168 <    esac
169 <    if [ -f %{instroot}/$CMSARCH/${srbase}/etc/profile.d/init.sh ] ; then
170 <      sver=$ver
171 <    fi
172 <  fi
173 < else
174 <   if [ "X$SCRAM_VERSION" = "XV1_0_3-p1" ] ; then
175 <     if [ "X$CMSARCH" = "Xslc4_ia32_gcc345" ] ; then
176 <       SCRAM_VERSION=V1_0_3-p2
177 <     fi
178 <   fi
179 <   sver=$SCRAM_VERSION
167 > srbase=%{instroot}/$CMSARCH
168 > sver=$SCRAM_VERSION
169 > dir=`/bin/pwd`
170 > while [ ! -d ${dir}/.SCRAM ] && [ "$dir" != "/" ] ; do
171 >  dir=`dirname $dir`
172 > done
173 > if [ -f ${dir}/config/scram_version ] ; then
174 >  sver=`cat ${dir}/config/scram_version`
175 > elif [ "X$sver" = "X" ] ; then
176 >  sver=`cat  ${srbase}/etc/default-scramv1-version`
177 > fi
178 > if [ "X$sver" = "XV1_0_3-p1" ] && [ "X$CMSARCH" = "Xslc4_ia32_gcc345" ] ; then
179 >  sver=V1_0_3-p2
180 > fi
181 > scram_rel_series=`echo $sver | grep '^V[0-9]\+_[0-9]\+_[0-9]\+' | sed 's|^\(V[0-9]\+_[0-9]\+\)_.*|\1|'`
182 > if [ "X${scram_rel_series}" != "X" ] && [ -f ${srbase}/etc/default-scram/${scram_rel_series} ] ; then
183 >  sver=`cat ${srbase}/etc/default-scram/${scram_rel_series}`
184   fi
185   scmd=scram
186 + srbase=%{instroot}/$CMSARCH/lcg/SCRAMV1
187   case $sver in
188 <  V0_* ) srbase=lcg/SCRAM/${sver}; scmd=scramv0;;
189 <  V1_0* ) srbase=lcg/SCRAMV1/${sver}; scmd=scramv1;;
190 <  * ) srbase=lcg/SCRAMV1/${sver};;
188 >  V0_*  ) srbase=%{instroot}/$CMSARCH/lcg/SCRAM; scmd=scramv0;;
189 >  V1_0* ) scmd=scramv1;;
190 >  *     ) ;;
191   esac
192 < if [ ! -f %{instroot}/$CMSARCH/${srbase}/etc/profile.d/init.sh ] ; then
192 > if [ ! -f ${srbase}/${sver}/etc/profile.d/init.sh ] ; then
193    echo "Unable to find SCRAM version $sver for $CMSARCH architecture."
194    exit 1
195   fi
196 < source %{instroot}/$CMSARCH/${srbase}/etc/profile.d/init.sh
196 > . ${srbase}/${sver}/etc/profile.d/init.sh
197   # In the case we are on linux ia32 we prepend the linux32 command to the
198   # actual scram command so that, no matter where the ia32 architecture is
199   # running (i686 or x84_64) scram detects it as ia32.
200   CMSPLAT=`echo $CMSARCH | cut -d_ -f 2`
201   USE_LINUX32=
202 < if [ `uname` == Linux ]; then
203 <  if [ "$CMSPLAT" = "ia32" ]
199 <  then
200 <      USE_LINUX32=linux32
201 <  fi
202 > if [ `uname` = "Linux" ] && [ "$CMSPLAT" = "ia32" ] ; then
203 >  USE_LINUX32=linux32
204   fi
205 < $USE_LINUX32 %{instroot}/$CMSARCH/${srbase}/bin/${scmd} $@
205 > $USE_LINUX32 ${srbase}/${sver}/bin/${scmd} $@
206   EOF_COMMON_SCRAM
207  
208   chmod +x %{instroot}/common/scram

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines