ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-cvs-utils.spec
Revision: 1.12
Committed: Wed Dec 6 22:47:56 2006 UTC (18 years, 4 months ago) by eulisse
Branch: MAIN
CVS Tags: apFor1412, apFor1411, CMSSW_1_4_10, apForCMSSW1410, CMSSW_1_4_9, apForCMSSW149, apForCMSSW148, CMSSW_1_4_8-slc3ap, CMSSW_1_4_8-slc3, CMSSW_1_4_7-slc3, ap-20071013, ap20071012b, ap20071012a, CMSSW_1_4_6-slc3, CMSSW_1_5_4, CMSSW_1_5_3, dl070725, dl070719, CMSSW_1_5_2, CMSSW_1_5_1, dl070629t2, dl070629, CMSSW_1_5_0-ignominy470, CMSSW_1_4_5-slc4, CMSSW_1_4_5-slc3, CMSSW_1_4_4-slc3, CMSSW_1_5_0, dl070621, CMSSW_1_5_0_pre6, CMSSW_1_4_4-slc4, dl070616, ap-144-slc3, ap-144-slc4, nrFWLITE_150pre5_noseal_newboost, dl070615, dl070614xdaq, dl070614, ap-143g483-slc3, ap-143g483-slc4, CMSSW_1_4_3-slc4, CMSSW_1_4_3-slc3, CMSSW_1_5_0_pre5, dl070602t2, dl070602, CMSSW_1_5_0_pre4, nrFWLITE_150pre4, CMSSW_1_4_2-slc4, CMSSW_1_4_2-slc3, dl070522_150pre4cand, CMSSW_1_4_1-slc4, CMSSW_1_4_1-slc3, CMSSW_1_5_0_pre3, pe20070518c, pe20070518b, pe20070518a, CMSSW_1_4_0_DAQ1-slc3, CMSSW_1_4_0_DAQ1-slc4, pe20070517-for150p3ext, ap-140daq1-1-slc3, ap-140daq1-1-slc4, ap-140-1-slc3, ap-140-1-slc4, CMSSW_1_4_0_pre7-slc3, CMSSW_1_4_0_pre7, CMSSW_1_5_0_pre2, dl070505t4, dl070505t3, dl070505t2, dl070505, ap-140p7-1-slc4, ap-140p7-1-slc3, ap-140p6-1-slc4, ap-140p5-1-slc3, ap-140p5-1-slc4, dl070501, CMSSW_1_5_0_pre1, dl070428_for140pre5_slc3, dl070428_for140pre5slc4t2, dl070428_for140pre5slc4, pe20070428b, pe20070428a, CMSSW_1_4_0_pre4, CMSSW_1_4_0_pre4-slc3, pe20070425c-for150p1, pe20070525b-slc4, pe20070525a, pe20070424b-slc3, pe20070424b-slc4, pe20070424a-slc4, pe20070424a-slc3, pe20070424-slc3, pe20070424-slc4, pe20070423b-slc3, pe20070423b-slc4, pe20070423a-slc3, pe20070423a-slc4, pe20070422b-slc4, pe20070422b-slc3, pe20070422a-slc4, pe20070422a-slc3, pe20070414b-ports, pe20070414a-ports, pe20070412b-ports, pe20070412a-ports, pe20070411a-ports, pe20070409a-ports, dl070407, pe20070407a-ports, dl070406t2, pe20070407-ports, dl070406, CMSSW_1_4_0_pre3-slc3, CMSSW_1_4_0_pre3, nrCMSSW_1_4_0_pre3_rc0, nrCMSSW_1_4_0_pre3_rc0-slc4, nr070403_cms147-slc4, nr070403_cms147, pe20070401, nrCMSSW_1_4_0_pre2_rc3, nrCMSSW_1_4_0_pre2_rc3-slc4, nrCMSSW_1_4_0_pre2_rc2-slc4, nrCMSSW_1_4_0_pre2_rc2, nr070327_frontier, nr070327_frontier-slc4, nrCMSSW_1_4_0_pre2_rc1, nrCMSSW_1_4_0_pre2_rc1-slc4, nrCMSSW_1_4_0_pre2_rc0-slc3, nrCMSSW_1_4_0_pre2_rc0, CMSSW_1_4_0_pre1-cand-slc4, CMSSW_1_4_0_pre1-cand, CORAL_1_7_1-slc4
Changes since 1.11: +6 -2 lines
Log Message:
Using correct projectname.

