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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines