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.22 by eulisse, Tue Jul 25 16:51:43 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
18 > #export LD_LIBRARY_PATH=%instroot/lib:$LD_LIBRARY_PATH
19 > #export DYLD_FALLBACK_LIBRARY_PATH=%instroot/lib:$DYLD_FALLBACK_LIBRARY
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 > fi
60 >
61 > for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
62 > do
63 >        source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
64 > done
65 >
66 > if [ ! $CMS_PATH ]
67 > then
68 >    export CMS_PATH=$here
69 > fi
70   EOF_CMSSET_DEFAULT_SH
71  
72 +
73 + ### CSH code
74 +
75   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
76  
77 < . %instroot/$SCRAM_ARCH/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
78 < . %instroot/$SCRAM_ARCH/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
77 > if (${?PATH}) then
78 >    setenv PATH %instroot/bin:$PATH
79 > else
80 >    setenv PATH %instroot/bin
81 > endif
82 >
83 > #if (${?LD_LIBRARY_PATH}) then
84 > #    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
85 > #else
86 > #    setenv LD_LIBRARY_PATH %instroot/lib
87 > #endif
88 >
89 > #if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
90 > #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
91 > #else
92 > #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
93 > #endif
94 >
95 > set CMSOSCOMMAND=`which cmsos`
96 > if ( ! ${?SCRAM_ARCH}) then
97 >    setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
98 >    set compilerv=gcc323
99 >    switch ( ${SCRAM_ARCH} )
100 >        case slc3_ia32:
101 >            setenv compilerv gcc323
102 >        breaksw
103 >        case slc3_amd64:
104 >            setenv compilerv gcc344
105 >        breaksw
106 >        case slc4_ia32:
107 >            setenv compilerv gcc345
108 >        breaksw
109 >        case slc4_amd64:
110 >            setenv compilerv gcc345
111 >        breaksw
112 >        case osx104_ia32:
113 >            setenv compilerv gcc400
114 >        breaksw
115 >        case osx104_pcc32:
116 >            setenv compilerv gcc400
117 >        breaksw
118 >    endsw
119 >
120 >    setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
121 >
122 >    if ( $# > 0 ) then
123 >        setenv SCRAM_ARCH $1
124 >    endif
125 > endif
126 > set here=%instroot
127 >
128 > if ( ${?VO_CMS_SW_DIR} ) then
129 >    set here $VO_CMS_SW_DIR
130 > else
131 >    # OSG
132 >    if ( ${?OSG_APP} ) then
133 >        set here $OSG_APP/cmssoft/cms
134 >    endif
135 >    # OSG                      
136 > endif
137 >
138 > if ( ! -e $here/cmsset_default.csh ) then
139 >    echo "Please cd into the directory where cmsset_default.csh is."
140 > endif
141 >
142 > foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
143 >        source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
144 > end
145 > if ( ! ${?CMS_PATH} ) then
146 >    setenv CMS_PATH $here
147 > endif
148 > unset here
149 > unset CMSOSCOMMAND
150 > unset compilerv
151   EOF_CMSSET_DEFAULT_CSH
152  
153 + %pre
154 + [ -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`
155 + [ -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`
156 + [ -d $RPM_INSTALL_PREFIX/bin ] && cp -r $RPM_INSTALL_PREFIX/bin $RPM_INSTALL_PREFIX/bin.old`date +%Y%m%d`
157   %post
158   echo $RPM_INSTALL_PREFIX
159   perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/cmsset_default.sh
# Line 65 | Line 164 | perl -p -i -e "s|%{instroot}|$RPM_INSTAL
164   %instroot/cmsset_default.sh
165   %instroot/cmsset_default.csh
166   %instroot/bin/cmsos
167 + %instroot/%cmsplatf/etc/profile.d
168 + %exclude %instroot/%cmsplatf/etc/profile.d/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines