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.12 by eulisse, Fri Jul 14 17:14:59 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
# Line 28 | Line 30 | esac
30   SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
31   export SCRAM_ARCH
32  
33 < here=`dirname $0`
33 > if [ "$VO_CMS_SW_DIR" != ""  ]
34 > then
35 >    here=$VO_CMS_SW_DIR
36 > else
37 >    here=`dirname $0`
38 >
39 >    if [ "$OSG_APP" != "" ]
40 >    then
41 >        here=$OSG_APP/cmssoft/cms
42 >    fi
43 > fi
44 >
45 > [ -d $here/${SCRAM_ARCH}/etc/profile.d ] || {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".; exit 1}
46 >
47   for pkg in `ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
48   do
49          source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
50   done
51 <
51 > export CMS_PATH=$here
52   EOF_CMSSET_DEFAULT_SH
53  
54 +
55 + ### CSH code
56 +
57   cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
58  
59   if (${?PATH}) then
# Line 79 | Line 97 | if ( ${?VO_CMS_SW_DIR} ) then
97      setenv here $VO_CMS_SW_DIR
98   else
99      setenv here .
100 +    # OSG
101 +    if ( ${?OSG_APP} ) then
102 +        setenv here $OSG_APP/cmssoft/cms
103 +    endif
104 +    # OSG                      
105   endif
106  
107   if ( ! -e $here/cmsset_default.csh ) then
# Line 88 | Line 111 | endif
111   foreach pkg ( `ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
112          source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
113   end
114 <
114 > setenv CMS_PATH $here
115   EOF_CMSSET_DEFAULT_CSH
116  
117 + %pre
118 + [ -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`
119 + [ -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`
120 + [ -d $RPM_INSTALL_PREFIX/bin ] && cp -r $RPM_INSTALL_PREFIX/bin $RPM_INSTALL_PREFIX/bin.old`date +%Y%m%d`
121   %post
122   echo $RPM_INSTALL_PREFIX
123   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