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.13 by eulisse, Sun Jul 16 18:46:10 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 >
39 >    if [ "$OSG_APP" != "" ]
40 >    then
41 >        here=$OSG_APP/cmssoft/cms
42 >    fi
43 > fi
44 >
45 > if [ -d $here/${SCRAM_ARCH}/etc/profile.d ]
46 > then
47 >    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"
48 >    exit 1
49 > fi
50 >
51 > for pkg in `ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
52 > do
53 >        source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
54 > done
55 > export CMS_PATH=$here
56   EOF_CMSSET_DEFAULT_SH
57  
58 +
59 + ### CSH code
60 +
61   cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
62 < setenv PATH %instroot/bin:$PATH
63 < setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
64 < setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY
65 < setenv SCRAM_ARCH `cmsos`
66 < sentenv compilerv gcc323
67 < switch ( $SCRAM_ARCH )
62 >
63 > if (${?PATH}) then
64 >    setenv PATH %instroot/bin:$PATH
65 > else
66 >    setenv PATH %instroot/bin
67 > endif
68 >
69 > if (${?LD_LIBRARY_PATH}) then
70 >    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
71 > else
72 >    setenv LD_LIBRARY_PATH %instroot/lib
73 > endif
74 >
75 > if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
76 >    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
77 > else
78 >    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
79 > endif
80 >
81 > setenv CMSOSCOMMAND `which cmsos`
82 > setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
83 > setenv compilerv gcc323
84 > switch ( ${SCRAM_ARCH} )
85      case slc3_ia32:
86          setenv compilerv gcc323
87      breaksw
# Line 51 | Line 96 | switch ( $SCRAM_ARCH )
96      breaksw
97   endsw
98  
99 < . %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
100 < . %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
99 > setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
100 > if ( ${?VO_CMS_SW_DIR} ) then
101 >    setenv here $VO_CMS_SW_DIR
102 > else
103 >    setenv here .
104 >    # OSG
105 >    if ( ${?OSG_APP} ) then
106 >        setenv here $OSG_APP/cmssoft/cms
107 >    endif
108 >    # OSG                      
109 > endif
110 >
111 > if ( ! -e $here/cmsset_default.csh ) then
112 >    echo "Please cd into the directory where cmsset_default.csh is."
113 > endif
114 >
115 > foreach pkg ( `ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
116 >        source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
117 > end
118 > setenv CMS_PATH $here
119   EOF_CMSSET_DEFAULT_CSH
120  
121 + %pre
122 + [ -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`
123 + [ -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`
124 + [ -d $RPM_INSTALL_PREFIX/bin ] && cp -r $RPM_INSTALL_PREFIX/bin $RPM_INSTALL_PREFIX/bin.old`date +%Y%m%d`
125   %post
126   echo $RPM_INSTALL_PREFIX
127   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
# Line 65 | Line 132 | perl -p -i -e "s|%{instroot}|$RPM_INSTAL
132   %instroot/cmsset_default.sh
133   %instroot/cmsset_default.csh
134   %instroot/bin/cmsos
135 + %instroot/%cmsplatf/etc/profile.d
136 + %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines