1 |
< |
### RPM lcg SCRAMV1 V1_2_0-cand10 |
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) |
6 |
+ |
Provides: perl(Utilities::AddDir) |
7 |
+ |
Provides: perl(Utilities::Architecture) |
8 |
+ |
Provides: perl(Utilities::SCRAMUtils) |
9 |
+ |
Provides: perl(ActiveDoc::GroupChecker) |
10 |
+ |
Provides: perl(ActiveDoc::UserInterface_basic) |
11 |
+ |
Provides: perl(ActiveDoc::UserQuery) |
12 |
+ |
Provides: perl(Doxygen::Context) |
13 |
+ |
Provides: perl(Graph::Graph) |
14 |
+ |
Provides: perl(ObjectStore) |
15 |
|
|
16 |
|
# This package is somewhat unusual compared to other packages we |
17 |
|
# build: we install the normally versioned product "SCRAM", but also |
18 |
< |
# create the package database. The latter do not follow the |
19 |
< |
# standard versioning. |
18 |
> |
# create the front-end "scram" wrapper and the package database. The |
19 |
> |
# latter do not follow the standard versioning. |
20 |
> |
# |
21 |
> |
# The front-end script can be overwritten by any version *PROVIDED* |
22 |
> |
# the platform string comes first as is the default (i.e. the |
23 |
> |
# installation tree looks like <platf>/lcg/SCRAM/<version>/src). |
24 |
|
# |
25 |
|
# The database is only created, but never changeed. It is made part |
26 |
|
# of this package, but none of the files in it are included, so if |
28 |
|
# check this is really so -- should we use %dir, or the default is |
29 |
|
# good?) |
30 |
|
# |
31 |
+ |
# The front-end wrapper and the script go at the installation root, |
32 |
+ |
# not anywhere in the package tree. They must remain modifiable. |
33 |
+ |
# |
34 |
+ |
# We do the install ourselves, as "Installation/install_scram" would |
35 |
+ |
# do, but putting the results elsewhere and using our own scram |
36 |
+ |
# wrapper instead of using the supplied one -- mainly for easier |
37 |
+ |
# override of SCRAM_LOOKUPDB; the wrapper is really rather simple so |
38 |
+ |
# there is no point in trying to patch it. |
39 |
+ |
# |
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@cmscvs.cern.ch:/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e |
44 |
< |
%define cvstag %v |
45 |
< |
Source0: %{cvsrepo}&tag=-r%{cvstag}&module=SCRAM&output=/source.tar.gz |
44 |
> |
|
45 |
> |
Source0: %{cvsrepo}&tag=-r%{v}&module=SCRAM&output=/source.tar.gz |
46 |
|
|
47 |
|
%prep |
48 |
|
%setup -n SCRAM |
49 |
|
%build |
50 |
|
%install |
51 |
|
tar -cf - . | tar -C %i -xvvf - |
52 |
+ |
rm -rf %i/cgi |
53 |
+ |
mkdir -p %i/Installation %i/bin %i/etc/profile.d |
54 |
|
|
55 |
< |
mkdir -p %i/src/main %instroot/%cmsplatf/lcg/SCRAMV1/scramdb |
56 |
< |
touch %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
57 |
< |
|
58 |
< |
#SCRAM/INSTALL.txt recomendations |
59 |
< |
sed -i -e "s|@SCRAM_LOOKUPDB_DIR@|%instroot/%cmsplatf/lcg/SCRAMV1/scramdb/|g;s|@SCRAM_VERSION@|%v|g" %i/bin/scram |
60 |
< |
ln -s ../../bin/scram %i/src/main/scram.pl |
61 |
< |
chmod 755 %i/bin/scram |
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 |
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 |
57 |
> |
chmod 755 %i/bin/scramv1 |
58 |
> |
cp %i/bin/scramv1 %i/src/main/scram.pl |
59 |
> |
|
60 |
> |
echo $PERL5LIB > %i/etc/perl5lib.env |
61 |
> |
|
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 |
65 |
> |
echo "source $P5_URI_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
66 |
> |
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
67 |
> |
echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
68 |
> |
|
69 |
> |
echo "#!/bin/csh" > %i/etc/profile.d/dependencies-setup.csh |
70 |
> |
echo "source $EXPAT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
71 |
> |
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
72 |
> |
echo "source $P5_URI_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
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 |
< |
mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d |
37 |
< |
mkdir -p %{i}/etc/profile.d |
76 |
> |
perl -p -i -e "s|#!.*perl|#!/usr/bin/env perl|" %{i}/doc/doxygen/DoxyFilt.pl |
77 |
|
|
78 |
|
%post |
79 |
< |
%{relocateConfig}bin/scram |
79 |
> |
%{relocateConfig}etc/perl5lib.env |
80 |
> |
%{relocateConfig}Installation/SCRAM_SITE.pm |
81 |
> |
%{relocateConfig}bin/scramv1 |
82 |
> |
%{relocateConfig}src/main/scram.pl |
83 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
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 |
45 |
– |
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 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb |
96 |
< |
touch $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
97 |
< |
if [ -f $RPM_INSTALL_PREFIX/share/scramdb/project.lookup ] ; then |
98 |
< |
dblinked=`grep "DB $RPM_INSTALL_PREFIX/share/scramdb/project.lookup" $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup` |
99 |
< |
if [ "X$dblinked" = "X" ] ; then |
100 |
< |
echo '!DB' $RPM_INSTALL_PREFIX/share/scramdb/project.lookup > $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
101 |
< |
cat $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup >> $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link |
102 |
< |
mv $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |
103 |
< |
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 |
> |
# 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 |
64 |
– |
%instroot/%cmsplatf/lcg/SCRAMV1/scramdb |
65 |
– |
%exclude %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup |