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.18 by eulisse, Wed Jul 19 12:12:32 2006 UTC vs.
Revision 1.41 by elmer, Tue May 1 11:31:21 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 + ### 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 +    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;;
28 +        osx104_ia32) compilerv=gcc401;;
29 +        osx104_ppc32) compilerv=gcc400;;
30 +    esac
31 +    echo ${osarch}_${compilerv}
32 + else
33 +    echo $SCRAM_ARCH
34 + fi
35 +
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
18 export LD_LIBRARY_PATH=%instroot/lib:$LD_LIBRARY_PATH
19 export DYLD_FALLBACK_LIBRARY_PATH=%instroot/lib:$DYLD_FALLBACK_LIBRARY
20 SCRAM_ARCH=$(cmsos)
43  
44 < # We need to assume 1 compiler per platform.
23 < # There is no other way around this.
24 < case $SCRAM_ARCH in
25 <    slc3_ia32) compilerv=gcc323;;
26 <    slc3_amd64) compilerv=gcc344;;
27 <    slc4_ia32) compilerv=gcc345;;
28 <    slc4_amd64) compilerv=gcc345;;
29 <    osx104_ia32) compilerv=gcc400;;
30 <    osx104_pcc32) compilerv=gcc400;;
31 < esac
32 < SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
33 <
34 < if [ $# -gt 0 ]
44 > if [ ! $SCRAM_ARCH ]
45   then
46 <    SCRAM_ARCH=$1
46 >    SCRAM_ARCH=`%instroot/bin/cmsarch`
47 >    export SCRAM_ARCH
48   fi
49  
39 export SCRAM_ARCH
40
50   here=%{instroot}
51  
52   if [ "$VO_CMS_SW_DIR" != ""  ]
# Line 52 | Line 61 | fi
61  
62   if [ ! -d $here/${SCRAM_ARCH}/etc/profile.d ]
63   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 <    exit 1
64 >    echo "Your shell is not able to find where cmsset_default.sh is located."
65 >    echo "Either you have not set VO_CMS_SW_DIR or OSG_APP correctly"
66 >    echo "or SCRAM_ARCH is not set to a valid architecture."
67   fi
68  
69 < for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
69 > for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]sh'`
70   do
71          source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
72   done
73 < export CMS_PATH=$here
73 >
74 > if [ ! $CMS_PATH ]
75 > then
76 >    export CMS_PATH=$here
77 > fi
78 >
79 > if [ -f $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh ]; then
80 >        . $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh
81 > fi
82   EOF_CMSSET_DEFAULT_SH
83  
84  
# Line 74 | Line 92 | else
92      setenv PATH %instroot/bin
93   endif
94  
95 < if (${?LD_LIBRARY_PATH}) then
96 <    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
79 < else
80 <    setenv LD_LIBRARY_PATH %instroot/lib
81 < endif
82 <
83 < if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
84 <    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
85 < else
86 <    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
87 < endif
88 <
89 < setenv CMSOSCOMMAND `which cmsos`
90 < setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
91 < setenv compilerv gcc323
92 < switch ( ${SCRAM_ARCH} )
93 <    case slc3_ia32:
94 <        setenv compilerv gcc323
95 <    breaksw
96 <    case slc3_amd64:
97 <        setenv compilerv gcc344
98 <    breaksw
99 <    case slc4_ia32:
100 <         setenv compilerv gcc345
101 <    breaksw
102 <    case slc4_amd64:
103 <        setenv compilerv gcc345
104 <    breaksw
105 <    case osx104_ia32:
106 <        setenv compilerv gcc400
107 <    breaksw
108 <    case osx104_pcc32:
109 <        setenv compilerv gcc400
110 <    breaksw
111 < endsw
112 <
113 < setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
114 <
115 < if ( $# > 0 ) then
116 <    setenv SCRAM_ARCH $1
95 > if ( ! ${?SCRAM_ARCH}) then
96 >    setenv SCRAM_ARCH `sh -c %instroot/bin/cmsarch`
97   endif
98  
99 < setenv here %instroot
99 > set here=%instroot
100  
101   if ( ${?VO_CMS_SW_DIR} ) then
102 <    setenv here $VO_CMS_SW_DIR
102 >    set here=$VO_CMS_SW_DIR
103   else
104      # OSG
105      if ( ${?OSG_APP} ) then
106 <        setenv here $OSG_APP/cmssoft/cms
106 >        set here=$OSG_APP/cmssoft/cms
107      endif
108      # OSG                      
109   endif
# Line 132 | Line 112 | if ( ! -e $here/cmsset_default.csh ) the
112      echo "Please cd into the directory where cmsset_default.csh is."
113   endif
114  
115 < foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
115 > foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]csh'` )
116          source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
117   end
118 < setenv CMS_PATH $here
119 < EOF_CMSSET_DEFAULT_CSH
118 > if ( ! ${?CMS_PATH} ) then
119 >    setenv CMS_PATH $here
120 > endif
121  
122 + if( -e $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh ) then
123 +        source $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh
124 + endif
125 + unset here
126 + EOF_CMSSET_DEFAULT_CSH
127 + touch %instroot/%cmsplatf/etc/profile.d/dummy
128   %pre
129   [ -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`
130   [ -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 147 | Line 134 | echo $RPM_INSTALL_PREFIX
134   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
135   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.csh
136   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsos
137 + perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsarch
138   %files
139   %i
140   %instroot/cmsset_default.sh
141   %instroot/cmsset_default.csh
142   %instroot/bin/cmsos
143 + %instroot/bin/cmsarch
144   %instroot/%cmsplatf/etc/profile.d
145   %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines