1 |
< |
### RPM lcg SCRAMV1 V1_0_3-p1 |
2 |
< |
## INITENV +PATH PATH %instroot/bin |
1 |
> |
### RPM lcg SCRAMV1 V1_0_2 |
2 |
> |
## INITENV +PATH PATH %instroot/common |
3 |
|
## INITENV +PATH PERL5LIB %{i} |
4 |
|
Requires: expat p5-template-toolkit p5-uri p5-xml-parser p5-libwww-perl cms-env |
5 |
|
Provides: perl(SCRAM::Helper) |
12 |
|
Provides: perl(Doxygen::Context) |
13 |
|
Provides: perl(Graph::Graph) |
14 |
|
Provides: perl(ObjectStore) |
15 |
– |
Provides: perl(Utilities::SVNmodule) |
16 |
– |
Provides: perl(URL::URL_cvsfile) |
17 |
– |
Provides: perl(BuildSystem::Block) |
18 |
– |
Provides: perl(BuildSystem::Build) |
19 |
– |
Provides: perl(BuildSystem::BuildClass) |
20 |
– |
Provides: perl(BuildSystem::BuildSetup) |
21 |
– |
Provides: perl(BuildSystem::DateStampRecord) |
22 |
– |
Provides: perl(BuildSystem::Tool) |
23 |
– |
Provides: perl(BuildSystem::ToolBox) |
24 |
– |
Provides: perl(BuildSystem::ToolDoc) |
25 |
– |
Provides: perl(Utilities::GroupChecker) |
15 |
|
|
16 |
|
# This package is somewhat unusual compared to other packages we |
17 |
|
# build: we install the normally versioned product "SCRAM", but also |
40 |
|
# FIXME: should we have more than one project database and link them |
41 |
|
# together into one big one? |
42 |
|
|
43 |
< |
%define cvsrepo cvs://:pserver:anonymous@isscvs.cern.ch:/local/reps/scram?passwd=AA_:yZZ3e |
43 |
> |
%define cvsrepo cvs://:pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e |
44 |
|
|
45 |
|
Source0: %{cvsrepo}&tag=-r%{v}&module=SCRAM&output=/source.tar.gz |
46 |
|
|
50 |
|
%install |
51 |
|
tar -cf - . | tar -C %i -xvvf - |
52 |
|
rm -rf %i/cgi |
53 |
< |
mkdir -p %instroot/bin %instroot/%cmsplatf/lcg/SCRAMV1/scramdb %i/Installation |
65 |
< |
mkdir -p %i/bin |
66 |
< |
touch %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
53 |
> |
mkdir -p %i/Installation %i/bin %i/etc/profile.d |
54 |
|
|
55 |
|
cat Installation/scram.pl.in | sed -e "s|@PERLEXE@|/usr/bin/env perl|;s|@SCRAM_HOME@|%i|;s|@INSTALLDIR@|%i/src|" > %i/bin/scramv1 |
69 |
– |
cat Installation/scram.pl.in | sed -e "s|@PERLEXE@|/usr/bin/env perl|;s|@SCRAM_HOME@|%i|;s|@INSTALLDIR@|%i/src|" > %i/src/main/scram.pl |
70 |
– |
chmod +x %i/src/main/scram.pl |
56 |
|
cat Installation/SCRAM_SITE.pm.in | sed -e "s|@SCRAM_HOME@|%i|;s|@SCRAM_LOOKUPDB_DIR@|%instroot/%cmsplatf/lcg/SCRAMV1/scramdb/|;s|@PERLEXE@|/usr/bin/env perl|;s|@TT2INSTALLDIR@|$TEMPLATE_TOOLKIT_ROOT/lib|;s|@SITETEMPLATEDIR@|%i/Templates|;s|@SCRAM_SITENAME@|STANDALONE|" > %i/Installation/SCRAM_SITE.pm |
72 |
– |
|
73 |
– |
# cat > %instroot/bin/scramv1 << \EOF |
74 |
– |
# #!/bin/sh |
75 |
– |
# |
76 |
– |
# # FIXME: Handle -re? |
77 |
– |
# # FIXME: Since we can install the same package on many platforms in |
78 |
– |
# # one tree, should the project lookup database be platform-specific? |
79 |
– |
# |
80 |
– |
# SCRAM=$0 |
81 |
– |
# : ${SCRAM_HOME=%i} |
82 |
– |
# : ${SCRAM_LOOKUPDB=%instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup} |
83 |
– |
# : ${SCRAMPERL="/usr/bin/env perl"} |
84 |
– |
# PERL5LIB=$SCRAM_HOME/src${PERL5LIB+":$PERL5LIB"} |
85 |
– |
# : ${SITENAME=CERN} |
86 |
– |
# : ${SEARCHOVRD=true} |
87 |
– |
# : ${LOCTOOLS=NODEFAULT} |
88 |
– |
# export SCRAM SCRAM_HOME SCRAM_LOOKUPDB SCRAMPERL |
89 |
– |
# export PERL5LIB SITENAME SEARCHOVRD LOCTOOLS |
90 |
– |
# |
91 |
– |
# exec perl "$SCRAM_HOME/src/scramcli" ${1+"$@"} |
92 |
– |
# EOF |
57 |
|
chmod 755 %i/bin/scramv1 |
58 |
+ |
cp %i/bin/scramv1 %i/src/main/scram.pl |
59 |
|
|
95 |
– |
mkdir %i/etc |
60 |
|
echo $PERL5LIB > %i/etc/perl5lib.env |
61 |
|
|
98 |
– |
mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d |
99 |
– |
mkdir -p %{i}/etc/profile.d |
62 |
|
echo "#!/bin/sh" > %i/etc/profile.d/dependencies-setup.sh |
63 |
|
echo "source $EXPAT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
64 |
|
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
73 |
|
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
74 |
|
echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
75 |
|
|
76 |
< |
perl -p -i -e "s|#!.*perl|/usr/bin/env perl|" %{i}/doc/doxygen/DoxyFilt.pl |
76 |
> |
perl -p -i -e "s|#!.*perl|#!/usr/bin/env perl|" %{i}/doc/doxygen/DoxyFilt.pl |
77 |
|
|
78 |
|
%post |
79 |
|
%{relocateConfig}etc/perl5lib.env |
84 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
85 |
|
# If and only if there is no default-scramv1 set the default to be the version we package in this spec. |
86 |
|
OLD_VERSION="" |
87 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc |
88 |
|
if [ -f $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version ] |
89 |
|
then |
127 |
– |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc |
90 |
|
OLD_VERSION=`cat $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version` |
91 |
|
fi |
92 |
|
NEW_VERSION=%v |
93 |
|
(echo $OLD_VERSION;echo $NEW_VERSION) | sort | tail -1 > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version |
94 |
|
|
95 |
< |
# Create the wrapper script. |
96 |
< |
# This has to be done in the post installation script because otherwise it gets deleted when |
97 |
< |
# uninstalling the old revision of scram. |
98 |
< |
cat << \EOF_BIN_SCRAMV1 > $RPM_INSTALL_PREFIX/bin/scramv1 |
99 |
< |
#!/bin/sh |
100 |
< |
if [ "`cmsos`" == "slc4_amd64" ]; then |
101 |
< |
# Check that scramv1 for native platform is installed: |
140 |
< |
[ -e $RPM_INSTALL_PREFIX/slc4_amd64_gcc345/lcg/%{n}/%{v}/bin ] || \ |
141 |
< |
echo -e "===================================================================== |
142 |
< |
WARNING: SCRAMV1 installation for slc4_amd64_gcc345 is missing! |
143 |
< |
To build CMSSW on `uname -m` you need GCC and SCRAMV1 |
144 |
< |
installed for this platform. |
145 |
< |
=====================================================================" |
146 |
< |
CMSARCH=slc4_amd64_gcc345 |
147 |
< |
else |
148 |
< |
CMSARCH=`cmsarch` |
149 |
< |
fi |
150 |
< |
SCRAM_VERSION=`cat %{instroot}/$CMSARCH/etc/default-scramv1-version` |
151 |
< |
dir=`/bin/pwd` |
152 |
< |
while [ ! -d ${dir}/.SCRAM -a "$dir" != "/" ] ; do |
153 |
< |
dir=`dirname $dir` |
154 |
< |
done |
155 |
< |
if [ -f ${dir}/config/scram_version ] ; then |
156 |
< |
ver=`cat ${dir}/config/scram_version` |
157 |
< |
if [ -f %{instroot}/$CMSARCH/lcg/SCRAMV1/${ver}/etc/profile.d/init.sh ] ; then |
158 |
< |
SCRAM_VERSION=$ver |
159 |
< |
fi |
95 |
> |
mkdir -p $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb $RPM_INSTALL_PREFIX/share/scramdb |
96 |
> |
touch $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup $RPM_INSTALL_PREFIX/share/scramdb/project.lookup |
97 |
> |
dblinked=`grep "DB $RPM_INSTALL_PREFIX/share/scramdb/project.lookup" $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup` |
98 |
> |
if [ "X$dblinked" == "X" ] ; then |
99 |
> |
echo '!DB' $RPM_INSTALL_PREFIX/share/scramdb/project.lookup > $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
100 |
> |
cat $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup >> $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
101 |
> |
mv $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
102 |
|
fi |
103 |
< |
source %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/etc/profile.d/init.sh |
104 |
< |
%{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/bin/scramv1 $@ |
105 |
< |
EOF_BIN_SCRAMV1 |
106 |
< |
chmod +x $RPM_INSTALL_PREFIX/bin/scramv1 |
107 |
< |
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/scramv1 |
108 |
< |
|
109 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb |
168 |
< |
touch $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
169 |
< |
if [ -f $RPM_INSTALL_PREFIX/share/scramdb/project.lookup ] ; then |
170 |
< |
dblinked=`grep "DB $RPM_INSTALL_PREFIX/share/scramdb/project.lookup" $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup` |
171 |
< |
if [ "X$dblinked" == "X" ] ; then |
172 |
< |
echo '!DB' $RPM_INSTALL_PREFIX/share/scramdb/project.lookup > $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
173 |
< |
cat $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup >> $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
174 |
< |
mv $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
175 |
< |
fi |
103 |
> |
# Use slc4_ia32_gcc345 scramdb for slc4_amd64_gcc345 until we support native builds: |
104 |
> |
if [ "%{cmsplatf}" == "slc4_amd64_gcc345" ]; then |
105 |
> |
ia32_db=$RPM_INSTALL_PREFIX/slc4_ia32_gcc345/lcg/SCRAMV1/scramdb/project.lookup |
106 |
> |
amd64_db=$RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
107 |
> |
[ "`grep -c $ia32_db $amd64_db`" == "0" ] && \ |
108 |
> |
(echo '!DB' $ia32_db >> $amd64_db ) |
109 |
> |
unset ia32_db amd64_db |
110 |
|
fi |
111 |
|
|
112 |
|
%files |
113 |
|
%i |
180 |
– |
%instroot/%cmsplatf/lcg/SCRAMV1/scramdb |
181 |
– |
%exclude %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
182 |
– |
%exclude %i/scripts/DrDOC.sh |