ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/SCRAM.spec
Revision: 1.26
Committed: Wed Apr 18 23:46:01 2007 UTC (18 years ago) by ratnik
Branch: MAIN
CVS Tags: pe20070428a-ports, pe20070423b-ports, pe20070423a-ports
Changes since 1.25: +2 -0 lines
Log Message:
Changes for building  externals in 64/32 mode: added gcc-wrapper .

File Contents

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