ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/SCRAM.spec
Revision: 1.13
Committed: Thu Jun 15 22:57:41 2006 UTC (18 years, 10 months ago) by eulisse
Branch: MAIN
CVS Tags: V00-01-00
Changes since 1.12: +2 -0 lines
Log Message:
Removes the annoying "feature" of scram trying to be too smart and to detect
tool environment variable from the user ones.

File Contents

# Content
1 ### RPM lcg SCRAM V0_20_0
2 ## INITENV +PATH PATH %instroot/bin
3
4 # This package is somewhat unusual compared to other packages we
5 # build: we install the normally versioned product "SCRAM", but also
6 # create the front-end "scram" wrapper and the package database. The
7 # latter do not follow the standard versioning.
8 #
9 # The front-end script can be overwritten by any version *PROVIDED*
10 # the platform string comes first as is the default (i.e. the
11 # installation tree looks like <platf>/lcg/SCRAM/<version>/src).
12 #
13 # The database is only created, but never changeed. It is made part
14 # of this package, but none of the files in it are included, so if
15 # the package is removed, the directory will left intact. (FIXME:
16 # check this is really so -- should we use %dir, or the default is
17 # good?)
18 #
19 # The front-end wrapper and the script go at the installation root,
20 # not anywhere in the package tree. They must remain modifiable.
21 #
22 # We do the install ourselves, as "Installation/install_scram" would
23 # do, but putting the results elsewhere and using our own scram
24 # wrapper instead of using the supplied one -- mainly for easier
25 # override of SCRAM_LOOKUPDB; the wrapper is really rather simple so
26 # there is no point in trying to patch it.
27 #
28 # FIXME: should we have more than one project database and link them
29 # together into one big one?
30
31 %define cvsrepo cvs://:pserver:anonymous@spitools.cvs.cern.ch:2401/cvs/SPITOOLS?passwd=Ah<Z
32
33 Source0: %{cvsrepo}&tag=-r%{v}&module=%n&output=/source.tar.gz
34 Requires: p5-libwww-perl
35 Patch: scram-detect-make
36 Patch2: scram-no-check-env
37 Provides: perl(ActiveDoc::UserInterface_basic)
38 Provides: perl(ActiveDoc::UserQuery)
39 Provides: perl(ActiveDoc::GroupChecker)
40 Provides: perl(ObjectStore)
41 Provides: perl(Utilities::AddDir)
42 Provides: perl(Utilities::GroupChecker)
43 Provides: perl(Utilities::SCRAMUtils)
44
45 %prep
46 %setup -n %n
47 pwd
48 %patch -p1
49 %patch2 -p1
50 rm src/URL/test/test_URL_cvsfile.pm
51 %build
52 %install
53 tar -cf - . | tar -C %i -xvvf -
54
55 mkdir -p %instroot/bin %instroot/share/scramdb
56 cat > %instroot/bin/scram << \EOF
57 #!/bin/sh
58
59 # FIXME: Handle -re?
60 # FIXME: Since we can install the same package on many platforms in
61 # one tree, should the project lookup database be platform-specific?
62
63 SCRAM=$0
64 : ${SCRAM_HOME=%i}
65 : ${SCRAM_LOOKUPDB=%instroot/share/scramdb/project.lookup}
66 : ${SCRAMPERL="/usr/bin/env perl"}
67 PERL5LIB=$SCRAM_HOME/src${PERL5LIB+":$PERL5LIB"}
68 : ${SITENAME=CERN}
69 : ${SEARCHOVRD=true}
70 : ${LOCTOOLS=NODEFAULT}
71 export SCRAM SCRAM_HOME SCRAM_LOOKUPDB SCRAMPERL
72 export PERL5LIB SITENAME SEARCHOVRD LOCTOOLS
73
74 exec perl "$SCRAM_HOME/src/scramcli" ${1+"$@"}
75 EOF
76
77 mkdir -p %{i}/etc/profile.d
78 echo "#!/bin/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 echo "#!/bin/csh" > %i/etc/profile.d/dependencies-setup.csh
81 echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
82
83 chmod 755 %instroot/bin/scram
84 perl -p -i -e "s|#!.*perl|#!/usr/bin/env perl|" $(find %{i})
85 %files
86 %i
87 %instroot/bin/scram
88 %instroot/share/scramdb
89 %post
90 %{relocateConfig}etc/profile.d/dependencies-setup.sh
91 %{relocateConfig}etc/profile.d/dependencies-setup.csh
92
93 perl -p -i -e "s|%instroot|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/scram