1 |
elmer |
1.65 |
### RPM lcg SCRAMV1 V1_1_0_reltag5
|
2 |
muzaffar |
1.62 |
## INITENV +PATH PATH %instroot/common
|
3 |
eulisse |
1.7 |
## INITENV +PATH PERL5LIB %{i}
|
4 |
eulisse |
1.63 |
|
5 |
|
|
%define perl /usr/bin/env perl
|
6 |
|
|
%if "%(echo %cmsplatf | cut -f1 -d_ | sed -e 's|\([A-Za-z]*\)[0-9]*|\1|')" == "osx"
|
7 |
|
|
%define perl /usr/bin/perl
|
8 |
|
|
%endif
|
9 |
|
|
|
10 |
|
|
|
11 |
muzaffar |
1.62 |
Requires: p5-template-toolkit p5-uri p5-xml-parser p5-libwww-perl
|
12 |
eulisse |
1.7 |
Provides: perl(SCRAM::Helper)
|
13 |
|
|
Provides: perl(Utilities::AddDir)
|
14 |
|
|
Provides: perl(Utilities::Architecture)
|
15 |
|
|
Provides: perl(Utilities::SCRAMUtils)
|
16 |
|
|
Provides: perl(ActiveDoc::GroupChecker)
|
17 |
|
|
Provides: perl(ActiveDoc::UserInterface_basic)
|
18 |
|
|
Provides: perl(ActiveDoc::UserQuery)
|
19 |
|
|
Provides: perl(Doxygen::Context)
|
20 |
|
|
Provides: perl(Graph::Graph)
|
21 |
|
|
Provides: perl(ObjectStore)
|
22 |
eulisse |
1.24 |
Provides: perl(Utilities::SVNmodule)
|
23 |
|
|
Provides: perl(URL::URL_cvsfile)
|
24 |
eulisse |
1.35 |
Provides: perl(BuildSystem::Block)
|
25 |
|
|
Provides: perl(BuildSystem::Build)
|
26 |
|
|
Provides: perl(BuildSystem::BuildClass)
|
27 |
|
|
Provides: perl(BuildSystem::BuildSetup)
|
28 |
|
|
Provides: perl(BuildSystem::DateStampRecord)
|
29 |
|
|
Provides: perl(BuildSystem::Tool)
|
30 |
|
|
Provides: perl(BuildSystem::ToolBox)
|
31 |
|
|
Provides: perl(BuildSystem::ToolDoc)
|
32 |
|
|
Provides: perl(Utilities::GroupChecker)
|
33 |
eulisse |
1.7 |
|
34 |
argiro |
1.1 |
# This package is somewhat unusual compared to other packages we
|
35 |
|
|
# build: we install the normally versioned product "SCRAM", but also
|
36 |
muzaffar |
1.62 |
# create the package database. The latter do not follow the
|
37 |
|
|
# standard versioning.
|
38 |
argiro |
1.1 |
#
|
39 |
|
|
# The database is only created, but never changeed. It is made part
|
40 |
|
|
# of this package, but none of the files in it are included, so if
|
41 |
|
|
# the package is removed, the directory will left intact. (FIXME:
|
42 |
|
|
# check this is really so -- should we use %dir, or the default is
|
43 |
|
|
# good?)
|
44 |
|
|
#
|
45 |
|
|
# We do the install ourselves, as "Installation/install_scram" would
|
46 |
|
|
# do, but putting the results elsewhere and using our own scram
|
47 |
|
|
# wrapper instead of using the supplied one -- mainly for easier
|
48 |
|
|
# override of SCRAM_LOOKUPDB; the wrapper is really rather simple so
|
49 |
|
|
# there is no point in trying to patch it.
|
50 |
|
|
#
|
51 |
|
|
# FIXME: should we have more than one project database and link them
|
52 |
|
|
# together into one big one?
|
53 |
|
|
|
54 |
elmer |
1.60 |
%define cvsrepo cvs://:pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e
|
55 |
muzaffar |
1.62 |
%define cvstag V1_1_0_reltag
|
56 |
|
|
Source0: %{cvsrepo}&tag=-r%{cvstag}&module=SCRAM&output=/source.tar.gz
|
57 |
argiro |
1.1 |
|
58 |
|
|
%prep
|
59 |
|
|
%setup -n SCRAM
|
60 |
|
|
%build
|
61 |
|
|
%install
|
62 |
|
|
tar -cf - . | tar -C %i -xvvf -
|
63 |
muzaffar |
1.62 |
mkdir -p %instroot/%cmsplatf/lcg/SCRAMV1/scramdb %i/bin %i/Installation
|
64 |
ratnik |
1.52 |
touch %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
|
65 |
eulisse |
1.2 |
|
66 |
eulisse |
1.63 |
cat Installation/scram.pl.in | sed -e "s|@PERLEXE@|%perl|;s|@SCRAM_HOME@|%i|g;s|@INSTALLDIR@|%i/src|g" > %i/bin/scram
|
67 |
|
|
cat Installation/scram.pl.in | sed -e "s|@PERLEXE@|%perl|;s|@SCRAM_HOME@|%i|g;s|@INSTALLDIR@|%i/src|g" > %i/src/main/scram.pl
|
68 |
eulisse |
1.24 |
chmod +x %i/src/main/scram.pl
|
69 |
eulisse |
1.63 |
cat Installation/SCRAM_SITE.pm.in | sed -e "s|@SCRAM_HOME@|%i|g;s|@SCRAM_LOOKUPDB_DIR@|%instroot/%cmsplatf/lcg/SCRAMV1/scramdb/|g;s|@PERLEXE@|%perl|;s|@TT2INSTALLDIR@|$TEMPLATE_TOOLKIT_ROOT/lib|g;s|@SITETEMPLATEDIR@|%i/Templates|g;s|@SCRAM_SITENAME@|STANDALONE|g" > %i/Installation/SCRAM_SITE.pm
|
70 |
muzaffar |
1.62 |
sed -e "s|@SCRAM_VERSION@|%v|" src/SCRAM/SCRAM.pm > %i/src/SCRAM/SCRAM.pm
|
71 |
|
|
chmod 755 %i/bin/scram
|
72 |
eulisse |
1.2 |
|
73 |
muzaffar |
1.62 |
mkdir -p %i/etc
|
74 |
eulisse |
1.3 |
echo $PERL5LIB > %i/etc/perl5lib.env
|
75 |
eulisse |
1.6 |
|
76 |
eulisse |
1.15 |
mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d
|
77 |
eulisse |
1.6 |
mkdir -p %{i}/etc/profile.d
|
78 |
|
|
echo "#!/bin/sh" > %i/etc/profile.d/dependencies-setup.sh
|
79 |
|
|
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
|
80 |
|
|
echo "source $P5_URI_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
|
81 |
|
|
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
|
82 |
|
|
echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
|
83 |
|
|
|
84 |
eulisse |
1.11 |
echo "#!/bin/csh" > %i/etc/profile.d/dependencies-setup.csh
|
85 |
|
|
echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
|
86 |
|
|
echo "source $P5_URI_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
|
87 |
|
|
echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
|
88 |
|
|
echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
|
89 |
|
|
|
90 |
eulisse |
1.63 |
%perl -p -i -e "s|#!.*perl|#!%perl|" %{i}/doc/doxygen/DoxyFilt.pl
|
91 |
eulisse |
1.7 |
|
92 |
eulisse |
1.5 |
%post
|
93 |
eulisse |
1.6 |
%{relocateConfig}etc/perl5lib.env
|
94 |
eulisse |
1.5 |
%{relocateConfig}Installation/SCRAM_SITE.pm
|
95 |
muzaffar |
1.62 |
%{relocateConfig}bin/scram
|
96 |
eulisse |
1.24 |
%{relocateConfig}src/main/scram.pl
|
97 |
eulisse |
1.6 |
%{relocateConfig}etc/profile.d/dependencies-setup.sh
|
98 |
eulisse |
1.12 |
%{relocateConfig}etc/profile.d/dependencies-setup.csh
|
99 |
eulisse |
1.24 |
# If and only if there is no default-scramv1 set the default to be the version we package in this spec.
|
100 |
|
|
OLD_VERSION=""
|
101 |
eulisse |
1.32 |
if [ -f $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version ]
|
102 |
eulisse |
1.24 |
then
|
103 |
eulisse |
1.32 |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
|
104 |
eulisse |
1.24 |
OLD_VERSION=`cat $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version`
|
105 |
|
|
fi
|
106 |
|
|
NEW_VERSION=%v
|
107 |
|
|
(echo $OLD_VERSION;echo $NEW_VERSION) | sort | tail -1 > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version
|
108 |
eulisse |
1.15 |
|
109 |
ratnik |
1.52 |
mkdir -p $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb
|
110 |
|
|
touch $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
|
111 |
|
|
if [ -f $RPM_INSTALL_PREFIX/share/scramdb/project.lookup ] ; then
|
112 |
|
|
dblinked=`grep "DB $RPM_INSTALL_PREFIX/share/scramdb/project.lookup" $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup`
|
113 |
eulisse |
1.59 |
if [ "X$dblinked" = "X" ] ; then
|
114 |
ratnik |
1.52 |
echo '!DB' $RPM_INSTALL_PREFIX/share/scramdb/project.lookup > $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link
|
115 |
|
|
cat $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup >> $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link
|
116 |
|
|
mv $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
|
117 |
|
|
fi
|
118 |
|
|
fi
|
119 |
eulisse |
1.55 |
|
120 |
argiro |
1.1 |
%files
|
121 |
|
|
%i
|
122 |
ratnik |
1.52 |
%instroot/%cmsplatf/lcg/SCRAMV1/scramdb
|
123 |
|
|
%exclude %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
|
124 |
eulisse |
1.18 |
%exclude %i/scripts/DrDOC.sh
|