1 |
|
### RPM lcg SCRAMV1 V1_0_3-p1 |
2 |
|
## INITENV +PATH PATH %instroot/bin |
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) |
63 |
|
rm -rf %i/cgi |
64 |
|
mkdir -p %instroot/bin %instroot/%cmsplatf/lcg/SCRAMV1/scramdb %i/Installation |
65 |
|
mkdir -p %i/bin |
66 |
< |
if [ ! -f %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup ] ; then |
67 |
< |
touch %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
68 |
< |
if [ -f %instroot/share/scramdb/project.lookup ] ; then |
69 |
< |
for line in `cat %instroot/share/scramdb/project.lookup` ; do |
70 |
< |
base=`echo $line | sed 's|.*:||'` |
71 |
< |
if [ -f ${base}/.SCRAM/%{cmsplatf}/.installed ] ; then |
72 |
< |
echo $line >> %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
73 |
< |
fi |
74 |
< |
done |
75 |
< |
fi |
76 |
< |
fi |
66 |
> |
touch %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
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 |
98 |
|
mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d |
99 |
|
mkdir -p %{i}/etc/profile.d |
100 |
|
echo "#!/bin/sh" > %i/etc/profile.d/dependencies-setup.sh |
111 |
– |
echo "source $EXPAT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
101 |
|
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
102 |
|
echo "source $P5_URI_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
103 |
|
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
104 |
|
echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
105 |
|
|
106 |
|
echo "#!/bin/csh" > %i/etc/profile.d/dependencies-setup.csh |
118 |
– |
echo "source $EXPAT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
107 |
|
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
108 |
|
echo "source $P5_URI_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
109 |
|
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
146 |
|
fi |
147 |
|
fi |
148 |
|
source %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/etc/profile.d/init.sh |
149 |
< |
%{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/bin/scramv1 $@ |
149 |
> |
# In the case we are on ia32 we prepend the linux32 command to the actual scram command so that, |
150 |
> |
# no matter where the ia32 architecture is running (i686 or x84_64) scram detects it as |
151 |
> |
# ia32. |
152 |
> |
if "`echo $CMSARCH | cut -d_ -f 2`" == "ia32" |
153 |
> |
then |
154 |
> |
USE_LINUX32=linux32 |
155 |
> |
else |
156 |
> |
USE_LINUX32= |
157 |
> |
fi |
158 |
> |
|
159 |
> |
$USE_LINUX32 %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/bin/scramv1 $@ |
160 |
|
EOF_BIN_SCRAMV1 |
161 |
+ |
|
162 |
|
chmod +x $RPM_INSTALL_PREFIX/bin/scramv1 |
163 |
|
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/scramv1 |
164 |
|
|
165 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb |
166 |
+ |
touch $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
167 |
+ |
if [ -f $RPM_INSTALL_PREFIX/share/scramdb/project.lookup ] ; then |
168 |
+ |
dblinked=`grep "DB $RPM_INSTALL_PREFIX/share/scramdb/project.lookup" $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup` |
169 |
+ |
if [ "X$dblinked" == "X" ] ; then |
170 |
+ |
echo '!DB' $RPM_INSTALL_PREFIX/share/scramdb/project.lookup > $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
171 |
+ |
cat $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup >> $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
172 |
+ |
mv $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
173 |
+ |
fi |
174 |
+ |
fi |
175 |
+ |
|
176 |
|
%files |
177 |
|
%i |
178 |
|
%instroot/%cmsplatf/lcg/SCRAMV1/scramdb |