1 |
< |
### RPM lcg SCRAMV1 V1_0_3 |
2 |
< |
## INITENV +PATH PATH %instroot/bin |
1 |
> |
### RPM lcg SCRAMV1 V1_0_3-p3 |
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 |
4 |
> |
Requires: p5-template-toolkit p5-uri p5-xml-parser p5-libwww-perl cms-env |
5 |
|
Provides: perl(SCRAM::Helper) |
6 |
|
Provides: perl(Utilities::AddDir) |
7 |
|
Provides: perl(Utilities::Architecture) |
51 |
|
# FIXME: should we have more than one project database and link them |
52 |
|
# together into one big one? |
53 |
|
|
54 |
< |
%define cvsrepo cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/SCRAM?passwd=AA_:yZZ3e |
54 |
> |
%define cvsrepo cvs://:pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e |
55 |
|
|
56 |
|
Source0: %{cvsrepo}&tag=-r%{v}&module=SCRAM&output=/source.tar.gz |
57 |
+ |
Patch: %n-%realversion |
58 |
|
|
59 |
|
%prep |
60 |
|
%setup -n SCRAM |
61 |
+ |
%patch -p1 |
62 |
|
%build |
63 |
|
%install |
64 |
|
tar -cf - . | tar -C %i -xvvf - |
65 |
|
rm -rf %i/cgi |
66 |
< |
mkdir -p %instroot/bin %instroot/share/scramdb %i/Installation |
65 |
< |
mkdir -p %i/bin |
66 |
< |
touch %instroot/share/scramdb/project.lookup |
66 |
> |
mkdir -p %i/Installation %i/bin %i/etc/profile.d |
67 |
|
|
68 |
|
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 |
71 |
< |
cat Installation/SCRAM_SITE.pm.in | sed -e "s|@SCRAM_HOME@|%i|;s|@SCRAM_LOOKUPDB_DIR@|%instroot/share/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/share/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 |
69 |
> |
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 |
70 |
|
chmod 755 %i/bin/scramv1 |
71 |
+ |
cp %i/bin/scramv1 %i/src/main/scram.pl |
72 |
|
|
95 |
– |
mkdir %i/etc |
73 |
|
echo $PERL5LIB > %i/etc/perl5lib.env |
74 |
|
|
98 |
– |
mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d |
99 |
– |
mkdir -p %{i}/etc/profile.d |
75 |
|
echo "#!/bin/sh" > %i/etc/profile.d/dependencies-setup.sh |
101 |
– |
echo "source $EXPAT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
76 |
|
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
77 |
|
echo "source $P5_URI_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
78 |
|
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
79 |
|
echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
80 |
|
|
81 |
|
echo "#!/bin/csh" > %i/etc/profile.d/dependencies-setup.csh |
108 |
– |
echo "source $EXPAT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
82 |
|
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
83 |
|
echo "source $P5_URI_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
84 |
|
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
85 |
|
echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
86 |
|
|
87 |
< |
perl -p -i -e "s|#!.*perl|/usr/bin/env perl|" %{i}/doc/doxygen/DoxyFilt.pl |
87 |
> |
perl -p -i -e "s|#!.*perl|#!/usr/bin/env perl|" %{i}/doc/doxygen/DoxyFilt.pl |
88 |
|
|
89 |
|
%post |
90 |
|
%{relocateConfig}etc/perl5lib.env |
95 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
96 |
|
# If and only if there is no default-scramv1 set the default to be the version we package in this spec. |
97 |
|
OLD_VERSION="" |
98 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc |
99 |
|
if [ -f $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version ] |
100 |
|
then |
127 |
– |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc |
101 |
|
OLD_VERSION=`cat $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version` |
102 |
|
fi |
103 |
|
NEW_VERSION=%v |
104 |
|
(echo $OLD_VERSION;echo $NEW_VERSION) | sort | tail -1 > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version |
105 |
|
|
106 |
< |
# Create the wrapper script. |
107 |
< |
# This has to be done in the post installation script because otherwise it gets deleted when |
108 |
< |
# uninstalling the old revision of scram. |
109 |
< |
cat << \EOF_BIN_SCRAMV1 > $RPM_INSTALL_PREFIX/bin/scramv1 |
110 |
< |
#!/bin/sh |
111 |
< |
CMSARCH=`cmsarch` |
112 |
< |
SCRAM_VERSION=`cat %{instroot}/$CMSARCH/etc/default-scramv1-version` |
113 |
< |
source %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/etc/profile.d/init.sh |
141 |
< |
%{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/bin/scramv1 $@ |
142 |
< |
EOF_BIN_SCRAMV1 |
143 |
< |
chmod +x $RPM_INSTALL_PREFIX/bin/scramv1 |
144 |
< |
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/scramv1 |
106 |
> |
mkdir -p $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb $RPM_INSTALL_PREFIX/share/scramdb |
107 |
> |
touch $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup $RPM_INSTALL_PREFIX/share/scramdb/project.lookup |
108 |
> |
dblinked=`grep "DB $RPM_INSTALL_PREFIX/share/scramdb/project.lookup" $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup` |
109 |
> |
if [ "X$dblinked" == "X" ] ; then |
110 |
> |
echo '!DB' $RPM_INSTALL_PREFIX/share/scramdb/project.lookup > $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
111 |
> |
cat $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup >> $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
112 |
> |
mv $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
113 |
> |
fi |
114 |
|
|
115 |
|
%files |
116 |
|
%i |
148 |
– |
%instroot/share/scramdb |
149 |
– |
%exclude %instroot/share/scramdb/project.lookup |
150 |
– |
%exclude %i/scripts/DrDOC.sh |