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.35 by eulisse, Mon Sep 25 13:45:14 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 < cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh
14 < export PATH=%instroot/bin:$PATH
15 < export LD_LIBRARY_PATH=%instroot/lib:$LD_LIBRARY_PATH
16 < export DYLD_FALLBACK_LIBRARY_PATH=%instroot/lib:$DYLD_FALLBACK_LIBRARY
17 < SCRAM_ARCH=$(cmsos); export SCRAM_ARCH
12 > mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d
13  
14 + ### Detects the SCRAM_ARCH to be used.
15 + cat << \EOF_CMSARCH_SH >%instroot/bin/cmsarch
16 + #!/bin/sh
17 + osarch=`%instroot/bin/cmsos`
18 + compilerv=gcc323
19   # We need to assume 1 compiler per platform.
20   # There is no other way around this.
21 < case $SCRAM_ARCH in
22 <    slc3_ia32) compilerv=gcc323;;
23 <    slc3_amd64) compilerv=gcc345;;
24 <    osx104_ia32) compilerv=gcc400;;
25 <    osx104_pcc32) compilerv=gcc400;;
26 < esac
27 < SCRAM_ARCH=${SCRAM_ARCH}_$compilerv
21 > if [ ! "$SCRAM_ARCH" ]
22 > then
23 >    case $osarch in
24 >        slc3_ia32) compilerv=gcc323;;
25 >        slc3_amd64) compilerv=gcc344;;
26 >        slc4_ia32) compilerv=gcc345;;
27 >        slc4_amd64) compilerv=gcc345;;
28 >        osx104_ia32) compilerv=gcc401;;
29 >        osx104_pcc32) compilerv=gcc400;;
30 >    esac
31 >    echo ${osarch}_${compilerv}
32 > else
33 >    echo $SCRAM_ARCH
34 > fi
35 >
36 > EOF_CMSARCH_SH
37 > chmod 755 %instroot/bin/cmsarch
38 >
39 > ### BASH code
40 >
41 > cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh
42 > export PATH=%instroot/bin:$PATH
43  
44 < source %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.sh
45 < source %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.sh
44 > if [ ! $SCRAM_ARCH ]
45 > then
46 >    SCRAM_ARCH=`%instroot/bin/cmsarch`
47 >    export SCRAM_ARCH
48 > fi
49 >
50 > here=%{instroot}
51 >
52 > if [ "$VO_CMS_SW_DIR" != ""  ]
53 > then
54 >    here=$VO_CMS_SW_DIR
55 > else
56 >    if [ "$OSG_APP" != "" ]
57 >    then
58 >        here=$OSG_APP/cmssoft/cms
59 >    fi
60 > fi
61 >
62 > if [ ! -d $here/${SCRAM_ARCH}/etc/profile.d ]
63 > then
64 >    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"
65 > fi
66 >
67 > for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]sh'`
68 > do
69 >        source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
70 > done
71 >
72 > if [ ! $CMS_PATH ]
73 > then
74 >    export CMS_PATH=$here
75 > fi
76 >
77 > if [ -f $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh ]; then
78 >        echo "Loading site local CMS environment"
79 >        . $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.sh
80 > fi
81   EOF_CMSSET_DEFAULT_SH
82  
83 +
84 + ### CSH code
85 +
86   cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
34 setenv PATH %instroot/bin:$PATH
35 setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
36 setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY
37 setenv SCRAM_ARCH `cmsos`
38 sentenv compilerv gcc323
39 switch ( $SCRAM_ARCH )
40    case slc3_ia32:
41        setenv compilerv gcc323
42    breaksw
43    case slc3_amd64:
44        setenv compilerv gcc345
45    breaksw
46    case osx104_ia32:
47        setenv compilerv gcc400
48    breaksw
49    case osx104_pcc32:
50        setenv compilerv gcc400
51    breaksw
52 endsw
87  
88 < . %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
89 < . %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
88 > if (${?PATH}) then
89 >    setenv PATH %instroot/bin:$PATH
90 > else
91 >    setenv PATH %instroot/bin
92 > endif
93 >
94 > if ( ! ${?SCRAM_ARCH}) then
95 >    setenv SCRAM_ARCH `sh -c %instroot/bin/cmsarch`
96 > endif
97 >
98 > set here=%instroot
99 >
100 > if ( ${?VO_CMS_SW_DIR} ) then
101 >    set here=$VO_CMS_SW_DIR
102 > else
103 >    # OSG
104 >    if ( ${?OSG_APP} ) then
105 >        set here=$OSG_APP/cmssoft/cms
106 >    endif
107 >    # OSG                      
108 > endif
109 >
110 > if ( ! -e $here/cmsset_default.csh ) then
111 >    echo "Please cd into the directory where cmsset_default.csh is."
112 > endif
113 >
114 > foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]csh'` )
115 >        source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
116 > end
117 > if ( ! ${?CMS_PATH} ) then
118 >    setenv CMS_PATH $here
119 > endif
120 >
121 > if( -e $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh ) then
122 >        echo "Loading site local CMS environment"
123 >        source $CMS_PATH/SITECONF/local/JobConfig/cmsset_local.csh
124 > endif
125 > unset here
126   EOF_CMSSET_DEFAULT_CSH
127 <
127 > touch %instroot/%cmsplatf/etc/profile.d/dummy
128 > %pre
129 > [ -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`
130 > [ -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`
131 > [ -d $RPM_INSTALL_PREFIX/bin ] && cp -r $RPM_INSTALL_PREFIX/bin $RPM_INSTALL_PREFIX/bin.old`date +%Y%m%d`
132   %post
133   echo $RPM_INSTALL_PREFIX
134   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
135   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.csh
136   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsos
137 + perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsarch
138   %files
139   %i
140   %instroot/cmsset_default.sh
141   %instroot/cmsset_default.csh
142   %instroot/bin/cmsos
143 + %instroot/bin/cmsarch
144 + %instroot/%cmsplatf/etc/profile.d
145 + %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines