Revision: | 1.6 |
Committed: | Fri Jun 22 19:16:59 2007 UTC (17 years, 10 months ago) by ratnik |
Branch: | MAIN |
CVS Tags: | CMSSW_1_6_12, apFor1612v0, apFor1612p3v0, CMSSW_1_6_12_pre2, apFor1612p2v1, apFor1612p2v0, CMSSW_1_6_12_pre1, apFor1612p1v1, apFor1612p1v0, CMSSW_1_6_11, apFor1611v0, apFor1611p1v1, apFor1611p1v0, CMSSW_1_6_10, apFor1610v0, CMSSW_1_6_10_pre2, CMSSW_1_6_10_pre1, apFor1610p2v0, apFor1610p1v2, apFor1610p1v1, CMSSW_1_6_9, apFor169v1, CMSSW_1_6_9_pre2, apFor169p2v2, apFor169p2v1, apFor169p2v0, ap20080116d, ap20080116c, ap20080116b, ap20080116a, ap20080115d, ap20080115c, ap20080115b, ap20080115a, ap20080114b, ap20080114a, CMSSW_1_6_9_pre1, apFor169p1, apFor169p1v5, apFor169p1v4, apFor169p1v3, apFor169p1v2, apFor169p1v1, apFor169p1v0, apFor169v0, CMSSW_1_6_8, apFor168, CMSSW_1_6_8_pre2, apFor168p2, CMSSW_1_6_8_pre1, apFor168p1, CMSSW_1_6_7, pe20071019a-for167, CMSSW_1_6_6, pe20071013a-for166p2, nr20071011-bootstrap, pe20071011a-for166, pe20071009a-for166p1, CMSSW_1_6_5, pe20071006a-for165, CMSSW_1_6_5_pre2, pe20071005a-for165p2, CMSSW_1_6_5_pre1, pe20070930b-for165p1, pe20070930a-for165p1, CMSSW_1_6_4, pe20070929a-for164, nr20070926-bootstrap, CMSSW_1_6_3, pe20070928a-for16Xdpm, pe20070926a-for163, CMSSW_1_6_2, ap-20070925, pe20070925a-for162, CMSSW_1_6_2_pre1, pe20070922a-for162p1, CMSSW_1_6_1, pe20070922g-for161p2, pe20070922f-for161p2, pe20070922e-for161p2, pe20070922d-for161p2, pe20070922c-for161p2, pe20070922b-for161p2, pe20070922a-for161p2, CMSSW_1_6_1_pre1, CMSSW_1_6_0, CMSSW_1_6_0_pre14, pe20070831d-160p14, pe20070831c-160p14, pe20070831b-160p14, pe20070831a-160p14, pe20070830a-160p14, CMSSW_1_6_0_DAQ3, CMSSW_1_6_0_pre13, dl070828t2, dl070828, dl070826, pe20070826a-160p13, CMSSW_1_6_0_pre12, dl070824, pe20070824b-160p12, pe20070824-160p12, pe20070823-160p12, CMSSW_1_6_0_pre11, CMSSW_1_6_0_pre10, ge20070810-ptc, CMSSW_1_6_0_pre9, CMSSW_1_6_0_pre8, CMSSW_1_6_0_pre7, dl070730, cms160daq1_zhen2, cms160daq1_zhen1, ge20070730-cmsbuild, ge20070729-amd64, CMSSW_1_6_0_pre6, pe20070727-160p6, CMSSW_1_6_0_DAQ1, ge20070726, ge20070724-slc3, ap20070723, CMSSW_1_6_0_pre5, dl070721, dl070720_160daq1_1, pe20070720-160daq1, pe20070720-160p5, ge20070718, ge20070717, ap20070717, ge20070713-macosx, ap20070712, ge20070712-migration, ge20070712, ge20070711-prodcommon, CMSSW_1_6_0_pre4, ge20070710-formencode, ge20070709-slc3, ge20070709-macosx, ge20070709a-macosx, ge20070706-macosx, ap20070706, CMSSW_1_6_0_pre3, pe20070705a-160p3, CMSSW_1_6_0_pre2, ge20070705, ge20070704, ge20070703b, pe20070702b-160p3, pe20070702b-160p2, ge20070702-rpm-webtools, ge20070629, ge20070625 |
Changes since 1.5: | +1 -1 lines |
Log Message: | Update version for CMSSW_1_5_0 |
# | User | Rev | Content |
---|---|---|---|
1 | ratnik | 1.6 | ### RPM cms fwlite CMSSW_1_5_0_FWLITE |
2 | ratnik | 1.1 | ## IMPORT configurations |
3 | Provides: /bin/zsh | ||
4 | Requires: SCRAMV1 | ||
5 | Requires: fwlite-tool-conf | ||
6 | Requires: gcc-wrapper | ||
7 | %define gccwrapperarch slc4_ia32_gcc345 | ||
8 | |||
9 | # Take source from CMSSW base release: | ||
10 | ratnik | 1.2 | %define application %n |
11 | # Assuming release name convention for FWLite release based on CMSSW_X_Y_Z is CMSSW_X_Y_Z_FWLITE . | ||
12 | %define cmssw_release %(perl -e '$_="%v"; s/_FWLITE//; print;') | ||
13 | ratnik | 1.1 | %define cmsswsrc http://cmsdoc.cern.ch/cms/cpt/Software/download/cms/SOURCES/cms/cmssw/%{cmssw_release} |
14 | Source0: %{cmsswsrc}/toolbox.tar.gz | ||
15 | Source1: %{cmsswsrc}/config.tar.gz | ||
16 | Source2: %{cmsswsrc}/src.tar.gz | ||
17 | |||
18 | %define toolconf ${FWLITE_TOOL_CONF_ROOT}/configurations/tools-STANDALONE.conf | ||
19 | %define prebuildtarget gindices | ||
20 | %define buildtarget release-build | ||
21 | %define postbuildtarget doc | ||
22 | |||
23 | ratnik | 1.2 | # Following dependencies were not detected by ignominy, but required in the BuildFiles: |
24 | # boost_program_options boost_regex bz2lib pcre root rootcintex uuid zlib | ||
25 | ratnik | 1.1 | |
26 | ratnik | 1.4 | %define externals "cxxcompiler ccompiler clhep sockets boost boost_filesystem rootrflx rootcore rootmath gccxml boost_python elementtree sigcpp hepmc gsl boost_regex boost_program_options boost_program_options boost_regex bz2lib pcre root rootcintex zlib" |
27 | ratnik | 1.2 | |
28 | ratnik | 1.4 | %define packages "CondFormats/JetMETObjects DataFormats/BTauReco DataFormats/CLHEP DataFormats/CaloRecHit DataFormats/CaloTowers DataFormats/Candidate DataFormats/Common DataFormats/DetId DataFormats/EcalDetId DataFormats/EcalRecHit DataFormats/EgammaCandidates DataFormats/EgammaReco DataFormats/EgammaTrackReco DataFormats/FEDRawData DataFormats/GeometryCommonDetAlgo DataFormats/GeometrySurface DataFormats/GeometryVector DataFormats/GsfTrackReco DataFormats/HcalDetId DataFormats/HcalRecHit DataFormats/HepMCCandidate DataFormats/JetReco DataFormats/L1CaloTrigger DataFormats/L1GlobalCaloTrigger DataFormats/L1GlobalMuonTrigger DataFormats/L1Trigger DataFormats/METReco DataFormats/Math DataFormats/MuonDetId DataFormats/MuonReco DataFormats/ParticleFlowCandidate DataFormats/ParticleFlowReco DataFormats/Provenance DataFormats/RecoCandidate DataFormats/SiPixelCluster DataFormats/SiPixelDetId DataFormats/SiPixelDigi DataFormats/SiStripCluster DataFormats/SiStripCommon DataFormats/SiStripDetId DataFormats/SiStripDigi DataFormats/TrackCandidate DataFormats/TrackReco DataFormats/TrackerRecHit2D DataFormats/TrackingRecHit DataFormats/TrajectorySeed DataFormats/TrajectoryState DataFormats/VertexReco FWCore/FWLite FWCore/MessageLogger FWCore/PluginManager FWCore/RootAutoLibraryLoader FWCore/Utilities SimDataFormats/HepMCProduct" |
29 | ratnik | 1.1 | |
30 | %prep | ||
31 | |||
32 | # Create a SCRAM project area, but using the already extracted | ||
33 | # sources. In other words, pick up the files from the project config | ||
34 | # area, but munge all instances of <base url="cvs:*"> into a local | ||
35 | # reference so SCRAM won't try to download stuff from the network. | ||
36 | |||
37 | %setup -T -b 0 -n SCRAMToolBox | ||
38 | %setup -D -T -b 1 -n config | ||
39 | %setup -D -T -b 2 -n src | ||
40 | |||
41 | |||
42 | # Update requirements: | ||
43 | |||
44 | %if "%{buildarch:set}" != "set" | ||
45 | %define buildarch : | ||
46 | %endif | ||
47 | |||
48 | # NR: Allow to define bootstrap and requirements file names | ||
49 | ratnik | 1.2 | %define bootstrapfile config/%{application}_bootsrc |
50 | %define reqfile config/%{application}_requirements | ||
51 | ratnik | 1.1 | |
52 | |||
53 | cd %_builddir | ||
54 | |||
55 | # Create bootstrap file for fwlite: | ||
56 | cp config/bootsrc %bootstrapfile | ||
57 | perl -p -i -e ' | ||
58 | ratnik | 1.2 | # s!(<project.*name=)CMSSW(.*version=)CMSSW(.*)!$1%projectname$2%projectname$3!; |
59 | s!(<project.*name=CMSSW.*version=)%cmssw_release(.*)!$1%v$2!; | ||
60 | ratnik | 1.1 | s!config/requirements!%{reqfile}!; |
61 | if (s/(<download.*)(module=)CMSSW(.*)(name="src)(">)/#$1$2$3$4$5/) { | ||
62 | foreach $p (split / /, %{packages}) { | ||
63 | print "$1$2src/$p$3$4/$p$5\n" | ||
64 | } | ||
65 | } | ||
66 | ' %bootstrapfile | ||
67 | |||
68 | # Create requirements file: | ||
69 | cp config/requirements %reqfile | ||
70 | perl -p -i -e ' | ||
71 | if (m/(<select name=)(.*)(>)/) { | ||
72 | foreach $t (split / /, %externals) { | ||
73 | if ( $t eq lc($2) ) { $matches=1; last; } | ||
74 | } | ||
75 | if ( $matches != 1 ) { s/(.*)$/#$1/ }; | ||
76 | $matches=0; | ||
77 | } | ||
78 | ' %reqfile | ||
79 | |||
80 | # Create build templates: | ||
81 | ratnik | 1.2 | # for file in config/CMSSW_*.tmpl; do cat $file > `echo $file | sed s'/CMSSW/%{projectname}/'`; done |
82 | ratnik | 1.1 | |
83 | # Switch off building tests: | ||
84 | perl -p -i -e ' s!(<ClassPath.*test\+test>)!#$1!;' config/BuildFile | ||
85 | |||
86 | # Munging algorithm from scramv1-build.file: | ||
87 | perl -p -i -e ' | ||
88 | # Keep track whether we are in a toolbox area or not | ||
89 | if ($. == 1) { $intbx = 1; } | ||
90 | if (/<base/) { $intbx = /SPITOOLS|SCRAMToolBox|scramtoolbox/; } | ||
91 | |||
92 | # Replace base locations | ||
93 | s!cvs://.*/(SPITOOLS|SCRAMToolBox|scramtoolbox)\?[^">]+!file:%_builddir/SCRAMToolBox/!; | ||
94 | s!cvs://.*/(CMSSW)\?[^">]+!file:%_builddir/!; | ||
95 | |||
96 | # Replace relative references depending on whether this is in | ||
97 | # toolbox, or for project itself; configuration is always in | ||
98 | # toolbox. In toolbox keep cvs module name but drop the leading | ||
99 | # SCRAMToolBox if there is one. In project always replace with | ||
100 | # rewritten paths. (FIXME: produce source archive in cvs order?) | ||
101 | if ($intbx) { | ||
102 | s!url="cvs:\?module="?([^">]+)"?\s+name="?([^">]+)"?>!url="file:$1" name="$2">!; | ||
103 | s!url="(cvs:\?module=|file:)SCRAMToolBox/(.*)">!url="file:$2">!; | ||
104 | s!url="(cvs:\?module=|file:)scramtoolbox/(.*)">!url="file:$2">!; | ||
105 | } else { | ||
106 | #s!url="cvs:\?module="?([^">]+)"?\s+name="?([^">]+)"?>!url="file:$2" name="$2">!; | ||
107 | s!<download\s+url="cvs:\?module=LCGAAwrappers/%cvsproj/[^"]+?"\s+name=.+>!!; | ||
108 | s!url="cvs:\?module="?%cvssrc/([^">]+)"?\s+name="?([^">]+)"?>!url="file:src/$1" name="$2">!; | ||
109 | s!url="cvs:\?module="?([^">]+)"?\s+name="?([^">]+)"?>!url="file:$1" name="$2">!; | ||
110 | } | ||
111 | ' %{bootstrapfile} \ | ||
112 | %{reqfile} \ | ||
113 | SCRAMToolBox/CMS/Configuration/CMSconfiguration | ||
114 | |||
115 | # Handle toolbox | ||
116 | pwd | ||
117 | perl -p -i -e ' | ||
118 | # Replace base locations | ||
119 | s!cvs://.*/(SPITOOLS|SCRAMToolBox)\?[^">]+!file:%_builddir/SCRAMToolBox/!; | ||
120 | s!cvs://.*/(SPITOOLS|scramtoolbox)\?[^">]+!file:%_builddir/SCRAMToolBox/!; | ||
121 | s!cvs://.*/%cvsdir\?[^">]+!file:%_builddir/!; | ||
122 | s!url="cvs:\?module="?([^">]+)"?\s+name="?([^">]+)"?>!url="file:$1" name="$2">!; | ||
123 | s!url="(cvs:\?module=|file:)SCRAMToolBox/(.*)">!url="file:$2">!; | ||
124 | s!url="(cvs:\?module=|file:)scramtoolbox/(.*)">!url="file:$2">!; | ||
125 | ' SCRAMToolBox/CMS/Configuration/CMSconfiguration | ||
126 | echo $PERL5LIB | ||
127 | echo rm -rf %i | ||
128 | mkdir -p $(dirname %i) | ||
129 | |||
130 | %{?buildarch:%buildarch} | ||
131 | %define realVersion %(echo %v | cut -f1 -d-) | ||
132 | perl -p -i -e 's|%{realVersion}([^-])|%{v}$1|g' %{bootstrapfile} | ||
133 | cp -f %toolconf ./tmpconf | ||
134 | %if "%{cmsplatf}" == "%{gccwrapperarch}" | ||
135 | echo "Using gcc wrapper for %cmsplatf" | ||
136 | perl -p -i -e '$gccpath=$ENV{GCC_ROOT};$wrapperpath=$ENV{GCC_WRAPPER_ROOT};s|$gccpath|$wrapperpath|' ./tmpconf | ||
137 | %endif | ||
138 | scramv1 project -d $(dirname %i) -b %{bootstrapfile} -f ./tmpconf; | ||
139 | mv -f ./tmpconf %{i}/config/site | ||
140 | |||
141 | %build | ||
142 | pwd | ||
143 | # Remove cmt stuff that brings unwanted dependencies: | ||
144 | rm -rf `find %{i}/src -type d -name cmt` | ||
145 | echo `scramv1 arch` | ||
146 | cd %i | ||
147 | echo %toolconf | sed 's|.*tools-||;s|.conf||' > config/site/sitename | ||
148 | cd src | ||
149 | |||
150 | %{?buildarch:%buildarch} | ||
151 | |||
152 | ratnik | 1.4 | # Skip library checks to avoid dependency on seal: |
153 | export SCRAM_NOLOADCHECK=true | ||
154 | export SCRAM_NOSYMCHECK=true | ||
155 | ratnik | 1.1 | |
156 | if [ $(uname) = Darwin ]; then | ||
157 | # scramv1 doesn't know the rpath variable on darwin... | ||
158 | scramv1 b echo_null # ensure lib, bin exist | ||
159 | eval `scramv1 runtime -sh` | ||
160 | export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH | ||
161 | fi | ||
162 | |||
163 | %if "%{?preBuildCommand:set}" == "set" | ||
164 | echo "executing %preBuildCommand" | ||
165 | %preBuildCommand | ||
166 | %endif | ||
167 | |||
168 | %if "%{?buildtarget:set}" != "set" | ||
169 | %define buildtarget %{nil} | ||
170 | %endif | ||
171 | |||
172 | ratnik | 1.5 | #organize log file, turn off plugin building.. |
173 | export BUILD_LOG yes | ||
174 | export SCRAM_NOPLUGINREFRESH yes | ||
175 | ratnik | 1.4 | |
176 | ratnik | 1.1 | scramv1 b -r echo_CXX </dev/null |
177 | %if "%{?prebuildtarget:set}" == "set" | ||
178 | scramv1 b --verbose -f %{prebuildtarget} </dev/null | ||
179 | %endif | ||
180 | ratnik | 1.3 | scramv1 b --verbose -f %{compileOptions} %{makeprocesses} %{buildtarget} </dev/null |
181 | ratnik | 1.1 | %if "%{?additionalBuildTarget0:set}" == "set" |
182 | scramv1 b --verbose -f %{additionalBuildTarget0} < /dev/null | ||
183 | %endif | ||
184 | %if "%{?postbuildtarget:set}" == "set" | ||
185 | scramv1 b --verbose -f %{postbuildtarget} </dev/null | ||
186 | %endif | ||
187 | |||
188 | rm -rf %i/tmp | ||
189 | chmod -R 755 %i %i/.SCRAM | ||
190 | (eval `scramv1 run -sh` ; SealPluginRefresh) || true | ||
191 | ratnik | 1.3 | rm -fR %i/lib/%cmsplatf/.edmplugincache |
192 | (eval `scramv1 run -sh` ; EdmPluginRefresh) || true | ||
193 | ratnik | 1.1 | |
194 | %install | ||
195 | cd %i | ||
196 | %{?buildarch:%buildarch} | ||
197 | perl -p -i -e "s|^#!.*perl(.*)|#!/usr/bin/env perl$1|" $(grep -r -e "^#!.*perl.*" . | cut -d: -f1) | ||
198 | # need writeable directory for profile stuff | ||
199 | mkdir etc | ||
200 | yes | scramv1 install # FIXME: do by hand? | ||
201 | |||
202 | %post | ||
203 | %initenv | ||
204 | source $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/V1_0_3-p1/etc/profile.d/init.sh | ||
205 | cd $RPM_INSTALL_PREFIX/%cmsplatf/cms/%n/%v | ||
206 | perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find config -type f) $(find .SCRAM -type f) | ||
207 | %{?buildarch:%buildarch} | ||
208 | yes | scramv1 install | ||
209 | (rm -rf external/%cmsplatf; ./config/linkexternal.pl --arch %cmsplatf --nolink INCLUDE) || true |