ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-env.spec
Revision: 1.33
Committed: Thu Aug 24 12:41:17 2006 UTC (18 years, 8 months ago) by eulisse
Branch: MAIN
CVS Tags: CMSSW_1_2_6, CMSSW_1_2_5, CMSSW_1_2_4, CMSSW_1_2_3, for120_g4821, POOL_2_4_9-p2-slc4, POOL_2_4_9-p2, nr20070307_130pre5-m32-slc4, nr20070307_m32, CMSSW_1_3_0_pre5, CMSSW_1_3_0_pre5-slc4, nr070301_amd64m32, CMSSW_1_3_0_pre4-slc4-p1, CMSSW_1_3_0_pre4-p1, CMSSW_1_3_0_pre4, CMSSW_1_3_0_pre4-slc4, CMS_145_2-slc4, CMS_145_2-slc3, sfa160207, CMSSW_1_3_0_pre3-slc4, CMSSW_1_3_0_pre3, sfa120207slc4_p1, sfa120207slc4, sfa120207slc3, dl070211, nr070211_cms144a_2-p1slc4, nr070210_cms144a_2-p1slc4, cms144a_2-p1slc3, forCMS145_2_slc4, forCMS145_2_slc3, cms145pre5-slc4, forCMSSW120g482, cms145pre5-slc3, cms145pre4-slc3, cms145pre3-slc3, cms145pre2-slc3, cms145pre1-slc3, pe20070208, GE20070207, pe20070205b, CMSSW_1_3_0_SLC4_pre2, pe20070205a, pe20070205, CMSSW_1_3_0_pre2, forCMS144_2-slc3, forCMS144_2-slc4, sfa010207-slc4, sfa010207-slc3, forCMSSW121-slc3, forCMSSW122-slc3, cms144slc3p2, cms144slc4p1, cms144slc3p1, cms144spc3p1, sfa300107, sfa390107, sfa290107, CMSSW_1_3_0_SLC4_pre1, CMSSW_1_3_0_pre1, for143hsv1-slc3-p5, for143hsv1-slc4-p5, for143hsv1-slc3-p4, for143hsv1-slc4-p4, for143hsv1-slc4-p3, for143hsv1-slc3-p3, for143hsv1-slc4-p2, for143hsv1-slc3-p2, for143hsv1-slc3-p1, for143hsv1-slc4, for143hsv1-slc3, for143hsv1, test143f_sv1-slc4, forCMSSW120-slc4, forCMSSW120g481, forCMSSW120-slc3, forCMS143f-slc4, forCMS143f-slc3, for120p9, pe20061201c, pe20061201b, pe20061201a, ge200611302202, for120p8-g481p2cms1, for120p8, for112, for120p7, for111, for120p6, cms143a-slc3, for120p5-slc3, for120p5slc4, for120p5slc3, forCMS143_2_rootfix, forCMS143_2_slc4, forCMS143_2_slc3, sfa061106pm, sfa061106am, sa20061106, sfa031106pm, sfa031106, sfa021106, sa20061002, for120p4, for120p3, for120p2-slc4-rc1, for106, ge20061020-for106, pre-for106, for120p2, for105, for104, for110, for120p1, for110p4, for103, for110p3, for102, for101-take3, for101-take2, for101, forGeant481, for110p2, CMSSW_1_0_0, for110p5, for110p1, for084, for100p4, argiro-20060904-for100p4, for092, for137a_pre083_take2, pe20060827a, for137a_pre083, ge20060825, for100p2
Branch point for: lcgaa_for120p6_branch, lcg47branch
Changes since 1.32: +1 -1 lines
Log Message:
Correct compiler for osx104_ia32 (was gcc400, now gcc401).

File Contents

# User Rev Content
1 eulisse 1.1 ### RPM cms cms-env 1.0
2     Source: cmsos
3     %prep
4     %build
5     echo $SCRAM_ROOT
6     %install
7     %define scramroot %(echo $SCRAM_ROOT)
8     %define scramv1root %(echo $SCRAMV1_ROOT)
9    
10     mkdir -p %instroot/bin
11     install -m 755 %_sourcedir/cmsos %instroot/bin/cmsos
12 eulisse 1.5 mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d
13    
14 eulisse 1.28 ### 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 eulisse 1.31 if [ ! "$SCRAM_ARCH" ]
22 eulisse 1.29 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 eulisse 1.33 osx104_ia32) compilerv=gcc401;;
29 eulisse 1.29 osx104_pcc32) compilerv=gcc400;;
30     esac
31     echo ${osarch}_${compilerv}
32     else
33     echo $SCRAM_ARCH
34     fi
35    
36 eulisse 1.28 EOF_CMSARCH_SH
37     chmod 755 %instroot/bin/cmsarch
38    
39 eulisse 1.9 ### BASH code
40    
41 eulisse 1.1 cat << \EOF_CMSSET_DEFAULT_SH > %instroot/cmsset_default.sh
42     export PATH=%instroot/bin:$PATH
43 eulisse 1.2
44 eulisse 1.22 if [ ! $SCRAM_ARCH ]
45 eulisse 1.19 then
46 eulisse 1.28 SCRAM_ARCH=`%instroot/bin/cmsarch`
47 eulisse 1.19 export SCRAM_ARCH
48 eulisse 1.15 fi
49    
50 eulisse 1.16 here=%{instroot}
51    
52 eulisse 1.10 if [ "$VO_CMS_SW_DIR" != "" ]
53     then
54 eulisse 1.9 here=$VO_CMS_SW_DIR
55     else
56 eulisse 1.12 if [ "$OSG_APP" != "" ]
57     then
58     here=$OSG_APP/cmssoft/cms
59     fi
60 eulisse 1.10 fi
61 eulisse 1.9
62 eulisse 1.14 if [ ! -d $here/${SCRAM_ARCH}/etc/profile.d ]
63 eulisse 1.13 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 eulisse 1.9
67 eulisse 1.27 for pkg in `/bin/ls $here/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]sh'`
68 eulisse 1.5 do
69     source $here/${SCRAM_ARCH}/etc/profile.d/$pkg
70     done
71 eulisse 1.21
72 eulisse 1.22 if [ ! $CMS_PATH ]
73 eulisse 1.21 then
74     export CMS_PATH=$here
75     fi
76 metson 1.32
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 eulisse 1.1 EOF_CMSSET_DEFAULT_SH
82    
83 eulisse 1.9
84     ### CSH code
85    
86 eulisse 1.1 cat << \EOF_CMSSET_DEFAULT_CSH > %instroot/cmsset_default.csh
87 eulisse 1.7
88 eulisse 1.4 if (${?PATH}) then
89     setenv PATH %instroot/bin:$PATH
90     else
91     setenv PATH %instroot/bin
92     endif
93    
94 eulisse 1.19 if ( ! ${?SCRAM_ARCH}) then
95 eulisse 1.28 setenv SCRAM_ARCH `sh -c %instroot/bin/cmsarch`
96 eulisse 1.25 endif
97 eulisse 1.15
98 eulisse 1.22 set here=%instroot
99 eulisse 1.16
100 eulisse 1.7 if ( ${?VO_CMS_SW_DIR} ) then
101 eulisse 1.23 set here=$VO_CMS_SW_DIR
102 eulisse 1.7 else
103 eulisse 1.12 # OSG
104     if ( ${?OSG_APP} ) then
105 eulisse 1.23 set here=$OSG_APP/cmssoft/cms
106 eulisse 1.12 endif
107     # OSG
108 eulisse 1.7 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 eulisse 1.5
114 eulisse 1.27 foreach pkg ( `/bin/ls ${here}/${SCRAM_ARCH}/etc/profile.d/ | grep 'S.*[.]csh'` )
115 eulisse 1.5 source ${here}/${SCRAM_ARCH}/etc/profile.d/$pkg
116     end
117 eulisse 1.21 if ( ! ${?CMS_PATH} ) then
118     setenv CMS_PATH $here
119     endif
120 metson 1.32
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 eulisse 1.22 unset here
126 eulisse 1.1 EOF_CMSSET_DEFAULT_CSH
127 eulisse 1.28 touch %instroot/%cmsplatf/etc/profile.d/dummy
128 eulisse 1.8 %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 eulisse 1.1 %post
133     echo $RPM_INSTALL_PREFIX
134 eulisse 1.3 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 eulisse 1.28 perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/cmsarch
138 eulisse 1.3 %files
139     %i
140     %instroot/cmsset_default.sh
141     %instroot/cmsset_default.csh
142     %instroot/bin/cmsos
143 eulisse 1.28 %instroot/bin/cmsarch
144 eulisse 1.5 %instroot/%cmsplatf/etc/profile.d
145 eulisse 1.6 %exclude %instroot/%cmsplatf/etc/profile.d/*