ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/SCRAMV1.spec
(Generate patch)

Comparing COMP/CMSDIST/SCRAMV1.spec (file contents):
Revision 1.52 by ratnik, Fri Mar 2 16:52:14 2007 UTC vs.
Revision 1.64 by elmer, Fri Jan 11 11:27:18 2008 UTC

# Line 1 | Line 1
1 < ### RPM lcg SCRAMV1 V1_0_3-p1
2 < ## INITENV +PATH PATH %instroot/bin
1 > ### RPM lcg SCRAMV1 V1_1_0_reltag3
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
4 >
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 > Requires: p5-template-toolkit p5-uri p5-xml-parser p5-libwww-perl
12   Provides: perl(SCRAM::Helper)
13   Provides: perl(Utilities::AddDir)
14   Provides: perl(Utilities::Architecture)
# Line 26 | Line 33 | Provides: perl(Utilities::GroupChecker)
33  
34   # This package is somewhat unusual compared to other packages we
35   # build: we install the normally versioned product "SCRAM", but also
36 < # create the front-end "scram" wrapper and the package database.  The
37 < # latter do not follow the standard versioning.
31 < #
32 < # The front-end script can be overwritten by any version *PROVIDED*
33 < # the platform string comes first as is the default (i.e. the
34 < # installation tree looks like <platf>/lcg/SCRAM/<version>/src).
36 > # create the package database.  The latter do not follow the
37 > # standard versioning.
38   #
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
# Line 39 | Line 42 | Provides: perl(Utilities::GroupChecker)
42   # check this is really so -- should we use %dir, or the default is
43   # good?)
44   #
42 # The front-end wrapper and the script go at the installation root,
43 # not anywhere in the package tree.  They must remain modifiable.
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
# Line 51 | Line 51 | Provides: perl(Utilities::GroupChecker)
51   # FIXME: should we have more than one project database and link them
52   # together into one big one?
53  
54 < %define cvsrepo  cvs://:pserver:anonymous@isscvs.cern.ch:/local/reps/scram?passwd=AA_:yZZ3e
55 <
56 < Source0: %{cvsrepo}&tag=-r%{v}&module=SCRAM&output=/source.tar.gz
54 > %define cvsrepo  cvs://:pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e
55 > %define cvstag V1_1_0_reltag
56 > Source0: %{cvsrepo}&tag=-r%{cvstag}&module=SCRAM&output=/source.tar.gz
57  
58   %prep
59   %setup -n SCRAM
60   %build
61   %install
62   tar -cf - . | tar -C %i -xvvf -
63 < rm -rf %i/cgi
64 < mkdir -p %instroot/bin %instroot/%cmsplatf/lcg/SCRAMV1/scramdb %i/Installation
65 < mkdir -p %i/bin
63 > mkdir -p %instroot/%cmsplatf/lcg/SCRAMV1/scramdb %i/bin %i/Installation
64   touch %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
65  
66 < cat Installation/scram.pl.in | sed -e "s|@PERLEXE@|/usr/bin/env perl|;s|@SCRAM_HOME@|%i|;s|@INSTALLDIR@|%i/src|" > %i/bin/scramv1
67 < 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
66 > 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   chmod +x %i/src/main/scram.pl
69 < 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
70 <
71 < # cat > %instroot/bin/scramv1 << \EOF
74 < # #!/bin/sh
75 < #
76 < # # FIXME: Handle -re?
77 < # # FIXME: Since we can install the same package on many platforms in
78 < # # one tree, should the project lookup database be platform-specific?
79 < #
80 < # SCRAM=$0
81 < # : ${SCRAM_HOME=%i}
82 < # : ${SCRAM_LOOKUPDB=%instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup}
83 < # : ${SCRAMPERL="/usr/bin/env perl"}
84 < # PERL5LIB=$SCRAM_HOME/src${PERL5LIB+":$PERL5LIB"}
85 < # : ${SITENAME=CERN}
86 < # : ${SEARCHOVRD=true}
87 < # : ${LOCTOOLS=NODEFAULT}
88 < # export SCRAM SCRAM_HOME SCRAM_LOOKUPDB SCRAMPERL
89 < # export PERL5LIB SITENAME SEARCHOVRD LOCTOOLS
90 < #
91 < # exec perl "$SCRAM_HOME/src/scramcli" ${1+"$@"}
92 < # EOF
93 < chmod 755 %i/bin/scramv1
69 > 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 > sed -e "s|@SCRAM_VERSION@|%v|" src/SCRAM/SCRAM.pm > %i/src/SCRAM/SCRAM.pm
71 > chmod 755 %i/bin/scram
72  
73 < mkdir %i/etc
73 > mkdir -p %i/etc
74   echo $PERL5LIB > %i/etc/perl5lib.env
75  
76   mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d
77   mkdir -p %{i}/etc/profile.d
78   echo "#!/bin/sh" > %i/etc/profile.d/dependencies-setup.sh
101 echo "source $EXPAT_ROOT/etc/profile.d/init.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   echo "#!/bin/csh" > %i/etc/profile.d/dependencies-setup.csh
108 echo "source $EXPAT_ROOT/etc/profile.d/init.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 < perl -p -i -e "s|#!.*perl|/usr/bin/env perl|" %{i}/doc/doxygen/DoxyFilt.pl
90 > %perl -p -i -e "s|#!.*perl|#!%perl|" %{i}/doc/doxygen/DoxyFilt.pl
91  
92   %post
93   %{relocateConfig}etc/perl5lib.env
94   %{relocateConfig}Installation/SCRAM_SITE.pm
95 < %{relocateConfig}bin/scramv1
95 > %{relocateConfig}bin/scram
96   %{relocateConfig}src/main/scram.pl
97   %{relocateConfig}etc/profile.d/dependencies-setup.sh
98   %{relocateConfig}etc/profile.d/dependencies-setup.csh
# Line 130 | Line 106 | fi
106   NEW_VERSION=%v
107   (echo $OLD_VERSION;echo $NEW_VERSION) | sort | tail -1 > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version
108  
133 # Create the wrapper script.
134 # This has to be done in the post installation script because otherwise it gets deleted when
135 # uninstalling the old revision of scram.
136 cat << \EOF_BIN_SCRAMV1 > $RPM_INSTALL_PREFIX/bin/scramv1
137 #!/bin/sh
138 if [ "`cmsos`" == "slc4_amd64" ]; then
139  CMSARCH=slc4_amd64_gcc345
140 else
141  CMSARCH=`cmsarch`
142 fi
143 SCRAM_VERSION=`cat %{instroot}/$CMSARCH/etc/default-scramv1-version`
144 dir=`/bin/pwd`
145 while [ ! -d ${dir}/.SCRAM -a "$dir" != "/" ] ; do
146  dir=`dirname $dir`
147 done
148 if [ -f ${dir}/config/scram_version ] ; then
149  ver=`cat ${dir}/config/scram_version`
150  if [ -f %{instroot}/$CMSARCH/lcg/SCRAMV1/${ver}/etc/profile.d/init.sh ] ; then
151    SCRAM_VERSION=$ver
152  fi
153 fi
154 source %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/etc/profile.d/init.sh
155 %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/bin/scramv1 $@
156 EOF_BIN_SCRAMV1
157 chmod +x $RPM_INSTALL_PREFIX/bin/scramv1
158 perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/scramv1
159
109   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 <  if [ "X$dblinked" == "X" ] ; then
113 >  if [ "X$dblinked" = "X" ] ; then
114      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 < # Use slc4_ia32_gcc345 scramdb for slc4_amd64_gcc345 until we support native builds:
171 < if [ "%{cmsplatf}" == "slc4_amd64_gcc345" ]; then
172 <  ia32_db=$RPM_INSTALL_PREFIX/slc4_ia32_gcc345/lcg/SCRAMV1/scramdb/project.lookup
173 <  amd64_db=$RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
174 <  [ "`grep -c $ia32_db $amd64_db`" == "0" ] && \
175 <  (echo '!DB' $ia32_db >> $amd64_db )
176 <  unset ia32_db amd64_db
177 < fi
119 >
120   %files
121   %i
122   %instroot/%cmsplatf/lcg/SCRAMV1/scramdb

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines