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.4 by eulisse, Fri Jun 16 12:15:00 2006 UTC vs.
Revision 1.26 by eulisse, Fri Jul 28 09:37:04 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)
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
28 < export SCRAM_ARCH
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 >    export SCRAM_ARCH
37 > fi
38 >
39 > here=%{instroot}
40 >
41 > if [ "$VO_CMS_SW_DIR" != ""  ]
42 > then
43 >    here=$VO_CMS_SW_DIR
44 > else
45 >    if [ "$OSG_APP" != "" ]
46 >    then
47 >        here=$OSG_APP/cmssoft/cms
48 >    fi
49 > fi
50 >
51 > if [ ! -d $here/${SCRAM_ARCH}/etc/profile.d ]
52 > then
53 >    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"
54 > fi
55 >
56 > for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]sh'`
57 > do
58 >        source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
59 > done
60 >
61 > if [ ! $CMS_PATH ]
62 > then
63 >    export CMS_PATH=$here
64 > fi
65   EOF_CMSSET_DEFAULT_SH
66  
67 +
68 + ### CSH code
69 +
70   cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
71 +
72   if (${?PATH}) then
73      setenv PATH %instroot/bin:$PATH
74   else
75      setenv PATH %instroot/bin
76   endif
77  
78 < if (${?LD_LIBRARY_PATH}) then
79 <    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
80 < else
81 <    setenv LD_LIBRARY_PATH %instroot/lib
78 > #if (${?LD_LIBRARY_PATH}) then
79 > #    setenv LD_LIBRARY_PATH %instroot/lib:$LD_LIBRARY_PATH
80 > #else
81 > #    setenv LD_LIBRARY_PATH %instroot/lib
82 > #endif
83 >
84 > #if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
85 > #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
86 > #else
87 > #    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
88 > #endif
89 >
90 > set CMSOSCOMMAND=`which cmsos`
91 > if ( ! ${?SCRAM_ARCH}) then
92 >    setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
93 >    set compilerv=gcc323
94 >    switch ( ${SCRAM_ARCH} )
95 >        case slc3_ia32:
96 >            set compilerv=gcc323
97 >        breaksw
98 >        case slc3_amd64:
99 >            set compilerv=gcc344
100 >        breaksw
101 >        case slc4_ia32:
102 >            set compilerv=gcc345
103 >        breaksw
104 >        case slc4_amd64:
105 >            set compilerv=gcc345
106 >        breaksw
107 >        case osx104_ia32:
108 >            set compilerv=gcc400
109 >        breaksw
110 >        case osx104_pcc32:
111 >            set compilerv=gcc400
112 >        breaksw
113 >    endsw
114 >
115 >    setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
116   endif
117  
118 < if (${?DYLD_FALLBACK_LIBRARY_PATH}) then
119 <    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib:$DYLD_FALLBACK_LIBRARY_PATH
118 > set here=%instroot
119 >
120 > if ( ${?VO_CMS_SW_DIR} ) then
121 >    set here=$VO_CMS_SW_DIR
122   else
123 <    setenv DYLD_FALLBACK_LIBRARY_PATH %instroot/lib
123 >    # OSG
124 >    if ( ${?OSG_APP} ) then
125 >        set here=$OSG_APP/cmssoft/cms
126 >    endif
127 >    # OSG                      
128   endif
129  
130 < setenv CMSOSCOMMAND `which cmsos`
131 < setenv SCRAM_ARCH `sh -c $CMSOSCOMMAND`
132 < setenv compilerv gcc323
56 < switch ( ${SCRAM_ARCH} )
57 <    case slc3_ia32:
58 <        setenv compilerv gcc323
59 <    breaksw
60 <    case slc3_amd64:
61 <        setenv compilerv gcc345
62 <    breaksw
63 <    case osx104_ia32:
64 <        setenv compilerv gcc400
65 <    breaksw
66 <    case osx104_pcc32:
67 <        setenv compilerv gcc400
68 <    breaksw
69 < endsw
70 <
71 < setenv SCRAM_ARCH ${SCRAM_ARCH}_${compilerv}
130 > if ( ! -e $here/cmsset_default.csh ) then
131 >    echo "Please cd into the directory where cmsset_default.csh is."
132 > endif
133  
134 < source %instroot/${SCRAM_ARCH}/lcg/SCRAM/V0_20_0/etc/profile.d/init.csh
135 < source %instroot/${SCRAM_ARCH}/lcg/SCRAMV1/V1_0_2/etc/profile.d/init.csh
134 > foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep -e'^S.*[.]csh'` )
135 >        source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
136 > end
137 > if ( ! ${?CMS_PATH} ) then
138 >    setenv CMS_PATH $here
139 > endif
140 > unset here
141 > unset CMSOSCOMMAND
142 > unset compilerv
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 84 | 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