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.1 by muzaffar, Tue Jan 1 11:03:59 2008 UTC vs.
Revision 1.14 by andreasp, Fri Jan 30 10:32:10 2009 UTC

# Line 1 | Line 1
1 < ### RPM cms cms-common 1.0
1 > ### RPM cms cms-common 1.0
2   Source: cmsos
3   %prep
4   %build
# Line 7 | Line 7 | echo $SCRAM_ROOT
7  
8   mkdir -p %instroot/common %instroot/bin %{instroot}/%{cmsplatf}/etc/profile.d
9  
10 < # Do not create these common files if already exist
10 > # Do not create these common files if already exist
11   # This is to avoid different arch creating these files
12   if [ ! -f %instroot/common/.cms-common ]; then
13   install -m 755 %_sourcedir/cmsos %instroot/common/cmsos
# Line 77 | Line 77 | then
77   fi
78  
79   # aliases
80 < alias cmsenv='eval `scram runtime -sh`'
81 < alias cmsrel='scram project CMSSW'
80 > alias cmsenv='eval `scramv1 runtime -sh`'
81 > alias cmsrel='scramv1 project CMSSW'
82  
83   if [ -f $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh ]; then
84          . $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh
# Line 86 | Line 86 | fi
86  
87   if [ ! $CVSROOT ]
88   then
89 <    CVSROOT=:kserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
89 >    CVSROOT=:gserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
90      export CVSROOT
91   fi
92  
# Line 131 | Line 131 | if ( ! ${?CMS_PATH} ) then
131   endif
132  
133   # aliases
134 < alias cmsenv 'eval `scram runtime -csh`'
135 < alias cmsrel 'scram project CMSSW'
134 > alias cmsenv 'eval `scramv1 runtime -csh`'
135 > alias cmsrel 'scramv1 project CMSSW'
136  
137   if( -e $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh ) then
138          source $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh
139   endif
140  
141   if ( ! ${?CVSROOT}) then
142 <  setenv CVSROOT :kserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
142 >  setenv CVSROOT :gserver:cmscvs.cern.ch:/cvs_server/repositories/CMSSW
143   endif
144  
145   unset here
# Line 148 | Line 148 | EOF_CMSSET_DEFAULT_CSH
148   cat << \EOF_COMMON_SCRAM > %instroot/common/scram
149   #!/bin/sh
150   CMSARCH=`cmsarch`
151 < srbase=
152 < if [ "X$SCRAM_VERSION" = "X" ] ; then
153 <  sver=`cat  %{instroot}/$CMSARCH/etc/default-scramv1-version`
154 <  dir=`/bin/pwd`
155 <  while [ ! -d ${dir}/.SCRAM -a "$dir" != "/" ] ; do
156 <    dir=`dirname $dir`
157 <  done
158 <  if [ -f ${dir}/config/scram_version ] ; then
159 <    ver=`cat ${dir}/config/scram_version`
160 <    case $ver in
161 <      V0_* ) srbase=lcg/SCRAM/${ver};;
162 <      * ) srbase=lcg/SCRAMV1/${ver};;
163 <    esac
164 <    if [ -f %{instroot}/$CMSARCH/${srbase}/etc/profile.d/init.sh ] ; then
165 <      sver=$ver
166 <    fi
167 <  fi
168 < else
169 <   sver=$SCRAM_VERSION
151 > srbase=%{instroot}/$CMSARCH
152 > sver=$SCRAM_VERSION
153 > dir=`/bin/pwd`
154 > while [ ! -d ${dir}/.SCRAM -a "$dir" != "/" ] ; do
155 >  dir=`dirname $dir`
156 > done
157 > if [ -f ${dir}/config/scram_version ] ; then
158 >  sver=`cat ${dir}/config/scram_version`
159 > elif [ "X$sver" == "X" ] ; then
160 >  sver=`cat  ${srbase}/etc/default-scramv1-version`
161 > fi
162 > if [ "X$sver" = "XV1_0_3-p1" -a "X$CMSARCH" = "Xslc4_ia32_gcc345" ] ; then
163 >  sver=V1_0_3-p2
164 > fi
165 > scram_rel_series=`echo $sver | grep '^V[0-9]\+_[0-9]\+_[0-9]\+' | sed 's|^\(V[0-9]\+_[0-9]\+\)_.*|\1|'`
166 > if [ "X${scram_rel_series}" != "X" -a -f ${srbase}/etc/default-scram/${scram_rel_series} ] ; then
167 >  sver=`cat ${srbase}/etc/default-scram/${scram_rel_series}`
168   fi
169   scmd=scram
170 + srbase=%{instroot}/$CMSARCH/lcg/SCRAMV1
171   case $sver in
172 <  V0_* ) srbase=lcg/SCRAM/${sver}; scmd=scramv0;;
173 <  V1_0* ) srbase=lcg/SCRAMV1/${sver}; scmd=scramv1;;
174 <  * ) srbase=lcg/SCRAMV1/${sver};;
172 >  V0_*  ) srbase=%{instroot}/$CMSARCH/lcg/SCRAM; scmd=scramv0;;
173 >  V1_0* ) scmd=scramv1;;
174 >  *     ) ;;
175   esac
176 < source %{instroot}/$CMSARCH/${srbase}/etc/profile.d/init.sh
177 < # In the case we are on ia32 we prepend the linux32 command to the actual
178 < # scram command so that, no matter where the ia32 architecture is running
179 < # (i686 or x84_64) scram detects it as ia32.
176 > if [ ! -f ${srbase}/${sver}/etc/profile.d/init.sh ] ; then
177 >  echo "Unable to find SCRAM version $sver for $CMSARCH architecture."
178 >  exit 1
179 > fi
180 > source ${srbase}/${sver}/etc/profile.d/init.sh
181 > # In the case we are on linux ia32 we prepend the linux32 command to the
182 > # actual scram command so that, no matter where the ia32 architecture is
183 > # running (i686 or x84_64) scram detects it as ia32.
184   CMSPLAT=`echo $CMSARCH | cut -d_ -f 2`
185 < if [ "$CMSPLAT" = "ia32" ]
186 < then
187 <    USE_LINUX32=linux32
185 < else
186 <    USE_LINUX32=
185 > USE_LINUX32=
186 > if [ `uname` == Linux -a "$CMSPLAT" = "ia32" ] ; then
187 >  USE_LINUX32=linux32
188   fi
189 < $USE_LINUX32 %{instroot}/$CMSARCH/${srbase}/bin/${scmd} $@
189 > $USE_LINUX32 ${srbase}/${sver}/bin/${scmd} $@
190   EOF_COMMON_SCRAM
191  
192   chmod +x %{instroot}/common/scram
193   ln -sf scram %{instroot}/common/scramv1
194   ln -sf scram %{instroot}/common/scramv0
195 + ln -sf ../common/cmsarch %instroot/bin/cmsarch
196 + ln -sf ../common/cmsarch %instroot/bin/cmsos
197 + ln -sf ../common/scramv1 %instroot/bin/scramv1
198   touch %instroot/common/.cms-common
199   fi
200  
201   touch %instroot/%cmsplatf/etc/profile.d/dummy
198 ln -s ../common/cmsarch %instroot/bin/cmsarch
199 ln -s ../common/cmsarch %instroot/bin/cmsos
202  
203   %post
204   echo $RPM_INSTALL_PREFIX
# Line 215 | Line 217 | perl -p -i -e "s|%{instroot}|$RPM_INSTAL
217   %instroot/common/scram
218   %instroot/common/scramv1
219   %instroot/common/scramv0
220 + %instroot/common/.cms-common
221 + %instroot/bin/cmsos
222 + %instroot/bin/cmsarch
223 + %instroot/bin/scramv1
224   %instroot/%cmsplatf/etc/profile.d
225   %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines