ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/root.spec
Revision: 1.236
Committed: Mon Jan 24 16:50:58 2011 UTC (14 years, 3 months ago) by eulisse
Branch: MAIN
Changes since 1.235: +12 -9 lines
Log Message:
Misc fixes.

* Workaround spurious dependency on """ detected by rpm 4.8. This happens
  because rpm detects the first line of a python script as a shebang
  and the line happens to be the beginning of a multiline comment, i.e. """.
* Remove uname usage and use %cmsos instead.

File Contents

# User Rev Content
1 fwyzard 1.235 ### RPM lcg root 5.27.06b
2 dlange 1.57 ## INITENV +PATH PYTHONPATH %i/lib/python
3 elmer 1.198 ## INITENV SET ROOTSYS %i
4 ratnik 1.106 #Source: cvs://:pserver:cvs@root.cern.ch:2401/user/cvs?passwd=Ah<Z&tag=-rv%(echo %realversion | tr . -)&module=root&output=/%{n}_v%{realversion}.source.tar.gz
5 elmer 1.144 Source: ftp://root.cern.ch/%n/%{n}_v%{realversion}.source.tar.gz
6 muzaffar 1.165 %define closingbrace )
7 elmer 1.179 %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo false;; esac)
8 fwyzard 1.235 %define ismac %(case %cmsplatf in osx*%closingbrace echo true;; *%closingbrace e
9     cho false;; esac)
10 elmer 1.96
11 fwyzard 1.235 Patch0: root-5.27-06-externals
12     Patch1: root-5.27-04-CINT-maxlongline-maxtypedef
13     Patch2: root-5.22-00a-roofit-silence-static-printout
14     Patch3: root-5.22-00d-linker-gnu-hash-style
15     Patch4: root-5.22-00d-TBranchElement-dropped-data-member
16     Patch5: root-5.27-06-fireworks9
17     Patch6: root-5.27-06b-gdb-backtrace
18     Patch7: root-5.27-06-tmva-DecisionTreeNode
19     Patch8: root-5.27-06b-r36567
20     Patch9: root-5.27-06b-r36572
21     Patch10: root-5.27-06b-r36707
22     Patch11: root-5.27-06b-r36594
23     Patch12: root-5.27-06b-tmva-MethodBase-initvar
24     Patch13: root-5.27-06b-tmva_Event_dynamic_hack
25 elmer 1.98
26     %define cpu %(echo %cmsplatf | cut -d_ -f2)
27    
28 fwyzard 1.229 Requires: gccxml gsl libjpg libpng libtiff libungif pcre python fftw3
29 elmer 1.228
30 fwyzard 1.235 %if "%ismac" != "true"
31 elmer 1.228 Requires: castor dcap
32     %endif
33    
34 fwyzard 1.235 %if "%online" != "true"
35     Requires: openssl zlib xrootd
36 elmer 1.228 %endif
37    
38 fwyzard 1.235 %if "%ismac" == "true"
39     Requires: gfortran-macosx
40     %endif
41    
42     %if "%online" != "true"
43     %if "%ismac" != "true"
44     Requires: qt
45     %endif
46 elmer 1.98 %endif
47 eulisse 1.25
48 eulisse 1.1 %prep
49     %setup -n root
50 ratnik 1.106 %patch0 -p1
51     %patch1 -p1
52 elmer 1.205 %patch2 -p1
53 fwyzard 1.235 # patch3 is OS version dependent, see below
54 elmer 1.205 %patch4 -p1
55 elmer 1.149 %patch5 -p1
56 gowdy 1.219 %patch6 -p1
57     %patch7 -p1
58     %patch8 -p1
59     %patch9 -p1
60 fwyzard 1.235 %patch10 -p1
61 gowdy 1.219 %patch11 -p1
62 elmer 1.222 %patch12 -p1
63 elmer 1.228 %patch13 -p1
64    
65 fwyzard 1.235 # The following patch can only be applied on SLC5 or later (extra linker
66 elmer 1.198 # options only available with the SLC5 binutils)
67     case %cmsplatf in
68     slc5_* | slc5onl_* )
69 fwyzard 1.235 %patch3 -p1
70 elmer 1.198 ;;
71     esac
72 eulisse 1.190
73 fwyzard 1.235 # Delete these (irrelevant) files as the fits appear to confuse rpm on OSX
74     # (It tries to run install_name_tool on them.)
75     rm -fR tutorials/fitsio
76    
77 eulisse 1.1 %build
78 andreasp 1.163
79 eulisse 1.1 mkdir -p %i
80 elmer 1.221 export LIBJPG_ROOT
81 elmer 1.14 export ROOTSYS=%_builddir/root
82 elmer 1.180 export PYTHONV=$(echo $PYTHON_VERSION | cut -f1,2 -d.)
83 dlange 1.103
84 muzaffar 1.164 %if "%online" == "true"
85 elmer 1.181 # Use system qt. Also skip xrootd and odbc for online case:
86 ratnik 1.111
87 muzaffar 1.164 EXTRA_CONFIG_ARGS="--with-f77=/usr
88 ratnik 1.111 --disable-odbc
89 fwyzard 1.235 --disable-qt --disable-qtgsi --disable-astiff"
90 dlange 1.103 %else
91 elmer 1.221 export LIBPNG_ROOT ZLIB_ROOT LIBTIFF_ROOT LIBUNGIF_ROOT
92 muzaffar 1.164 EXTRA_CONFIG_ARGS="--with-f77=${GCC_ROOT}
93 ratnik 1.106 --enable-qt --with-qt-libdir=${QT_ROOT}/lib --with-qt-incdir=${QT_ROOT}/include
94     --with-ssl-incdir=${OPENSSL_ROOT}/include
95 muzaffar 1.164 --with-ssl-libdir=${OPENSSL_ROOT}/lib
96     --enable-qtgsi"
97 dlange 1.103 %endif
98    
99 muzaffar 1.164 CONFIG_ARGS="--enable-table
100 eulisse 1.20 --disable-builtin-pcre
101     --disable-builtin-freetype
102     --disable-builtin-zlib
103 elmer 1.98 --with-gccxml=${GCCXML_ROOT}
104 elmer 1.180 --enable-python --with-python-libdir=${PYTHON_ROOT}/lib --with-python-incdir=${PYTHON_ROOT}/include/python${PYTHONV}
105 eulisse 1.2 --enable-explicitlink
106 eulisse 1.20 --enable-mathmore
107 eulisse 1.2 --enable-reflex
108     --enable-cintex
109     --enable-minuit2
110 elmer 1.221 --enable-fftw3
111     --with-fftw3-incdir=${FFTW3_ROOT}/include
112     --with-fftw3-libdir=${FFTW3_ROOT}/lib
113 elmer 1.98 --disable-ldap
114 gowdy 1.143 --disable-krb5
115 fwyzard 1.235 --with-xrootd=${XROOTD_ROOT}
116 eulisse 1.34 --with-gsl-incdir=${GSL_ROOT}/include
117     --with-gsl-libdir=${GSL_ROOT}/lib
118 elmer 1.59 --with-dcap-libdir=${DCAP_ROOT}/lib
119 elmer 1.98 --with-dcap-incdir=${DCAP_ROOT}/include
120     --disable-pgsql
121 elmer 1.181 --disable-mysql
122 fwyzard 1.234 --disable-oracle
123 elmer 1.187 --disable-xml ${EXTRA_CONFIG_ARGS}"
124 elmer 1.98
125 eulisse 1.236 case %cmsos in
126     slc*_amd64)
127 fwyzard 1.235 ./configure linuxx8664gcc $CONFIG_ARGS --with-rfio-libdir=${CASTOR_ROOT}/lib --with-rfio-incdir=${CASTOR_ROOT}/include/shift --with-castor-libdir=${CASTOR_ROOT}/lib --with-castor-incdir=${CASTOR_ROOT}/include/shift ;;
128 eulisse 1.236 slc*_ia32)
129 fwyzard 1.235 ./configure linux $CONFIG_ARGS --with-rfio-libdir=${CASTOR_ROOT}/lib --with-rfio-incdir=${CASTOR_ROOT}/include/shift --with-castor-libdir=${CASTOR_ROOT}/lib --with-castor-incdir=${CASTOR_ROOT}/include/shift ;;
130 eulisse 1.236 osx*)
131 elmer 1.198 case %cmsplatf in
132     *_ia32_* )
133 fwyzard 1.235 comparch=i386
134     macconfig=macosx
135     ;;
136 elmer 1.198 *_amd64_* )
137 fwyzard 1.235 comparch=x86_64
138     macconfig=macosx64
139     ;;
140 elmer 1.198 * )
141 fwyzard 1.235 comparch=ppc
142     macconfig=macosx
143     ;;
144 elmer 1.198 esac
145 eulisse 1.236 export CC=`which gcc` CXX=`which g++`
146     ./configure $arch $CONFIG_ARGS --with-cc="$CC" --with-cxx="$CXX" --disable-rfio --disable-builtin_afterimage ;;
147     slc*_ppc64*)
148 elmer 1.98 ./configure linux $CONFIG_ARGS --disable-rfio;;
149 eulisse 1.1 esac
150 eulisse 1.2
151 eulisse 1.147 case %cmsplatf in
152     osx*)
153     makeopts=
154     ;;
155     *)
156     makeopts="%makeprocesses"
157     ;;
158     esac
159 eulisse 1.236
160     make $makeopts
161 eulisse 1.20 make cintdlls
162 eulisse 1.147
163 eulisse 1.1 %install
164     # Override installers if we are using GNU fileutils cp. On OS X
165     # ROOT's INSTALL is defined to "cp -pPR", which only works with
166     # the system cp (/bin/cp). If you have fileutils on fink, you
167     # lose. Check which one is getting picked up and select syntax
168     # accordingly. (FIXME: do we need to check that -P is accepted?)
169     if (cp --help | grep -e '-P.*--parents') >/dev/null 2>&1; then
170     cp="cp -dpR"
171     else
172     cp="cp -pPR"
173     fi
174    
175 dlange 1.57 export ROOTSYS=%i
176 eulisse 1.5 make INSTALL="$cp" INSTALLDATA="$cp" install
177 dlange 1.57 mkdir -p $ROOTSYS/lib/python
178 elmer 1.141 cp -r cint/reflex/python/genreflex $ROOTSYS/lib/python
179 eulisse 1.236 # This file confuses rpm's find-requires because it starts with
180     # a """ and it thinks is the shebang.
181     rm -f %i/tutorials/pyroot/mrt.py
182 elmer 1.204
183     # SCRAM ToolBox toolfile
184     mkdir -p %i/etc/scram.d
185     # rootcore toolfile
186     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootcore.xml
187     <tool name="rootcore" version="%v">
188     <info url="http://root.cern.ch/root/"/>
189     <lib name="Tree"/>
190     <lib name="Net"/>
191     <lib name="Thread"/>
192     <lib name="MathCore"/>
193     <lib name="RIO"/>
194     <lib name="Core"/>
195     <lib name="Cint"/>
196     <client>
197     <environment name="ROOTCORE_BASE" default="%i"/>
198     <environment name="LIBDIR" default="$ROOTCORE_BASE/lib"/>
199     <environment name="INCLUDE" default="$ROOTCORE_BASE/include"/>
200     <environment name="INCLUDE" default="$ROOTCORE_BASE/cint"/>
201     </client>
202     <runtime name="PATH" value="$ROOTCORE_BASE/bin" type="path"/>
203     <runtime name="ROOTSYS" value="$ROOTCORE_BASE/"/>
204     <runtime name="PYTHONPATH" value="$ROOTCORE_BASE/lib" type="path"/>
205     <use name="sockets"/>
206     <use name="pcre"/>
207     <use name="zlib"/>
208     </tool>
209     EOF_TOOLFILE
210    
211     # root toolfile, alias for rootphysics. Using rootphysics is preferred.
212     cat << \EOF_TOOLFILE >%i/etc/scram.d/root.xml
213     <tool name="root" version="%v">
214     <info url="http://root.cern.ch/root/"/>
215     <use name="rootphysics"/>
216     </tool>
217     EOF_TOOLFILE
218    
219     # roothistmatrix toolfile
220     cat << \EOF_TOOLFILE >%i/etc/scram.d/roothistmatrix.xml
221 fwyzard 1.235 <tool name="roothistmatrix" version="%v">
222 elmer 1.204 <info url="http://root.cern.ch/root/"/>
223     <lib name="Hist"/>
224     <lib name="Matrix"/>
225     <use name="ROOTCore"/>
226     </tool>
227     EOF_TOOLFILE
228    
229     # rootgpad toolfile
230     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootgpad.xml
231 fwyzard 1.235 <tool name="rootgpad" version="%v">
232 elmer 1.204 <info url="http://root.cern.ch/root/"/>
233     <lib name="Gpad"/>
234     <lib name="Graf"/>
235     <use name="roothistmatrix"/>
236     </tool>
237     EOF_TOOLFILE
238    
239     # rootphysics toolfile
240     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootphysics.xml
241     <tool name="rootphysics" version="%v">
242     <info url="http://root.cern.ch/root/"/>
243     <lib name="Physics"/>
244     <use name="roothistmatrix"/>
245     </tool>
246     EOF_TOOLFILE
247    
248     # rootgraphics toolfile, identical to old "root" toolfile
249     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootgraphics.xml
250     <tool name="rootgraphics" version="%v">
251     <info url="http://root.cern.ch/root/"/>
252     <lib name="TreePlayer"/>
253     <lib name="Graf3d"/>
254     <lib name="Postscript"/>
255     <use name="rootgpad"/>
256     </tool>
257     EOF_TOOLFILE
258    
259     # rootcintex toolfile
260     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootcintex.xml
261     <tool name="rootcintex" version="%v">
262     <info url="http://root.cern.ch/root/"/>
263     <lib name="Cintex"/>
264     <use name="ROOTRflx"/>
265     <use name="ROOTCore"/>
266     </tool>
267     EOF_TOOLFILE
268    
269     # rootinteractive toolfile (GQt/qt lib dependencies
270     # have been moved to rootqt.xml)
271     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootinteractive.xml
272     <tool name="rootinteractive" version="%v">
273     <info url="http://root.cern.ch/root/"/>
274     <lib name="Rint"/>
275     <lib name="Gui"/>
276     <use name="libjpg"/>
277     <use name="libpng"/>
278     <use name="rootgpad"/>
279     </tool>
280     EOF_TOOLFILE
281    
282     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootqt.xml
283     <tool name="rootqt" version="%v">
284     <info url="http://root.cern.ch/root/"/>
285     <lib name="GQt"/>
286     <use name="qt"/>
287     </tool>
288     EOF_TOOLFILE
289    
290     # rootmath toolfile
291     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootmath.xml
292     <tool name="rootmath" version="%v">
293     <info url="http://root.cern.ch/root/"/>
294     <lib name="GenVector"/>
295     <lib name="MathMore"/>
296     <use name="ROOTCore"/>
297     <use name="gsl"/>
298     </tool>
299     EOF_TOOLFILE
300    
301     # rootminuit toolfile
302     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootminuit.xml
303     <tool name="rootminuit" version="%v">
304     <info url="http://root.cern.ch/root/"/>
305     <lib name="Minuit"/>
306     <use name="rootgpad"/>
307     </tool>
308     EOF_TOOLFILE
309    
310     # rootminuit2 toolfile
311     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootminuit2.xml
312     <tool name="rootminuit2" version="%v">
313     <info url="http://root.cern.ch/root/"/>
314     <lib name="Minuit2"/>
315     <use name="rootgpad"/>
316     </tool>
317     EOF_TOOLFILE
318    
319     # rootrflx toolfile
320     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootrflx.xml
321     <tool name="rootrflx" version="%v">
322     <info url="http://root.cern.ch/root/"/>
323     <lib name="Reflex"/>
324     <client>
325     <environment name="ROOTRFLX_BASE" default="%i"/>
326     <environment name="LIBDIR" default="$ROOTRFLX_BASE/lib"/>
327     <environment name="INCLUDE" default="$ROOTRFLX_BASE/include"/>
328     </client>
329     <runtime name="PATH" value="$ROOTRFLX_BASE/bin" type="path"/>
330     <runtime name="ROOTSYS" value="$ROOTRFLX_BASE/"/>
331     <runtime name="GENREFLEX" value="$ROOTRFLX_BASE/bin/genreflex"/>
332     <use name="sockets"/>
333     <use name="gccxml"/>
334     </tool>
335     EOF_TOOLFILE
336    
337     # roothtml toolfile
338     cat << \EOF_TOOLFILE >%i/etc/scram.d/roothtml.xml
339     <tool name="roothtml" version="%v">
340     <info url="http://root.cern.ch/root/"/>
341     <lib name="Html"/>
342     <use name="rootgpad"/>
343     </tool>
344     EOF_TOOLFILE
345    
346     # rootmlp toolfile
347     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootmlp.xml
348     <tool name="rootmlp" version="%v">
349     <info url="http://root.cern.ch/root/"/>
350     <lib name="MLP"/>
351     <use name="RootGraphics"/>
352     </tool>
353     EOF_TOOLFILE
354    
355     # roottmva toolfile
356     cat << \EOF_TOOLFILE >%i/etc/scram.d/roottmva.xml
357     <tool name="roottmva" version="%v">
358     <info url="http://root.cern.ch/root/"/>
359     <lib name="TMVA"/>
360     <use name="ROOTMLP"/>
361     <use name="rootminuit"/>
362     </tool>
363     EOF_TOOLFILE
364    
365     # rootthread toolfile
366     cat << \EOF_TOOLFILE >%i/etc/scram.d/rootthread.xml
367     <tool name="rootthread" version="%v">
368     <info url="http://root.cern.ch/root/"/>
369     <use name="ROOTCore"/>
370     </tool>
371     EOF_TOOLFILE
372    
373     %post
374     perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $(find $RPM_INSTALL_PREFIX/%pkgrel/etc/scram.d -type f)
375 fwyzard 1.235