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

Comparing COMP/CMSDIST/cms-env.spec (file contents):
Revision 1.22 by eulisse, Tue Jul 25 16:51:43 2006 UTC vs.
Revision 1.37 by ratnik, Thu Mar 8 21:06:28 2007 UTC

# Line 11 | Line 11 | mkdir -p %instroot/bin
11   install -m 755 %_sourcedir/cmsos %instroot/bin/cmsos
12   mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d
13  
14 < ### BASH code
15 <
16 < cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh
17 < export PATH=%instroot/bin:$PATH
18 < #export LD_LIBRARY_PATH=%instroot/lib:$LD_LIBRARY_PATH
19 < #export DYLD_FALLBACK_LIBRARY_PATH=%instroot/lib:$DYLD_FALLBACK_LIBRARY
20 <
21 < if [ ! $SCRAM_ARCH ]
14 > ### Detects the SCRAM_ARCH to be used.
15 > cat << \EOF_CMSARCH_SH >%instroot/bin/cmsarch
16 > #!/bin/sh
17 > osarch=`%instroot/bin/cmsos`
18 > compilerv=gcc323
19 > # We need to assume 1 compiler per platform.
20 > # There is no other way around this.
21 > if [ ! "$SCRAM_ARCH" ]
22   then
23 <    SCRAM_ARCH=$(cmsos)
24 <
25 <    # We need to assume 1 compiler per platform.
26 <    # There is no other way around this.
27 <    case $SCRAM_ARCH in
23 >    case $osarch in
24          slc3_ia32) compilerv=gcc323;;
25          slc3_amd64) compilerv=gcc344;;
26          slc4_ia32) compilerv=gcc345;;
27 <        slc4_amd64) compilerv=gcc345;;
28 <        osx104_ia32) compilerv=gcc400;;
27 >        slc4_amd64) compilerv=gcc345; osarch=slc4_ia32;;
28 >        osx104_ia32) compilerv=gcc401;;
29          osx104_pcc32) compilerv=gcc400;;
30      esac
31 <    SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
31 >    echo ${osarch}_${compilerv}
32 > else
33 >    echo $SCRAM_ARCH
34 > fi
35  
36 <    if [ $# -gt 0 ]
37 <    then
38 <        SCRAM_ARCH=$1
39 <    fi
36 > EOF_CMSARCH_SH
37 > chmod 755 %instroot/bin/cmsarch
38 >
39 > ### BASH code
40 >
41 > cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh
42 > export PATH=%instroot/bin:$PATH
43 >
44 > if [ ! $SCRAM_ARCH ]
45 > then
46 >    SCRAM_ARCH=`%instroot/bin/cmsarch`
47      export SCRAM_ARCH
48   fi
49  
# Line 58 | Line 64 | then
64      echo "Your shell is not able to find where cmsset_default.sh is. Either cd into the directory where it is or move to zsh"
65   fi
66  
67 < for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
67 > for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]sh'`
68   do
69          source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
70   done
# Line 67 | Line 73 | if [ ! $CMS_PATH ]
73   then
74      export CMS_PATH=$here
75   fi
76 +
77 + if [ -f $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh ]; then
78 +        . $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh
79 + fi
80   EOF_CMSSET_DEFAULT_SH
81  
82  
# Line 80 | Line 90 | else
90      setenv PATH %instroot/bin
91   endif
92  
83 #if (${?LD_LIBRARY_PATH}) then
84 #    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
85 #else
86 #    setenv LD_LIBRARY_PATH %instroot/lib
87 #endif
88
89 #if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
90 #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
91 #else
92 #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
93 #endif
94
95 set CMSOSCOMMAND=`which cmsos`
93   if ( ! ${?SCRAM_ARCH}) then
94 <    setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
98 <    set compilerv=gcc323
99 <    switch ( ${SCRAM_ARCH} )
100 <        case slc3_ia32:
101 <            setenv compilerv gcc323
102 <        breaksw
103 <        case slc3_amd64:
104 <            setenv compilerv gcc344
105 <        breaksw
106 <        case slc4_ia32:
107 <            setenv compilerv gcc345
108 <        breaksw
109 <        case slc4_amd64:
110 <            setenv compilerv gcc345
111 <        breaksw
112 <        case osx104_ia32:
113 <            setenv compilerv gcc400
114 <        breaksw
115 <        case osx104_pcc32:
116 <            setenv compilerv gcc400
117 <        breaksw
118 <    endsw
119 <
120 <    setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
121 <
122 <    if ( $# > 0 ) then
123 <        setenv SCRAM_ARCH $1
124 <    endif
94 >    setenv SCRAM_ARCH `sh -c %instroot/bin/cmsarch`
95   endif
96 +
97   set here=%instroot
98  
99   if ( ${?VO_CMS_SW_DIR} ) then
100 <    set here $VO_CMS_SW_DIR
100 >    set here=$VO_CMS_SW_DIR
101   else
102      # OSG
103      if ( ${?OSG_APP} ) then
104 <        set here $OSG_APP/cmssoft/cms
104 >        set here=$OSG_APP/cmssoft/cms
105      endif
106      # OSG                      
107   endif
# Line 139 | Line 110 | if ( ! -e $here/cmsset_default.csh ) the
110      echo "Please cd into the directory where cmsset_default.csh is."
111   endif
112  
113 < foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
113 > foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]csh'` )
114          source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
115   end
116   if ( ! ${?CMS_PATH} ) then
117      setenv CMS_PATH $here
118   endif
119 +
120 + if( -e $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh ) then
121 +        source $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh
122 + endif
123   unset here
149 unset CMSOSCOMMAND
150 unset compilerv
124   EOF_CMSSET_DEFAULT_CSH
125 <
125 > touch %instroot/%cmsplatf/etc/profile.d/dummy
126   %pre
127   [ -f $RPM_INSTALL_PREFIX/cmsset_default.sh ] && cp $RPM_INSTALL_PREFIX/cmsset_default.sh $RPM_INSTALL_PREFIX/cmsset_default.sh.old`date +%Y%m%d`
128   [ -f $RPM_INSTALL_PREFIX/cmsset_default.csh ] && cp $RPM_INSTALL_PREFIX/cmsset_default.csh $RPM_INSTALL_PREFIX/cmsset_default.csh.old`date +%Y%m%d`
# Line 159 | Line 132 | echo $RPM_INSTALL_PREFIX
132   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
133   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.csh
134   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsos
135 + perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsarch
136   %files
137   %i
138   %instroot/cmsset_default.sh
139   %instroot/cmsset_default.csh
140   %instroot/bin/cmsos
141 + %instroot/bin/cmsarch
142   %instroot/%cmsplatf/etc/profile.d
143   %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines