1 |
lat |
1.10 |
### RPM cms overview 5.1.8
|
2 |
lat |
1.1 |
|
3 |
lat |
1.5 |
# This is a RPM spec file for building the Overview. This is a very
|
4 |
|
|
# minimal SCRAM build area with highly reduced set of dependencies.
|
5 |
|
|
# Building Overview does not in fact require SCRAM at all, but this
|
6 |
|
|
# arrangment makes it easier for a developer with CMSSW work area.
|
7 |
|
|
# See DQM GUI spec file for more commentary on what goes on here.
|
8 |
lat |
1.1 |
%define cvsserver cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e
|
9 |
lat |
1.5 |
%define scram $SCRAMV1_ROOT/bin/scram --arch %cmsplatf
|
10 |
lat |
1.9 |
%define cmssw CMSSW_3_5_0
|
11 |
|
|
%define vcfg V03-29-06
|
12 |
lat |
1.1 |
%define initenv export ZZPATH=$PATH ZZLD_LIBRARY_PATH=$LD_LIBRARY_PATH ZZPYTHONPATH=$PYTHONPATH; %initenv_all
|
13 |
|
|
|
14 |
lat |
1.5 |
Source0: %{cvsserver}&strategy=checkout&module=config&export=config&tag=-r%{vcfg}&output=/config.tar.gz
|
15 |
lat |
1.10 |
Source1: %{cvsserver}&strategy=checkout&module=CMSSW/VisMonitoring/DQMServer&export=VisMonitoring/DQMServer&tag=-rR05-01-08&output=/DQMServer.tar.gz
|
16 |
lat |
1.7 |
Requires: cherrypy py2-cheetah yui py2-cx-oracle py2-pil py2-matplotlib overview-conf SCRAMV1
|
17 |
lat |
1.1 |
|
18 |
lat |
1.5 |
# Set up minimal SCRAM project build area with our sources.
|
19 |
lat |
1.1 |
%prep
|
20 |
lat |
1.5 |
rm -fr %_builddir/{config,src,THE_BUILD}
|
21 |
|
|
%setup -T -b 0 -n config
|
22 |
|
|
%setup -c -T -a 1 -n src
|
23 |
|
|
|
24 |
|
|
cd %_builddir
|
25 |
|
|
rm -fr src/Vis*/*/{src,bin,interface,plugins,test}
|
26 |
|
|
tar -jcvf distsrc.tar.bz2 -C src .
|
27 |
lat |
1.1 |
|
28 |
lat |
1.5 |
config/updateConfig.pl -p CMSSW -v THE_BUILD -s $SCRAMV1_VERSION -t ${OVERVIEW_CONF_ROOT}
|
29 |
|
|
%scram project -d $PWD -b config/bootsrc.xml </dev/null
|
30 |
|
|
|
31 |
|
|
%build
|
32 |
|
|
# Build the code as a scram project area, then relocate it to more
|
33 |
|
|
# normal directories (%i/{bin,lib,python}). Save the scram runtime
|
34 |
|
|
# environment plus extra externals for later use, but manipulate
|
35 |
|
|
# the scram environment to point to the installation directories.
|
36 |
|
|
# Avoid generating excess environment.
|
37 |
lat |
1.1 |
%build
|
38 |
lat |
1.5 |
cd %_builddir/THE_BUILD/src
|
39 |
|
|
export BUILD_LOG=yes
|
40 |
|
|
export SCRAM_NOPLUGINREFRESH=yes
|
41 |
|
|
export SCRAM_NOLOADCHECK=true
|
42 |
|
|
export SCRAM_NOSYMCHECK=true
|
43 |
|
|
(%scram build -v -f %makeprocesses </dev/null) || { %scram build outputlog </dev/null && false; }
|
44 |
|
|
|
45 |
|
|
# Now clean up environment. First eliminate non-existent directories
|
46 |
|
|
# from the paths. Then capture the SCRAM run-time environment, and
|
47 |
|
|
# eliminate duplicate path components (from cmsbuild vs. scram), and
|
48 |
|
|
# convert it back to a format that is additive to the user environment
|
49 |
|
|
# (you want the init script to modify your $PATH, not to change it to
|
50 |
|
|
# mine, right!?). Finally munge SCRAM directories to finall install
|
51 |
|
|
# area directories.
|
52 |
|
|
mkdir -p %i/etc/profile.d
|
53 |
lat |
1.1 |
for p in PATH LD_LIBRARY_PATH PYTHONPATH; do
|
54 |
|
|
for z in "" ZZ; do
|
55 |
|
|
eval export $z$p=$(perl -e 'print join(":", grep($_ && -d $_ && scalar(@{[<$_/*>]}) > 0, split(/:/,$ENV{'$z$p'})))')
|
56 |
|
|
done
|
57 |
|
|
done
|
58 |
lat |
1.5 |
removeenv='LOCALRT|CMSSW_(RELEASE_)*(BASE|VERSION|(FWLITE|SEARCH)_[A-Z_]*)|(COIN|IGUANA|SEAL)_[A-Z_]*'
|
59 |
|
|
scram runtime -sh | grep -v SCRAMRT | egrep -v "^export ($removeenv)=" > %i/etc/profile.d/env.sh
|
60 |
|
|
scram runtime -csh | grep -v SCRAMRT | egrep -v "^setenv ($removeenv) " > %i/etc/profile.d/env.csh
|
61 |
|
|
perl -w -i -p -e \
|
62 |
|
|
'BEGIN {
|
63 |
|
|
%%linked = map { s|/+[^/]+$||; ($_ => 1) }
|
64 |
|
|
grep(defined $_, map { readlink $_ }
|
65 |
|
|
<%_builddir/THE_BUILD/external/%cmsplatf/lib/*>);
|
66 |
|
|
}
|
67 |
|
|
foreach $dir (keys %%linked) { s<:$dir([ :;"]|$)><$1>g; }
|
68 |
lat |
1.1 |
foreach $p ("PATH", "LD_LIBRARY_PATH", "PYTHONPATH") {
|
69 |
lat |
1.5 |
s<([ :=])$ENV{"ZZ$p"}([ :;"]|$)><$1\${$p}$2>g if $ENV{"ZZ$p"};
|
70 |
lat |
1.1 |
}
|
71 |
lat |
1.5 |
s<:'"$SCRAMV1_ROOT"'/[a-z]+:><:>g;
|
72 |
|
|
s<:%instroot/common:><:>g;
|
73 |
|
|
s<%_builddir/THE_BUILD/bin/%cmsplatf><%i/bin>g;
|
74 |
|
|
s<%_builddir/THE_BUILD/(lib|module)/%cmsplatf><%i/lib>g;
|
75 |
|
|
s<%_builddir/THE_BUILD/external/%cmsplatf/lib><%i/external>g;
|
76 |
|
|
s<%_builddir/THE_BUILD/python><%i/python>g;
|
77 |
|
|
s<%_builddir/THE_BUILD><%i>g;' \
|
78 |
|
|
%i/etc/profile.d/env.sh %i/etc/profile.d/env.csh
|
79 |
|
|
|
80 |
|
|
(echo "export PATH=%i/xbin:\$PATH;"
|
81 |
|
|
echo "export PYTHONPATH=%i/xlib:%i/xpython:\$PYTHONPATH;"
|
82 |
|
|
echo "export LD_LIBRARY_PATH=%i/xlib:\$LD_LIBRARY_PATH;"
|
83 |
|
|
echo "export YUI_ROOT='$YUI_ROOT';"
|
84 |
|
|
echo "export OVERVIEW_ROOT='%i';"
|
85 |
|
|
echo "export OVERVIEW_CMSSW_VERSION='%{cmssw}';") >> %i/etc/profile.d/env.sh
|
86 |
|
|
|
87 |
|
|
(echo "setenv PATH %i/xbin:\$PATH;"
|
88 |
|
|
echo "setenv PYTHONPATH %i/xlib:%i/xpython:\$PYTHONPATH;"
|
89 |
|
|
echo "setenv LD_LIBRARY_PATH %i/xlib:\$LD_LIBRARY_PATH;"
|
90 |
|
|
echo "setenv YUI_ROOT '$YUI_ROOT';"
|
91 |
|
|
echo "setenv OVERVIEW_ROOT '%i';"
|
92 |
|
|
echo "setenv OVERVIEW_CMSSW_VERSION '%{cmssw}';") >> %i/etc/profile.d/env.csh
|
93 |
|
|
|
94 |
|
|
# Install the project files. Copies from SCRAM area to final install
|
95 |
|
|
# area. Creates scripts to patch and unpatch the server area from a
|
96 |
|
|
# local SCRAM developer area. Creates scripts for server management.
|
97 |
|
|
# Usage at https://twiki.cern.ch/twiki/bin/view/CMS/DQMTest and
|
98 |
|
|
# https://twiki.cern.ch/twiki//bin/view/CMS/DQMGuiProduction.
|
99 |
|
|
%install
|
100 |
|
|
mkdir -p %i/etc/profile.d %i/etc/scramconfig %i/external %i/{,x}bin %i/{,x}lib %i/{,x}python %i/data
|
101 |
|
|
cp -p %_builddir/distsrc.tar.bz2 %i/data
|
102 |
|
|
cp -p %_builddir/THE_BUILD/bin/%cmsplatf/* %i/bin
|
103 |
|
|
cp -p %_builddir/THE_BUILD/src/VisMonitoring/DQMServer/python/*.* %i/python
|
104 |
|
|
tar -C %_builddir/THE_BUILD/external/%cmsplatf/lib -cf - . | tar -C %i/external -xvvf -
|
105 |
|
|
cp -p %_builddir/THE_BUILD/config/toolbox/%cmsplatf/tools/selected/*.xml %i/etc/scramconfig
|
106 |
|
|
rm -f %i/python/GuiDQM.py
|
107 |
|
|
|
108 |
|
|
# Rename executable scripts.
|
109 |
lat |
1.10 |
perl -p -i -e 's/DQMGUI\_ROOT/OVERVIEW_ROOT/g' %i/bin/visDQM*
|
110 |
lat |
1.5 |
for f in %i/bin/visDQM*; do
|
111 |
|
|
mv $f $(echo $f | sed s/visDQM/ov/g)
|
112 |
|
|
done
|
113 |
|
|
|
114 |
|
|
(set -e; eval `scram runtime -sh`;
|
115 |
|
|
export PYTHONPATH=%i/python${PYTHONPATH+":$PYTHONPATH"};
|
116 |
|
|
for mod in %i/python/*.py; do
|
117 |
|
|
python -c "import $(basename $mod | sed 's/\.py$//')"
|
118 |
|
|
done)
|
119 |
lat |
1.1 |
|
120 |
|
|
# Post installation rules. Relocate the various scripts.
|
121 |
|
|
# Relocate SCRAM-generated external link "database".
|
122 |
|
|
%post
|
123 |
|
|
%{relocateConfig}etc/profile.d/env.sh
|
124 |
|
|
%{relocateConfig}etc/profile.d/env.csh
|
125 |
lat |
1.5 |
%{relocateConfig}etc/scramconfig/*.xml
|
126 |
|
|
perl -w -e '
|
127 |
|
|
($oldroot, $newroot, @files) = @ARGV;
|
128 |
|
|
foreach $f (@files) {
|
129 |
|
|
next if !defined($old = readlink $f);
|
130 |
|
|
($new = $old) =~ s|\Q$oldroot\E|$newroot|;
|
131 |
|
|
if ($new ne $old) { unlink($f); symlink($new, $f); }
|
132 |
|
|
}' %instroot $RPM_INSTALL_PREFIX $RPM_INSTALL_PREFIX/%pkgrel/external/*
|