ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/overview.spec
Revision: 1.14
Committed: Thu Jan 20 17:11:56 2011 UTC (14 years, 3 months ago) by lat
Branch: MAIN
CVS Tags: builder_2011-09-25_13-08-30_CmsTC, builder_2011-09-22_19-07-05_CmsTC, builder_2011-09-21_19-43-30_CmsTC, builder_2011-09-21_10-25-16_CmsTC, builder_2011-09-20_13-03-45_CmsTC, builder_2011-09-20_12-03-56_CmsTC, builder_2011-08-11_12-11-35_CmsTC, builder_2011-06-23_18-03-57_CmsTC, builder_2011-05-20_16-46-52_crab-server, builder_2011-05-16_23-03-55_CmsTC, builder_2011-03-31_13-06-26_crab-server, builder_2011-03-28_17-53-57_crab-server, builder_2011-02-28_14-23-32_wmagent, CmsTC_0_0_4, CmsTC_0_0_3, CmsTC_0_0_2, builder_2011-02-09_14-27-53_crab-server, builder_2011-02-08_23-13-23_cmsweb, HG1102d, builder_2011-02-08_07-34-50_cmsweb, HG1102c, builder_2011-02-03_23-45-44_CmsTC, builder_2011-02-03_19-04-46_PHEDEX-combined-agents, builder_2011-02-02_21-14-00_cmsweb, builder_2011-02-02_16-24-27_T0Mon, builder_2011-02-01_18-11-58_cmsweb, builder_2011-01-31_16-44-33_dbs-client, builder_2011-01-31_15-26-15_T0DataSvc, builder_2011-01-25_14-26-56_cmsweb, builder_2011-01-20_18-59-54_cmsweb, HG1102b
Changes since 1.13: +4 -7 lines
Log Message:
Remove uses of bare scram command, use %scram everywhere.

File Contents

