ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/online.spec
(Generate patch)

Comparing COMP/CMSDIST/online.spec (file contents):
Revision 1.6 by ratnik, Sun Nov 18 09:50:28 2007 UTC vs.
Revision 1.73 by fwyzard, Thu May 6 17:04:43 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines