ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/fwlite.spec
Revision: 1.3
Committed: Mon Jun 11 20:12:00 2007 UTC (17 years, 10 months ago) by ratnik
Branch: MAIN
Changes since 1.2: +6 -4 lines
Log Message:
Updated for CMSSW_1_5_0_pre5:
 - new packages list based on fwlite_application_set.file rev 1.2
 - cleanup externals list: removed dependency on xerces-c, f77compiler,
   and python, the latter will probably come from root rpm anyway.

Merged in changes from scramv1-build.file rev. 1.53, used for CMSSW_1_5_0_pre5:
 - added  %{compileOptions} in build command (-k)
 - run EdmPluginRefresh

File Contents

# Content
1 ### RPM cms fwlite CMSSW_1_5_0_pre5_FWLITE
2 ## 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 %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 %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 # 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
26 %define externals "cxxcompiler ccompiler clhep sockets seal 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
28 %define packages "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
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 %define bootstrapfile config/%{application}_bootsrc
50 %define reqfile config/%{application}_requirements
51
52
53 cd %_builddir
54
55 # Create bootstrap file for fwlite:
56 cp config/bootsrc %bootstrapfile
57 perl -p -i -e '
58 # s!(<project.*name=)CMSSW(.*version=)CMSSW(.*)!$1%projectname$2%projectname$3!;
59 s!(<project.*name=CMSSW.*version=)%cmssw_release(.*)!$1%v$2!;
60 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 # for file in config/CMSSW_*.tmpl; do cat $file > `echo $file | sed s'/CMSSW/%{projectname}/'`; done
82
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 # export SCRAM_NOSYMCHECK=true
153
154 if [ $(uname) = Darwin ]; then
155 # scramv1 doesn't know the rpath variable on darwin...
156 scramv1 b echo_null # ensure lib, bin exist
157 eval `scramv1 runtime -sh`
158 export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
159 fi
160
161 %if "%{?preBuildCommand:set}" == "set"
162 echo "executing %preBuildCommand"
163 %preBuildCommand
164 %endif
165
166 %if "%{?buildtarget:set}" != "set"
167 %define buildtarget %{nil}
168 %endif
169
170 scramv1 b -r echo_CXX </dev/null
171 %if "%{?prebuildtarget:set}" == "set"
172 scramv1 b --verbose -f %{prebuildtarget} </dev/null
173 %endif
174 scramv1 b --verbose -f %{compileOptions} %{makeprocesses} %{buildtarget} </dev/null
175 %if "%{?additionalBuildTarget0:set}" == "set"
176 scramv1 b --verbose -f %{additionalBuildTarget0} < /dev/null
177 %endif
178 %if "%{?postbuildtarget:set}" == "set"
179 scramv1 b --verbose -f %{postbuildtarget} </dev/null
180 %endif
181
182 rm -rf %i/tmp
183 chmod -R 755 %i %i/.SCRAM
184 (eval `scramv1 run -sh` ; SealPluginRefresh) || true
185 rm -fR %i/lib/%cmsplatf/.edmplugincache
186 (eval `scramv1 run -sh` ; EdmPluginRefresh) || true
187
188 %install
189 cd %i
190 %{?buildarch:%buildarch}
191 perl -p -i -e "s|^#!.*perl(.*)|#!/usr/bin/env perl$1|" $(grep -r -e "^#!.*perl.*" . | cut -d: -f1)
192 # need writeable directory for profile stuff
193 mkdir etc
194 yes | scramv1 install # FIXME: do by hand?
195
196 %post
197 %initenv
198 source $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/V1_0_3-p1/etc/profile.d/init.sh
199 cd $RPM_INSTALL_PREFIX/%cmsplatf/cms/%n/%v
200 perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find config -type f) $(find .SCRAM -type f)
201 %{?buildarch:%buildarch}
202 yes | scramv1 install
203 (rm -rf external/%cmsplatf; ./config/linkexternal.pl --arch %cmsplatf --nolink INCLUDE) || true
204 (cd $RPM_INSTALL_PREFIX/%pkgrel; eval `scramv1 run -sh`; SealPluginRefresh) || true