File Contents

# User Rev Content
1 eulisse 1.1 ### RPM cms cms-cvs-utils 1.0
2 eulisse 1.5 ## INITENV ALIAS_SH project source %i/bin/projch.sh
3     ## INITENV ALIAS_SH cmscvsroot source %i/bin/cmscvsroot.sh
4     ## INITENV ALIAS_CSH project source %i/bin/projch.csh
5     ## INITENV ALIAS_CSH cmscvsroot source %i/bin/cmscvsroot.csh
6 eulisse 1.9 ## INITENV ALIAS clcommit %i/bin/clcommit.sh
7 eulisse 1.1 Source: none
8    
9     %prep
10     %build
11     %install
12     mkdir -p %instroot/%cmsplatf/etc/profile.d/
13     mkdir -p %i/bin
14    
15     cat << \EOF_PROJCH_SH > %i/bin/projch.sh
16     # Check if theres any argument
17     #
18     if [ $# -gt 2 ]; then
19     echo "Usage : project project_name [version]";
20     else
21    
22     version="current"
23     VERSIO="current"
24     if [ $# = 2 ]; then
25     version=$2
26     VERSIO=$2
27     fi
28    
29     export VERSIO
30     #CVS STUFF
31     cvsbase=":kserver:cmscvs.cern.ch:/cvs_server/repositories"
32 eulisse 1.11 projectname=$1
33     case $projectname in
34 eulisse 1.10 CMSSW )
35     cvsbase=":kserver:cmscvs.cern.ch:/cvs_server/repositories"
36     ;;
37     * )
38     cvsbase=":kserver:isscvs.cern.ch/local/reps"
39 eulisse 1.11 projectname=`echo $projectname | tr "[A-Z]" "[a-z]"`
40 eulisse 1.10 ;;
41     esac
42    
43 eulisse 1.12 CVSROOT="${cvsbase}/$projectname"; export CVSROOT
44 eulisse 1.1
45     #SRT STUFF
46     #if [ -f $CMS_PATH/OO/Software/$1/releases/$version/SoftRelTools/SRTstartup.sh ]; then
47     # BFCURRENT=$version
48     # export BFCURRENT
49     # . $CMS_PATH/OO/Software/$1/releases/$version/SoftRelTools/SRTstartup.sh
50     #fi
51     fi
52     EOF_PROJCH_SH
53    
54     cat << \EOF_PROJCH_CSH > %{i}/bin/projch.csh
55     # Check if theres any argument
56     #
57     # if ( ($# > 1) | ($# < 1) ) then
58     if ( ($# > 2) | ($# < 1) ) then
59     echo "Usage : project project_name [version]"
60     else
61    
62     set version="current"
63     setenv VERSIO current
64     if ( $# == 2 ) then
65     set version=$argv[2]
66     setenv VERSIO $argv[2]
67     endif
68    
69     #CVS Stuff
70 eulisse 1.11 set projectname = $argv[1]
71 eulisse 1.1 set cvsbase = ":kserver:cmscvs.cern.ch:/cvs_server/repositories"
72 eulisse 1.10 if ( $argv[1] != "CMSSW" ) then
73     set cvsbase=":kserver:isscvs.cern.ch/local/reps"
74 eulisse 1.11 set projectname=`echo $projectname | tr "[A-Z]" "[a-z]"`
75 eulisse 1.10 endif
76    
77 eulisse 1.12 setenv CVSROOT "${cvsbase}/$projectname"
78 eulisse 1.1
79     #SRT STUFF
80     #if ( -f $CMS_PATH/OO/Software/$argv[1]/releases/${version}/SoftRelTools/SRTstartup.csh ) then
81     # setenv BFCURRENT $version
82     # source $CMS_PATH/OO/Software/$argv[1]/releases/${version}/SoftRelTools/SRTstartup.csh
83     #endif
84     endif
85     EOF_PROJCH_CSH
86    
87     cat << \EOF_CMSCVSROOT_SH > %i/bin/cmscvsroot.sh
88     # Check if theres any argument
89     #
90     if [ $# -gt 2 ]; then
91     echo "Usage : cmscvsroot project_name";
92     else
93    
94     #CVS STUFF
95     cvsbase=":pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories"
96 eulisse 1.12 projectname=$1
97 eulisse 1.10 case $1 in
98     CMSSW )
99     cvsbase=":pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories"
100     ;;
101     * )
102     cvsbase=":pserver:anonymous@isscvs.cern.ch/local/reps"
103 eulisse 1.12 projectname=`echo $projectname | tr "[A-Z]" "[a-z]"`
104 eulisse 1.10 ;;
105     esac
106    
107 eulisse 1.1 CVSROOT="${cvsbase}/$1"; export CVSROOT
108    
109     fi
110     EOF_CMSCVSROOT_SH
111    
112     cat << \EOF_CMSCVSROOT_CSH > %i/bin/cmscvsroot.csh
113     # Check if theres any argument
114     #
115     if ( ($# > 1) | ($# < 1) ) then
116     echo "Usage : cmscvsroot project_name"
117     else
118    
119     #CVS Stuff
120 eulisse 1.12 set projectname = $argv[1]
121 eulisse 1.1 set cvsbase = ":pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories"
122 eulisse 1.10 if ( $argv[1] != "CMSSW" ) then
123     set cvsbase=":pserver:anonymous@isscvs.cern.ch/local/reps"
124 eulisse 1.12 set projectname=`echo $projectname | tr "[A-Z]" "[a-z]"`
125 eulisse 1.10 endif
126 eulisse 1.1 setenv CVSROOT "${cvsbase}/$argv[1]"
127    
128     endif
129     EOF_CMSCVSROOT_CSH
130    
131 eulisse 1.9 cat << \EOF_CLCOMMIT > %i/bin/clcommit.sh
132 eulisse 1.8 #! /bin/sh
133 eulisse 1.7
134 eulisse 1.8 # commit version 0.9.4
135    
136     # Copyright (C) 1999, 2000, Free Software Foundation
137    
138     # This script is Free Software, and it can be copied, distributed and
139     # modified as defined in the GNU General Public License. A copy of
140     # its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
141    
142     # Originally by Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
143     # Heavily modified by Alexandre Oliva <oliva@dcc.unicamp.br>
144    
145     # This scripts eases checking in changes to CVS-maintained projects
146     # with ChangeLog files. It will check that there have been no
147     # conflicting commits in the CVS repository and print which files it
148     # is going to commit to stderr. A list of files to compare and to
149     # check in can be given in the command line. If it is not given, all
150     # files in the current directory (and below, unless `-l' is given) are
151     # considered for check in.
152    
153     # The commit message will be extracted from the differences between a
154     # file named ChangeLog* in the commit list, or named after -C, and the
155     # one in the repository (unless a message was specified with `-m' or
156     # `-F'). An empty message is not accepted (but a blank line is). If
157     # the message is acceptable, it will be presented for verification
158     # (and possible edition) using the $PAGER environment variable (or
159     # `more', if it is not set, or `cat', if the `-f' switch is given).
160     # If $PAGER exits successfully, the modified files (at that moment)
161     # are checked in, unless `-n' was specified, in which case nothing is
162     # checked in.
163    
164     # usage: commit [-v] [-h] [-f] [-l] [-n] [-q] [-z N] [-C ChangeLog_file]
165     # [-m msg|-F msg_file] [--] [file|dir ...]
166    
167     # -f --fast don't check (unless *followed* by -n), and just
168     # --force display commit message instead of running $PAGER
169     # -l --local don't descend into subdirectories
170     # -m msg --message=msg set commit message
171     # --msg=msg same as -m
172     # -F file --file=file read commit message from file
173     # -C file --changelog=file extract commit message from specified ChangeLog
174     # -n --dry-run don't commit anything
175     # -q --quiet run cvs in quiet mode
176     # -zN --compress=N set compression level (0-9, 0=none, 9=max)
177     # -v --version print version information
178     # -h,-? --help print short or long help message
179    
180     name=commit
181     : ${CVS=cvs}
182     cvsopt=
183     updateopt=
184     commitopt=
185     dry_run=false
186     commit=:
187     update=:
188     log_file="${TMPDIR-/tmp}/commitlog.$$"
189    
190     rm -f "$log_file"
191     trap 'rm -f "$log_file"; exit 1' 1 2 15
192    
193     # this just eases exit handling
194     main_repeat=":"
195     while $main_repeat; do
196    
197     repeat="test $# -gt 0"
198     while $repeat; do
199     case "$1" in
200     -f|--force|--fast)
201     update=false
202     PAGER=cat
203     shift
204     ;;
205     -l|--local)
206     updateopt="$updateopt -l"
207     commitopt="$commitopt -l"
208     shift
209     ;;
210     -m|--message|--msg)
211     if test $# = 1; then
212     echo "$name: missing argument for $1" >&2
213     break
214     fi
215     if test -f "$log_file"; then
216     echo "$name: you can have at most one of -m and -F" >&2
217     break
218     fi
219     shift
220     echo "$1" > "$log_file"
221     shift
222     ;;
223     -F|--file)
224     if test -f "$log_file"; then
225     echo "$name: you can have at most one of -m and -F" >&2
226     break
227     fi
228     if test $# = 1; then
229     echo "$name: missing argument for $1" >&2
230     break
231     fi
232     shift
233     if cat < "$1" > "$log_file"; then :; else
234     break
235     fi
236     shift
237     ;;
238     -C|--[cC]hange[lL]og)
239     if test $# = 1; then
240     echo "$name: missing argument for $1" >&2
241     break
242     fi
243     shift
244     if test ! -f "$1"; then
245     echo "$name: ChangeLog file \`$1' does not exist" >&2
246     break
247     fi
248     ChangeLog="$1"
249     ;;
250     -n|--dry-run)
251     PAGER=cat
252     commit=false
253     update=true
254     shift
255     ;;
256     -q|--quiet)
257     cvsopt="$cvsopt -q"
258     shift
259     ;;
260     -z|--compress)
261     if test $# = 1; then
262     echo "$name: missing argument for $1" >&2
263     break
264     fi
265     case "$2" in
266     [0-9]) :;;
267     *) echo "$name: invalid argument for $1" >&2
268     break
269     ;;
270     esac
271     cvsopt="$cvsopt -z$2"
272     shift
273     shift
274     ;;
275    
276     -m*|-F*|-C*|-z*)
277     opt=`echo "$1" | sed '1s/^\(..\).*$/\1/;q'`
278     arg=`echo "$1" | sed '1s/^-[a-zA-Z0-9]//'`
279     shift
280     set -- "$opt" "$arg" ${1+"$@"}
281     ;;
282     --message=*|--msg=*|--file=*|--[Cc]hange[Ll]og=*|--compress=*)
283     opt=`echo "$1" | sed '1s/^\(--[^=]*\)=.*/\1/;q'`
284     arg=`echo "$1" | sed '1s/^--[^=]*=//'`
285     shift
286     set -- "$opt" "$arg" ${1+"$@"}
287     ;;
288    
289     -v|--version)
290     sed '/^# '$name' version /,/^# Heavily modified by/ { s/^# //; p; }; d' < $0
291     exit 0
292     ;;
293     -\?|-h)
294     sed '/^# usage:/,/# -h/ { s/^# //; p; }; d' < $0 &&
295     echo
296     echo "run \`$name --help | more' for full usage"
297     exit 0
298     ;;
299     --help)
300     sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
301     exit 0
302     ;;
303     --)
304     shift
305     repeat=false
306     ;;
307     -*)
308     echo "$name: invalid flag $1" >&2
309     break
310     ;;
311     *)
312     repeat=false
313     ;;
314     esac
315     done
316     # might have used break 2 within the previous loop, but so what
317     $repeat && break
318    
319     $update && \
320     if echo "$name: checking for conflicts..." >&2
321     ($CVS $cvsopt -q -n update $updateopt ${1+"$@"} 2>/dev/null \
322     | while read line; do
323     echo "$line"
324     echo "$line" >&3
325     done | grep '^C') 3>&1 >/dev/null; then
326     echo "$name: some conflicts were found, aborting..." >&2
327     break
328     fi
329    
330     if test ! -f "$log_file"; then
331     if test -z "$ChangeLog"; then
332     for f in ${1+"$@"}; do
333     case "$f" in
334     ChangeLog* | */ChangeLog*)
335     if test -z "$ChangeLog"; then
336     ChangeLog="$f"
337     else
338     echo "$name: multiple ChangeLog files: $ChangeLog and $f" >&2
339     break
340     fi
341     ;;
342     esac
343     done
344     fi
345    
346     echo "$name: checking commit message..." >&2
347     $CVS $cvsopt diff -u ${ChangeLog-ChangeLog} \
348     | while read line; do
349     case "$line" in
350     "--- "*) :;;
351     "-"*)
352     echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
353     echo "$line" | sed 's/^.//' >&2;;
354     "+ "*)
355     echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
356     echo "$line" | sed 's/^.//' >&2;;
357     "+") echo;;
358     "+ "*) echo "$line";;
359     esac
360     done \
361     | sed -e 's,\+ ,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
362     || break
363     # The sed script above removes "+TAB" from the beginning of a line, then
364     # deletes the first and/or the last line, when they happen to be empty
365     fi
366    
367     if grep '[^ ]' < "$log_file" > /dev/null; then :; else
368     echo "$name: empty commit message, aborting" >&2
369     break
370     fi
371    
372     if grep '^$' < "$log_file" > /dev/null; then
373     echo "$name: *** Warning: blank lines should not appear within a commit messages." >&2
374     echo "$name: *** They should be used to separate distinct commits." >&2
375     fi
376    
377     ${PAGER-more} "$log_file" || break
378    
379     sleep 1 # give the user some time for a ^C
380    
381     # Do not check for empty $log_file again, even though the user might have
382     # zeroed it out. If s/he did, it was probably intentional.
383    
384     if $commit; then
385     echo " $CVS $cvsopt commit $commitopt -F $log_file ${1+"$@"} || break"
386     $CVS $cvsopt commit $commitopt -F $log_file ${1+"$@"} || break
387     fi
388    
389     main_repeat=false
390     done
391    
392     rm -f "$log_file"
393    
394     # if main_repeat was not set to `false', we failed
395     $main_repeat && exit 1
396     exit 0
397 eulisse 1.7 EOF_CLCOMMIT
398    
399 eulisse 1.1 chmod +x %i/bin/projch.sh
400     chmod +x %i/bin/projch.csh
401     chmod +x %i/bin/cmscvsroot.sh
402     chmod +x %i/bin/cmscvsroot.csh
403 eulisse 1.9 chmod +x %i/bin/clcommit.sh
404 eulisse 1.1
405     ln -sf %i/etc/profile.d/init.sh %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.sh
406 eulisse 1.3 ln -sf %i/etc/profile.d/init.csh %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh
407 eulisse 1.1
408     %files
409     %i
410     %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.sh
411     %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh
412    
413     %post
414 eulisse 1.6 perl -p -i -e 's|(.*setenv.*)|#$1|' $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.csh
415     perl -p -i -e 's|(.*export.*)|#$1|' $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.sh
416 eulisse 1.1 ln -sf $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.sh $RPM_INSTALL_PREFIX/%cmsplatf/etc/profile.d/S00cms-cvs-utils.sh
417 eulisse 1.4 ln -sf $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.csh $RPM_INSTALL_PREFIX/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh