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.2 by eulisse, Tue Jun 13 10:45:01 2006 UTC vs.
Revision 1.9 by eulisse, Wed Jul 12 20:32:02 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 + if [ "$VO_CMS_SW_DIR" != ""  ] then
34 +    here=$VO_CMS_SW_DIR
35 + else
36 +    here=`dirname $0`
37 + endif
38 +
39 + [ -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".
40 +
41 + for pkg in `ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
42 + do
43 +        source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
44 + done
45  
29 source %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.sh
30 source %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.sh
46   EOF_CMSSET_DEFAULT_SH
47  
48 +
49 + ### CSH code
50 +
51   cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
52 < setenv PATH %instroot/bin:$PATH
53 < setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
54 < setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY
55 < setenv SCRAM_ARCH `cmsos`
56 < sentenv compilerv gcc323
57 < switch ( $SCRAM_ARCH )
52 >
53 > if (${?PATH}) then
54 >    setenv PATH %instroot/bin:$PATH
55 > else
56 >    setenv PATH %instroot/bin
57 > endif
58 >
59 > if (${?LD_LIBRARY_PATH}) then
60 >    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
61 > else
62 >    setenv LD_LIBRARY_PATH %instroot/lib
63 > endif
64 >
65 > if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
66 >    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
67 > else
68 >    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
69 > endif
70 >
71 > setenv CMSOSCOMMAND `which cmsos`
72 > setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
73 > setenv compilerv gcc323
74 > switch ( ${SCRAM_ARCH} )
75      case slc3_ia32:
76          setenv compilerv gcc323
77      breaksw
# Line 51 | Line 86 | switch ( $SCRAM_ARCH )
86      breaksw
87   endsw
88  
89 < . %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
90 < . %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
89 > setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
90 > if ( ${?VO_CMS_SW_DIR} ) then
91 >    setenv here $VO_CMS_SW_DIR
92 > else
93 >    setenv here .
94 > endif
95 >
96 > if ( ! -e $here/cmsset_default.csh ) then
97 >    echo "Please cd into the directory where cmsset_default.csh is."
98 > endif
99 >
100 > foreach pkg ( `ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
101 >        source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
102 > end
103 >
104   EOF_CMSSET_DEFAULT_CSH
105  
106 + %pre
107 + [ -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`
108 + [ -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`
109 + [ -d $RPM_INSTALL_PREFIX/bin ] && cp -r $RPM_INSTALL_PREFIX/bin $RPM_INSTALL_PREFIX/bin.old`date +%Y%m%d`
110   %post
111   echo $RPM_INSTALL_PREFIX
112 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" %instroot/cmsset_default.sh
113 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" %instroot/cmsset_default.csh
114 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" %instroot/bin/cmsos
112 > perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
113 > perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.csh
114 > perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsos
115 > %files
116 > %i
117 > %instroot/cmsset_default.sh
118 > %instroot/cmsset_default.csh
119 > %instroot/bin/cmsos
120 > %instroot/%cmsplatf/etc/profile.d
121 > %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines