1 |
< |
### RPM cms fwlite CMSSW_1_5_0_pre5_FWLITE |
1 |
> |
### RPM cms fwlite CMSSW_1_6_8_FWLITE-root51800 |
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 |
< |
|
4 |
> |
Requires: fwlite-tool-conf |
5 |
> |
%define cmssw_release %(perl -e '$_="%v"; s/_FWLITE-root51800//; print;') |
6 |
|
%define toolconf ${FWLITE_TOOL_CONF_ROOT}/configurations/tools-STANDALONE.conf |
7 |
< |
%define prebuildtarget gindices |
7 |
> |
|
8 |
> |
#Defines for file containing list of packages for checkout and build: |
9 |
> |
%define buildsetrepo CMSDIST |
10 |
> |
%define buildsetfile fwlite_build_set.file |
11 |
> |
%define buildsetvers buildset_V3_3 |
12 |
> |
|
13 |
> |
# Define list of external tools to be selected in scram configuration. |
14 |
> |
# Any changes must be propagated in fwlite-tool-conf.spec: |
15 |
> |
%define externals "cxxcompiler ccompiler clhep sockets boost boost_filesystem boost_python boost_regex boost_program_options root rootcintex rootrflx rootcore rootmath gccxml python elementtree sigcpp hepmc gsl bz2lib pcre zlib dcap libjpg openssl expat" |
16 |
> |
|
17 |
|
%define buildtarget release-build |
21 |
– |
%define postbuildtarget doc |
18 |
|
|
19 |
< |
# Following dependencies were not detected by ignominy, but required in the BuildFiles: |
20 |
< |
# boost_program_options boost_regex bz2lib pcre root rootcintex uuid zlib |
19 |
> |
# Skip library load and symbol checks to avoid dependency on seal: |
20 |
> |
%define nolibchecks on |
21 |
> |
|
22 |
> |
# Switch off building tests: |
23 |
> |
%define patchsrc3 perl -p -i -e ' s!(<ClassPath.*test\\+test>)!#$1!;' config/BuildFile |
24 |
|
|
25 |
< |
%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" |
25 |
> |
# Additional source patches named patchsrc4, patchsrc5 can be defined here. |
26 |
> |
%define patchsrc4 perl -p -i -e '/<lib name=Tree>/ && print "<lib name=Net>\n<lib name=RIO>\n";' SCRAMToolBox/General/ROOTCore |
27 |
|
|
28 |
< |
%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" |
28 |
> |
%define patchsrc5 perl -p -i -e 's/slc4_ia32_gcc345/%cmsplatf/' SCRAMToolBox/System/Sockets SCRAMToolBox/System/Sockets.xml |
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 |
< |
# Skip library checks to avoid dependency on seal: |
153 |
< |
export SCRAM_NOLOADCHECK=true |
154 |
< |
export SCRAM_NOSYMCHECK=true |
155 |
< |
|
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 |
< |
|
173 |
< |
scramv1 b -r echo_CXX </dev/null |
174 |
< |
%if "%{?prebuildtarget:set}" == "set" |
175 |
< |
scramv1 b --verbose -f %{prebuildtarget} </dev/null |
176 |
< |
%endif |
177 |
< |
scramv1 b --verbose -f %{compileOptions} %{makeprocesses} %{buildtarget} </dev/null |
178 |
< |
%if "%{?additionalBuildTarget0:set}" == "set" |
179 |
< |
scramv1 b --verbose -f %{additionalBuildTarget0} < /dev/null |
180 |
< |
%endif |
181 |
< |
%if "%{?postbuildtarget:set}" == "set" |
182 |
< |
scramv1 b --verbose -f %{postbuildtarget} </dev/null |
183 |
< |
%endif |
184 |
< |
|
185 |
< |
rm -rf %i/tmp |
186 |
< |
chmod -R 755 %i %i/.SCRAM |
187 |
< |
(eval `scramv1 run -sh` ; SealPluginRefresh) || true |
188 |
< |
rm -fR %i/lib/%cmsplatf/.edmplugincache |
189 |
< |
(eval `scramv1 run -sh` ; EdmPluginRefresh) || true |
190 |
< |
|
191 |
< |
%install |
192 |
< |
cd %i |
193 |
< |
%{?buildarch:%buildarch} |
194 |
< |
perl -p -i -e "s|^#!.*perl(.*)|#!/usr/bin/env perl$1|" $(grep -r -e "^#!.*perl.*" . | cut -d: -f1) |
195 |
< |
# need writeable directory for profile stuff |
196 |
< |
mkdir etc |
197 |
< |
yes | scramv1 install # FIXME: do by hand? |
198 |
< |
|
199 |
< |
%post |
200 |
< |
%initenv |
201 |
< |
source $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/V1_0_3-p1/etc/profile.d/init.sh |
202 |
< |
cd $RPM_INSTALL_PREFIX/%cmsplatf/cms/%n/%v |
203 |
< |
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find config -type f) $(find .SCRAM -type f) |
204 |
< |
%{?buildarch:%buildarch} |
205 |
< |
yes | scramv1 install |
206 |
< |
(rm -rf external/%cmsplatf; ./config/linkexternal.pl --arch %cmsplatf --nolink INCLUDE) || true |
30 |
> |
## IMPORT cms-scram-build |
31 |
> |
## IMPORT partial-build |
32 |
> |
## IMPORT scramv1-build |