# User Rev Content
1 lat 1.12 ### RPM cms overview 5.2.1c
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.12 %define cmssw CMSSW_3_6_1
11     %define vcfg V03-29-09
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 lat 1.14 %scram project -d $PWD -b config/bootsrc.xml </dev/null
30 lat 1.5
31     # Build the code as a scram project area, then relocate it to more
32     # normal directories (%i/{bin,lib,python}). Save the scram runtime
33     # environment plus extra externals for later use, but manipulate
34     # the scram environment to point to the installation directories.
35     # Avoid generating excess environment.
36 lat 1.1 %build
37 lat 1.5 cd %_builddir/THE_BUILD/src
38     export BUILD_LOG=yes
39     export SCRAM_NOPLUGINREFRESH=yes
40     export SCRAM_NOLOADCHECK=true
41     export SCRAM_NOSYMCHECK=true
42     (%scram build -v -f %makeprocesses </dev/null) || { %scram build outputlog </dev/null && false; }
43    
44     # Now clean up environment. First eliminate non-existent directories
45     # from the paths. Then capture the SCRAM run-time environment, and
46     # eliminate duplicate path components (from cmsbuild vs. scram), and
47     # convert it back to a format that is additive to the user environment
48     # (you want the init script to modify your $PATH, not to change it to
49     # mine, right!?). Finally munge SCRAM directories to finall install
50     # area directories.
51     mkdir -p %i/etc/profile.d
52 lat 1.1 for p in PATH LD_LIBRARY_PATH PYTHONPATH; do
53     for z in "" ZZ; do
54     eval export $z$p=$(perl -e 'print join(":", grep($_ && -d $_ && scalar(@{[<$_/*>]}) > 0, split(/:/,$ENV{'$z$p'})))')
55     done
56     done
57 lat 1.5 removeenv='LOCALRT|CMSSW_(RELEASE_)*(BASE|VERSION|(FWLITE|SEARCH)_[A-Z_]*)|(COIN|IGUANA|SEAL)_[A-Z_]*'
58 lat 1.14 %scram runtime -sh | grep -v SCRAMRT | egrep -v "^export ($removeenv)=" > %i/etc/profile.d/env.sh
59     %scram runtime -csh | grep -v SCRAMRT | egrep -v "^setenv ($removeenv) " > %i/etc/profile.d/env.csh
60 lat 1.5 perl -w -i -p -e \
61     'BEGIN {
62     %%linked = map { s|/+[^/]+$||; ($_ => 1) }
63     grep(defined $_, map { readlink $_ }
64     <%_builddir/THE_BUILD/external/%cmsplatf/lib/*>);
65     }
66     foreach $dir (keys %%linked) { s<:$dir([ :;"]|$)><$1>g; }
67 lat 1.1 foreach $p ("PATH", "LD_LIBRARY_PATH", "PYTHONPATH") {
68 lat 1.5 s<([ :=])$ENV{"ZZ$p"}([ :;"]|$)><$1\${$p}$2>g if $ENV{"ZZ$p"};
69 lat 1.1 }
70 lat 1.5 s<:'"$SCRAMV1_ROOT"'/[a-z]+:><:>g;
71     s<:%instroot/common:><:>g;
72     s<%_builddir/THE_BUILD/bin/%cmsplatf><%i/bin>g;
73     s<%_builddir/THE_BUILD/(lib|module)/%cmsplatf><%i/lib>g;
74     s<%_builddir/THE_BUILD/external/%cmsplatf/lib><%i/external>g;
75     s<%_builddir/THE_BUILD/python><%i/python>g;
76     s<%_builddir/THE_BUILD><%i>g;' \
77     %i/etc/profile.d/env.sh %i/etc/profile.d/env.csh
78    
79     (echo "export PATH=%i/xbin:\$PATH;"
80     echo "export PYTHONPATH=%i/xlib:%i/xpython:\$PYTHONPATH;"
81     echo "export LD_LIBRARY_PATH=%i/xlib:\$LD_LIBRARY_PATH;"
82     echo "export YUI_ROOT='$YUI_ROOT';"
83     echo "export OVERVIEW_ROOT='%i';"
84     echo "export OVERVIEW_CMSSW_VERSION='%{cmssw}';") >> %i/etc/profile.d/env.sh
85    
86     (echo "setenv PATH %i/xbin:\$PATH;"
87     echo "setenv PYTHONPATH %i/xlib:%i/xpython:\$PYTHONPATH;"
88     echo "setenv LD_LIBRARY_PATH %i/xlib:\$LD_LIBRARY_PATH;"
89     echo "setenv YUI_ROOT '$YUI_ROOT';"
90     echo "setenv OVERVIEW_ROOT '%i';"
91     echo "setenv OVERVIEW_CMSSW_VERSION '%{cmssw}';") >> %i/etc/profile.d/env.csh
92    
93     # Install the project files. Copies from SCRAM area to final install
94     # area. Creates scripts to patch and unpatch the server area from a
95     # local SCRAM developer area. Creates scripts for server management.
96     # Usage at https://twiki.cern.ch/twiki/bin/view/CMS/DQMTest and
97     # https://twiki.cern.ch/twiki//bin/view/CMS/DQMGuiProduction.
98     %install
99     mkdir -p %i/etc/profile.d %i/etc/scramconfig %i/external %i/{,x}bin %i/{,x}lib %i/{,x}python %i/data
100     cp -p %_builddir/distsrc.tar.bz2 %i/data
101     cp -p %_builddir/THE_BUILD/bin/%cmsplatf/* %i/bin
102     cp -p %_builddir/THE_BUILD/src/VisMonitoring/DQMServer/python/*.* %i/python
103     tar -C %_builddir/THE_BUILD/external/%cmsplatf/lib -cf - . | tar -C %i/external -xvvf -
104     cp -p %_builddir/THE_BUILD/config/toolbox/%cmsplatf/tools/selected/*.xml %i/etc/scramconfig
105     rm -f %i/python/GuiDQM.py
106    
107     # Rename executable scripts.
108 lat 1.10 perl -p -i -e 's/DQMGUI\_ROOT/OVERVIEW_ROOT/g' %i/bin/visDQM*
109 lat 1.5 for f in %i/bin/visDQM*; do
110     mv $f $(echo $f | sed s/visDQM/ov/g)
111     done
112    
113 lat 1.14 (set -e; eval `%scram runtime -sh`;
114 lat 1.5 export PYTHONPATH=%i/python${PYTHONPATH+":$PYTHONPATH"};
115     for mod in %i/python/*.py; do
116     python -c "import $(basename $mod | sed 's/\.py$//')"
117     done)
118 lat 1.1
119     # Post installation rules. Relocate the various scripts.
120     # Relocate SCRAM-generated external link "database".
121     %post
122     %{relocateConfig}etc/profile.d/env.sh
123     %{relocateConfig}etc/profile.d/env.csh
124 lat 1.5 %{relocateConfig}etc/scramconfig/*.xml
125     perl -w -e '
126     ($oldroot, $newroot, @files) = @ARGV;
127     foreach $f (@files) {
128     next if !defined($old = readlink $f);
129     ($new = $old) =~ s|\Q$oldroot\E|$newroot|;
130     if ($new ne $old) { unlink($f); symlink($new, $f); }
131     }' %instroot $RPM_INSTALL_PREFIX $RPM_INSTALL_PREFIX/%pkgrel/external/*