1 |
< |
### RPM cms fwlite CMSSW_1_5_0_pre5_FWLITE |
1 |
> |
### RPM cms fwlite CMSSW_1_7_0_pre6_FWLITE |
2 |
|
## IMPORT configurations |
3 |
|
Provides: /bin/zsh |
4 |
+ |
Requires: fwlite-tool-conf glimpse |
5 |
|
Requires: SCRAMV1 |
6 |
< |
Requires: fwlite-tool-conf |
7 |
< |
Requires: gcc-wrapper |
8 |
< |
%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 |
6 |
> |
%define cmssw_release %(perl -e '$_="%v"; s/_FWLITE//; print;') |
7 |
> |
%define ucprojname CMSSW |
8 |
> |
%define lcprojname cmssw |
9 |
|
|
18 |
– |
%define toolconf ${FWLITE_TOOL_CONF_ROOT}/configurations/tools-STANDALONE.conf |
10 |
|
%define prebuildtarget gindices |
11 |
|
%define buildtarget release-build |
12 |
< |
%define postbuildtarget doc |
12 |
> |
%define saveDeps yes |
13 |
> |
%define cvsproj %cvsprojuc |
14 |
> |
%define srctree src |
15 |
|
|
16 |
< |
# Following dependencies were not detected by ignominy, but required in the BuildFiles: |
17 |
< |
# boost_program_options boost_regex bz2lib pcre root rootcintex uuid zlib |
16 |
> |
#%define scram_xml .xml |
17 |
> |
%define scram_xml %{nil} |
18 |
> |
%define scramcmd scramv1 |
19 |
|
|
20 |
< |
%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" |
20 |
> |
# NR: allow to change tarball names, otherwise old distributions |
21 |
> |
# are fetched from the apt SOURCE repository. |
22 |
|
|
23 |
< |
%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" |
23 |
> |
%if "%{?configtar:set}" != "set" |
24 |
> |
%define configtar config.tar.gz |
25 |
> |
%endif |
26 |
|
|
27 |
< |
%prep |
27 |
> |
%define cmsswsrc http://cmsrep.cern.ch/cms/cpt/Software/download/cms/SOURCES/cms/cmssw/%{cmssw_release} |
28 |
> |
# For partial releases re-using CMSSW sources: |
29 |
> |
%if "%{?cmsswsrc:set}" == "set" |
30 |
> |
Source0: %{cmsswsrc}/config.tar.gz |
31 |
> |
Source1: %{cmsswsrc}/src.tar.gz |
32 |
> |
%endif |
33 |
> |
|
34 |
> |
# List of packages to bootstrap for partial builds: |
35 |
> |
Source2: fwlite_build_set |
36 |
> |
Source3: cmssw-tool |
37 |
> |
Source4: findDependencies.pl |
38 |
|
|
39 |
+ |
# Switch off building tests: |
40 |
+ |
%define patchsrc perl -p -i -e ' s!(<ClassPath.*test\\+test>)!#$1!;' config/BuildFile |
41 |
+ |
|
42 |
+ |
%prep |
43 |
+ |
rm -rf config |
44 |
+ |
rm -rf %{srctree} |
45 |
|
# Create a SCRAM project area, but using the already extracted |
46 |
|
# sources. In other words, pick up the files from the project config |
47 |
|
# area, but munge all instances of <base url="cvs:*"> into a local |
48 |
|
# reference so SCRAM won't try to download stuff from the network. |
49 |
|
|
50 |
< |
%setup -T -b 0 -n SCRAMToolBox |
51 |
< |
%setup -D -T -b 1 -n config |
52 |
< |
%setup -D -T -b 2 -n src |
53 |
< |
|
54 |
< |
|
55 |
< |
# Update requirements: |
56 |
< |
|
57 |
< |
%if "%{buildarch:set}" != "set" |
58 |
< |
%define buildarch : |
59 |
< |
%endif |
60 |
< |
|
61 |
< |
# NR: Allow to define bootstrap and requirements file names |
62 |
< |
%define bootstrapfile config/%{application}_bootsrc |
63 |
< |
%define reqfile config/%{application}_requirements |
64 |
< |
|
50 |
> |
%setup -T -b 0 -n config |
51 |
> |
%setup -D -T -b 1 -n %{srctree} |
52 |
> |
#%setup -D -T -a 2 -n %{srctree} |
53 |
> |
|
54 |
> |
touch %_builddir/config/%{ucprojname}_ignore.file |
55 |
> |
for file in `ls %_builddir/config/%{ucprojname}_*.file | grep -v '/%{ucprojname}_ignore.file$' | sed 's|.*/%{ucprojname}_||;s|.file$||'`; do |
56 |
> |
sed 's|@PROJECT_NAME@|%ucprojname|g;s|@PROJECT_VERSION@|%v|g;s|@PROJECT_BUILD_PATH@|%_builddir|g' %_builddir/config/%{ucprojname}_${file}.file > %_builddir/config/${file} |
57 |
> |
done |
58 |
> |
if [ ${FWLITE_TOOL_CONF_ROOT}/configurations/requirements%scram_xml ] ; then |
59 |
> |
cp ${FWLITE_TOOL_CONF_ROOT}/configurations/requirements%scram_xml %_builddir/config/ |
60 |
> |
fi |
61 |
> |
rm -f %_builddir/config/%{ucprojname}_ignore.file |
62 |
> |
rm -rf %_builddir/config/site |
63 |
> |
cp -rf ${FWLITE_TOOL_CONF_ROOT}/configurations/SCRAMToolBox/CMSconfigs %_builddir/config/site |
64 |
> |
echo $SCRAMV1_VERSION > %_builddir/config/scram_version |
65 |
|
|
66 |
+ |
pwd |
67 |
|
cd %_builddir |
68 |
+ |
%{?patchsrc:%patchsrc} |
69 |
|
|
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 |
70 |
|
echo $PERL5LIB |
71 |
|
echo rm -rf %i |
72 |
|
mkdir -p $(dirname %i) |
73 |
|
|
74 |
|
%{?buildarch:%buildarch} |
75 |
< |
%define realVersion %(echo %v | cut -f1 -d-) |
76 |
< |
perl -p -i -e 's|%{realVersion}([^-])|%{v}$1|g' %{bootstrapfile} |
77 |
< |
cp -f %toolconf ./tmpconf |
78 |
< |
%if "%{cmsplatf}" == "%{gccwrapperarch}" |
79 |
< |
echo "Using gcc wrapper for %cmsplatf" |
80 |
< |
perl -p -i -e '$gccpath=$ENV{GCC_ROOT};$wrapperpath=$ENV{GCC_WRAPPER_ROOT};s|$gccpath|$wrapperpath|' ./tmpconf |
81 |
< |
%endif |
82 |
< |
scramv1 project -d $(dirname %i) -b %{bootstrapfile} -f ./tmpconf; |
83 |
< |
mv -f ./tmpconf %{i}/config/site |
75 |
> |
export SCRAM_TOOLBOXVERSION=%cmssw_release |
76 |
> |
|
77 |
> |
mv config/bootsrc config/bootsrc_orig |
78 |
> |
|
79 |
> |
perl -p -e 'if (s/(<download.*)(file:src)(.*)(name="src)(">)/#$1$2$3$4$5/){open $fh, "%_sourcedir/fwlite_build_set" or die; while(readline $fh){chomp;print "$1$2/$_$3$4/$_$5\n"}}' config/bootsrc_orig > config/bootsrc |
80 |
> |
|
81 |
> |
%scramcmd project -d $(dirname %i) -b config/bootsrc -f %_builddir/config/site/tools-`cat %_builddir/config/site/sitename`.conf |
82 |
> |
perl -p -i -e "s|STANDALONE|%v|" %i/.SCRAM/Environment* %i/.SCRAM/%cmsplatf/ToolCache.db |
83 |
> |
cd %i |
84 |
> |
%scramcmd setup |
85 |
|
|
86 |
|
%build |
87 |
|
pwd |
88 |
|
# Remove cmt stuff that brings unwanted dependencies: |
89 |
|
rm -rf `find %{i}/src -type d -name cmt` |
90 |
< |
echo `scramv1 arch` |
90 |
> |
echo `%scramcmd arch` |
91 |
|
cd %i |
147 |
– |
echo %toolconf | sed 's|.*tools-||;s|.conf||' > config/site/sitename |
92 |
|
cd src |
93 |
|
|
94 |
|
%{?buildarch:%buildarch} |
95 |
|
|
96 |
< |
# Skip library checks to avoid dependency on seal: |
97 |
< |
export SCRAM_NOLOADCHECK=true |
98 |
< |
export SCRAM_NOSYMCHECK=true |
96 |
> |
export BUILD_LOG=yes |
97 |
> |
export SCRAM_NOPLUGINREFRESH=yes |
98 |
> |
# export SCRAM_NOSYMCHECK=true |
99 |
|
|
100 |
|
if [ $(uname) = Darwin ]; then |
101 |
< |
# scramv1 doesn't know the rpath variable on darwin... |
102 |
< |
scramv1 b echo_null # ensure lib, bin exist |
103 |
< |
eval `scramv1 runtime -sh` |
101 |
> |
# %scramcmd doesn't know the rpath variable on darwin... |
102 |
> |
%scramcmd b echo_null # ensure lib, bin exist |
103 |
> |
eval `%scramcmd runtime -sh` |
104 |
|
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH |
105 |
|
fi |
106 |
|
|
107 |
+ |
export SCRAM_NOLOADCHECK=true |
108 |
+ |
export SCRAM_NOSYMCHECK=true |
109 |
+ |
|
110 |
|
%if "%{?preBuildCommand:set}" == "set" |
111 |
|
echo "executing %preBuildCommand" |
112 |
|
%preBuildCommand |
116 |
|
%define buildtarget %{nil} |
117 |
|
%endif |
118 |
|
|
119 |
< |
#organize log file, turn off plugin building.. |
173 |
< |
export BUILD_LOG yes |
174 |
< |
export SCRAM_NOPLUGINREFRESH yes |
175 |
< |
|
176 |
< |
scramv1 b -r echo_CXX </dev/null |
119 |
> |
%scramcmd b -r echo_CXX </dev/null |
120 |
|
%if "%{?prebuildtarget:set}" == "set" |
121 |
< |
scramv1 b --verbose -f %{prebuildtarget} </dev/null |
121 |
> |
%scramcmd b --verbose -f %{prebuildtarget} </dev/null |
122 |
|
%endif |
123 |
< |
scramv1 b --verbose -f %{compileOptions} %{makeprocesses} %{buildtarget} </dev/null |
123 |
> |
%scramcmd b --verbose -f %{compileOptions} %{makeprocesses} %{buildtarget} </dev/null |
124 |
|
%if "%{?additionalBuildTarget0:set}" == "set" |
125 |
< |
scramv1 b --verbose -f %{additionalBuildTarget0} < /dev/null |
125 |
> |
%scramcmd b --verbose -f %{additionalBuildTarget0} < /dev/null |
126 |
|
%endif |
127 |
|
%if "%{?postbuildtarget:set}" == "set" |
128 |
< |
scramv1 b --verbose -f %{postbuildtarget} </dev/null |
128 |
> |
%scramcmd b --verbose -f %{postbuildtarget} </dev/null |
129 |
|
%endif |
130 |
|
|
131 |
+ |
# strip out dependencies first... |
132 |
+ |
%if "%{?saveDeps:set}" == "set" |
133 |
+ |
mkdir -p %i/etc/dependencies |
134 |
+ |
chmod +x %{_sourcedir}/findDependencies.pl |
135 |
+ |
%{_sourcedir}/findDependencies.pl -rel %i |
136 |
+ |
gzip %i/etc/dependencies/uses.out |
137 |
+ |
gzip %i/etc/dependencies/usedby.out |
138 |
+ |
%endif |
139 |
+ |
|
140 |
+ |
|
141 |
|
rm -rf %i/tmp |
142 |
|
chmod -R 755 %i %i/.SCRAM |
143 |
< |
(eval `scramv1 run -sh` ; SealPluginRefresh) || true |
143 |
> |
(eval `%scramcmd run -sh` ; SealPluginRefresh) || true |
144 |
|
rm -fR %i/lib/%cmsplatf/.edmplugincache |
145 |
< |
(eval `scramv1 run -sh` ; EdmPluginRefresh) || true |
145 |
> |
(eval `%scramcmd run -sh` ; EdmPluginRefresh) || true |
146 |
|
|
147 |
|
%install |
148 |
|
cd %i |
149 |
|
%{?buildarch:%buildarch} |
150 |
|
perl -p -i -e "s|^#!.*perl(.*)|#!/usr/bin/env perl$1|" $(grep -r -e "^#!.*perl.*" . | cut -d: -f1) |
151 |
|
# need writeable directory for profile stuff |
152 |
< |
mkdir etc |
153 |
< |
yes | scramv1 install # FIXME: do by hand? |
152 |
> |
mkdir -p etc/scram.d |
153 |
> |
sed 's|@PROJECT_NAME@|%ucprojname|g;s|@PROJECT_VERSION@|%v|g;s|@PROJECT_BUILD_PATH@|%_builddir|g;s|@PROJECT_ROOT@|%i|g' %_sourcedir/%lcprojname-tool > etc/scram.d/%lcprojname |
154 |
> |
yes | %scramcmd install # FIXME: do by hand? |
155 |
|
|
156 |
|
%post |
157 |
< |
%initenv |
158 |
< |
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 |
157 |
> |
cd $RPM_INSTALL_PREFIX/%pkgrel |
158 |
> |
%{relocateConfig}etc/scram.d/%lcprojname |
159 |
|
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find config -type f) $(find .SCRAM -type f) |
160 |
+ |
scramver=`cat config/scram_version` |
161 |
+ |
source $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/$scramver/etc/profile.d/init.sh |
162 |
|
%{?buildarch:%buildarch} |
163 |
< |
yes | scramv1 install |
163 |
> |
yes | %scramcmd install |
164 |
|
(rm -rf external/%cmsplatf; ./config/linkexternal.pl --arch %cmsplatf --nolink INCLUDE) || true |
165 |
+ |
eval `%scramcmd run -sh` |
166 |
+ |
for cmd in SealPluginRefresh EdmPluginRefresh IgPluginRefresh ; do |
167 |
+ |
cmdpath=`which $cmd 2> /dev/null` |
168 |
+ |
if [ "X$cmdpath" != X ] ; then |
169 |
+ |
$cmd || true |
170 |
+ |
fi |
171 |
+ |
done |