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.3 by eulisse, Thu Jun 15 23:32:15 2006 UTC vs.
Revision 1.11 by eulisse, Fri Jul 14 13:29:48 2006 UTC

# Line 1 | Line 1
1   ### RPM cms cms-env 1.0
2   Source: cmsos
3 Requires: SCRAM SCRAMV1
3   %prep
4   %build
5   echo $SCRAM_ROOT
# Line 10 | Line 9 | echo $SCRAM_ROOT
9  
10   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); export SCRAM_ARCH
20 > SCRAM_ARCH=$(cmsos)
21  
22   # We need to assume 1 compiler per platform.
23   # There is no other way around this.
# Line 25 | Line 28 | case $SCRAM_ARCH in
28      osx104_pcc32) compilerv=gcc400;;
29   esac
30   SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
31 + export SCRAM_ARCH
32  
33 < source %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.sh
34 < source %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.sh
33 > if [ "$VO_CMS_SW_DIR" != ""  ]
34 > then
35 >    here=$VO_CMS_SW_DIR
36 > else
37 >    here=`dirname $0`
38 > fi
39 >
40 > [ -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}
41 >
42 > for pkg in `ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
43 > do
44 >        source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
45 > done
46 > export CMS_PATH=$here
47   EOF_CMSSET_DEFAULT_SH
48  
49 +
50 + ### CSH code
51 +
52   cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
53 < setenv PATH %instroot/bin:$PATH
54 < setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
55 < setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY
56 < setenv SCRAM_ARCH `cmsos`
57 < sentenv compilerv gcc323
58 < switch ( $SCRAM_ARCH )
53 >
54 > if (${?PATH}) then
55 >    setenv PATH %instroot/bin:$PATH
56 > else
57 >    setenv PATH %instroot/bin
58 > endif
59 >
60 > if (${?LD_LIBRARY_PATH}) then
61 >    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
62 > else
63 >    setenv LD_LIBRARY_PATH %instroot/lib
64 > endif
65 >
66 > if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
67 >    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
68 > else
69 >    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
70 > endif
71 >
72 > setenv CMSOSCOMMAND `which cmsos`
73 > setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
74 > setenv compilerv gcc323
75 > switch ( ${SCRAM_ARCH} )
76      case slc3_ia32:
77          setenv compilerv gcc323
78      breaksw
# Line 51 | Line 87 | switch ( $SCRAM_ARCH )
87      breaksw
88   endsw
89  
90 < . %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
91 < . %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
90 > setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
91 > if ( ${?VO_CMS_SW_DIR} ) then
92 >    setenv here $VO_CMS_SW_DIR
93 > else
94 >    setenv here .
95 > endif
96 >
97 > if ( ! -e $here/cmsset_default.csh ) then
98 >    echo "Please cd into the directory where cmsset_default.csh is."
99 > endif
100 >
101 > foreach pkg ( `ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
102 >        source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
103 > end
104 > setenv CMS_PATH $here
105   EOF_CMSSET_DEFAULT_CSH
106  
107 + %pre
108 + [ -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`
109 + [ -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`
110 + [ -d $RPM_INSTALL_PREFIX/bin ] && cp -r $RPM_INSTALL_PREFIX/bin $RPM_INSTALL_PREFIX/bin.old`date +%Y%m%d`
111   %post
112   echo $RPM_INSTALL_PREFIX
113   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
# Line 65 | Line 118 | perl -p -i -e "s|%{instroot}|$RPM_INSTAL
118   %instroot/cmsset_default.sh
119   %instroot/cmsset_default.csh
120   %instroot/bin/cmsos
121 + %instroot/%cmsplatf/etc/profile.d
122 + %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines