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.7 by eulisse, Wed Jun 21 14:45:02 2006 UTC vs.
Revision 1.26 by eulisse, Fri Jul 28 09:37:04 2006 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 < SCRAM_ARCH=$(cmsos)
21 <
22 < # 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=gcc345;;
27 <    osx104_ia32) compilerv=gcc400;;
28 <    osx104_pcc32) compilerv=gcc400;;
29 < esac
30 < SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
31 < export SCRAM_ARCH
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 ]
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
28 >        slc3_ia32) compilerv=gcc323;;
29 >        slc3_amd64) compilerv=gcc344;;
30 >        slc4_ia32) compilerv=gcc345;;
31 >        slc4_amd64) compilerv=gcc345;;
32 >        osx104_ia32) compilerv=gcc400;;
33 >        osx104_pcc32) compilerv=gcc400;;
34 >    esac
35 >    SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
36 >    export SCRAM_ARCH
37 > fi
38 >
39 > here=%{instroot}
40 >
41 > if [ "$VO_CMS_SW_DIR" != ""  ]
42 > then
43 >    here=$VO_CMS_SW_DIR
44 > else
45 >    if [ "$OSG_APP" != "" ]
46 >    then
47 >        here=$OSG_APP/cmssoft/cms
48 >    fi
49 > fi
50 >
51 > if [ ! -d $here/${SCRAM_ARCH}/etc/profile.d ]
52 > then
53 >    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"
54 > fi
55  
56 < here=`dirname $0`
32 < for pkg in `ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
56 > for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
57   do
58          source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
59   done
60  
61 + if [ ! $CMS_PATH ]
62 + then
63 +    export CMS_PATH=$here
64 + fi
65   EOF_CMSSET_DEFAULT_SH
66  
67 +
68 + ### CSH code
69 +
70   cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
71  
72   if (${?PATH}) then
# Line 44 | Line 75 | else
75      setenv PATH %instroot/bin
76   endif
77  
78 < if (${?LD_LIBRARY_PATH}) then
79 <    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
80 < else
81 <    setenv LD_LIBRARY_PATH %instroot/lib
82 < endif
78 > #if (${?LD_LIBRARY_PATH}) then
79 > #    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
80 > #else
81 > #    setenv LD_LIBRARY_PATH %instroot/lib
82 > #endif
83 >
84 > #if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
85 > #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
86 > #else
87 > #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
88 > #endif
89 >
90 > set CMSOSCOMMAND=`which cmsos`
91 > if ( ! ${?SCRAM_ARCH}) then
92 >    setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
93 >    set compilerv=gcc323
94 >    switch ( ${SCRAM_ARCH} )
95 >        case slc3_ia32:
96 >            set compilerv=gcc323
97 >        breaksw
98 >        case slc3_amd64:
99 >            set compilerv=gcc344
100 >        breaksw
101 >        case slc4_ia32:
102 >            set compilerv=gcc345
103 >        breaksw
104 >        case slc4_amd64:
105 >            set compilerv=gcc345
106 >        breaksw
107 >        case osx104_ia32:
108 >            set compilerv=gcc400
109 >        breaksw
110 >        case osx104_pcc32:
111 >            set compilerv=gcc400
112 >        breaksw
113 >    endsw
114  
115 < if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
54 <    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
55 < else
56 <    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
115 >    setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
116   endif
117  
118 < setenv CMSOSCOMMAND `which cmsos`
60 < setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
61 < setenv compilerv gcc323
62 < switch ( ${SCRAM_ARCH} )
63 <    case slc3_ia32:
64 <        setenv compilerv gcc323
65 <    breaksw
66 <    case slc3_amd64:
67 <        setenv compilerv gcc345
68 <    breaksw
69 <    case osx104_ia32:
70 <        setenv compilerv gcc400
71 <    breaksw
72 <    case osx104_pcc32:
73 <        setenv compilerv gcc400
74 <    breaksw
75 < endsw
118 > set here=%instroot
119  
77 setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
120   if ( ${?VO_CMS_SW_DIR} ) then
121 <    setenv here $VO_CMS_SW_DIR
121 >    set here=$VO_CMS_SW_DIR
122   else
123 <    setenv here .
123 >    # OSG
124 >    if ( ${?OSG_APP} ) then
125 >        set here=$OSG_APP/cmssoft/cms
126 >    endif
127 >    # OSG                      
128   endif
129  
130   if ( ! -e $here/cmsset_default.csh ) then
131      echo "Please cd into the directory where cmsset_default.csh is."
132   endif
133  
134 < foreach pkg ( `ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
134 > foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
135          source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
136   end
137 <
137 > if ( ! ${?CMS_PATH} ) then
138 >    setenv CMS_PATH $here
139 > endif
140 > unset here
141 > unset CMSOSCOMMAND
142 > unset compilerv
143   EOF_CMSSET_DEFAULT_CSH
144  
145 + %pre
146 + [ -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`
147 + [ -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`
148 + [ -d $RPM_INSTALL_PREFIX/bin ] && cp -r $RPM_INSTALL_PREFIX/bin $RPM_INSTALL_PREFIX/bin.old`date +%Y%m%d`
149   %post
150   echo $RPM_INSTALL_PREFIX
151   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines