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.41 by eulisse, Thu Sep 28 13:44:29 2006 UTC vs.
Revision 1.76 by muzaffar, Mon Feb 25 10:51:29 2008 UTC

# Line 1 | Line 1
1 < ### RPM lcg SCRAMV1 V1_0_3
2 < ## INITENV +PATH PATH %instroot/bin
1 > ### RPM lcg SCRAMV1 V1_1_7
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 > Requires: p5-template-toolkit p5-uri p5-xml-parser p5-libwww-perl
11   Provides: perl(SCRAM::Helper)
12   Provides: perl(Utilities::AddDir)
13   Provides: perl(Utilities::Architecture)
# Line 26 | Line 32 | Provides: perl(Utilities::GroupChecker)
32  
33   # This package is somewhat unusual compared to other packages we
34   # build: we install the normally versioned product "SCRAM", but also
35 < # create the front-end "scram" wrapper and the package database.  The
36 < # 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).
35 > # create the package database.  The latter do not follow the
36 > # standard versioning.
37   #
38   # The database is only created, but never changeed.  It is made part
39   # of this package, but none of the files in it are included, so if
# Line 39 | Line 41 | Provides: perl(Utilities::GroupChecker)
41   # check this is really so -- should we use %dir, or the default is
42   # good?)
43   #
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 #
44   # We do the install ourselves, as "Installation/install_scram" would
45   # do, but putting the results elsewhere and using our own scram
46   # wrapper instead of using the supplied one -- mainly for easier
# Line 51 | Line 50 | Provides: perl(Utilities::GroupChecker)
50   # FIXME: should we have more than one project database and link them
51   # together into one big one?
52  
53 < %define cvsrepo  cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/SCRAM?passwd=AA_:yZZ3e  
54 <
55 < Source0: %{cvsrepo}&tag=-r%{v}&module=SCRAM&output=/source.tar.gz
53 > %define cvsrepo  cvs://:pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e
54 > %define cvstag %realversion
55 > Source0: %{cvsrepo}&tag=-r%{cvstag}&module=SCRAM&output=/source.tar.gz
56  
57   %prep
58 + #SCRAM version policy check
59 + %define SCRAM_REL_SERIES %(echo %v | grep '^V[0-9]\\+_[0-9]\\+_[0-9]\\+' | sed 's|^\\(V[0-9]\\+_[0-9]\\+\\)_.*|\\1|')
60 + if [ "X%{SCRAM_REL_SERIES}" == "X" ] ; then
61 +  echo "You are trying to build SCRAM version %v which does not follow the SCRAM version policy. Valid SCRAM versions should be of the form V[0-9]+_[0-9]+_[0-9].*"
62 +  exit 1
63 + fi
64   %setup -n SCRAM
65   %build
66   %install
67   tar -cf - . | tar -C %i -xvvf -
68 < rm -rf %i/cgi
69 < mkdir -p %instroot/bin %instroot/share/scramdb %i/Installation
65 < mkdir -p %i/bin
66 < touch %instroot/share/scramdb/project.lookup
68 > mkdir -p %instroot/%cmsplatf/lcg/SCRAMV1/scramdb %i/bin %i/Installation
69 > touch %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
70  
71 < cat Installation/scram.pl.in | sed -e "s|@PERLEXE@|/usr/bin/env perl|;s|@SCRAM_HOME@|%i|;s|@INSTALLDIR@|%i/src|" > %i/bin/scramv1
72 < 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
71 > cat Installation/scram.pl.in | sed -e "s|@PERLEXE@|%perl|;s|@SCRAM_HOME@|%i|g;s|@INSTALLDIR@|%i/src|g" > %i/bin/scram
72 > 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
73   chmod +x %i/src/main/scram.pl
74 < cat Installation/SCRAM_SITE.pm.in | sed -e "s|@SCRAM_HOME@|%i|;s|@SCRAM_LOOKUPDB_DIR@|%instroot/share/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
75 <
76 < # 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/share/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
74 > 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
75 > sed -e "s|@SCRAM_VERSION@|%v|" src/SCRAM/SCRAM.pm > %i/src/SCRAM/SCRAM.pm
76 > chmod 755 %i/bin/scram
77  
78 < mkdir %i/etc
78 > mkdir -p %i/etc
79   echo $PERL5LIB > %i/etc/perl5lib.env
80  
81   mkdir -p %{instroot}/%{cmsplatf}/etc/profile.d
82   mkdir -p %{i}/etc/profile.d
83   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
84   echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
85   echo "source $P5_URI_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
86   echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
87   echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
88  
89   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
90   echo "source $P5_TEMPLATE_TOOLKIT_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
91   echo "source $P5_URI_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
92   echo "source $P5_XML_PARSER_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
93   echo "source $P5_LIBWWW_PERL_ROOT/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
94  
95 < perl -p -i -e "s|#!.*perl|/usr/bin/env perl|" %{i}/doc/doxygen/DoxyFilt.pl
95 > %perl -p -i -e "s|#!.*perl|#!%perl|" %{i}/doc/doxygen/DoxyFilt.pl
96  
97   %post
98   %{relocateConfig}etc/perl5lib.env
99   %{relocateConfig}Installation/SCRAM_SITE.pm
100 < %{relocateConfig}bin/scramv1
100 > %{relocateConfig}bin/scram
101   %{relocateConfig}src/main/scram.pl
102   %{relocateConfig}etc/profile.d/dependencies-setup.sh
103   %{relocateConfig}etc/profile.d/dependencies-setup.csh
104 < # If and only if there is no default-scramv1 set the default to be the version we package in this spec.
105 < OLD_VERSION=""
106 < if [ -f $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version ]
107 < then
108 <    mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
109 <    OLD_VERSION=`cat $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version`
104 >
105 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scram
106 > # default version for SCRAM release series Vx_y_
107 > VERSION_STR="%v"
108 > if [ -f $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scram/%{SCRAM_REL_SERIES} ] ; then
109 >  VERSION_STR="$VERSION_STR `cat $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scram/%{SCRAM_REL_SERIES}`"
110   fi
111 < NEW_VERSION=%v
112 < (echo $OLD_VERSION;echo $NEW_VERSION) | sort | tail -1 > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version
111 > echo $VERSION_STR | tr ' ' '\n' | sort | tail -1 > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scram/%{SCRAM_REL_SERIES}
112 > # default version in common
113 > VERSION_STR="%v"
114 > if [ -f $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version ] ; then
115 >  VERSION_STR="$VERSION_STR `cat $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version`"
116 > fi
117 > echo $VERSION_STR | tr ' ' '\n' | sort | tail -1 > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/default-scramv1-version
118  
119 < # Create the wrapper script.
120 < # This has to be done in the post installation script because otherwise it gets deleted when
121 < # uninstalling the old revision of scram.
122 < cat << \EOF_BIN_SCRAMV1 > $RPM_INSTALL_PREFIX/bin/scramv1
123 < #!/bin/sh
124 < CMSARCH=`cmsarch`
125 < SCRAM_VERSION=`cat %{instroot}/$CMSARCH/etc/default-scramv1-version`
126 < source %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/etc/profile.d/init.sh
127 < %{instroot}/$CMSARCH/lcg/SCRAMV1/$SCRAM_VERSION/bin/scramv1 $@
128 < EOF_BIN_SCRAMV1
143 < chmod +x $RPM_INSTALL_PREFIX/bin/scramv1
144 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/bin/scramv1
119 > mkdir -p $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb
120 > touch $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
121 > if [ -f $RPM_INSTALL_PREFIX/share/scramdb/project.lookup ] ; then
122 >  dblinked=`grep "DB $RPM_INSTALL_PREFIX/share/scramdb/project.lookup" $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup`
123 >  if [ "X$dblinked" = "X" ] ; then
124 >    echo '!DB' $RPM_INSTALL_PREFIX/share/scramdb/project.lookup > $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link
125 >    cat $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup >> $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link
126 >    mv $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup.link $RPM_INSTALL_PREFIX/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
127 >  fi
128 > fi
129  
130   %files
131   %i
132 < %instroot/share/scramdb
133 < %exclude %instroot/share/scramdb/project.lookup
132 > %instroot/%cmsplatf/lcg/SCRAMV1/scramdb
133 > %exclude %instroot/%cmsplatf/lcg/SCRAMV1/scramdb/project.lookup
134   %exclude %i/scripts/DrDOC.sh

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines