ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-cvs-utils.spec
Revision: 1.9
Committed: Tue Aug 22 16:35:38 2006 UTC (18 years, 8 months ago) by eulisse
Branch: MAIN
CVS Tags: re20080623, forPHEDEX303, forPHEDEX-datasvc100, forPHEDEX302, forPHEDEX301, forPHEDEX300, forPHEDEX300pre14, forPHEDEX300pre13, forPHEDEX300pre12, forPHEDEX300pre11, forPHEDEX-datasvc002, forPHEDEX-datasvc001, forPHEDEX300pre7, forPHEDEX300pre6, forPHEDEX263, forPHEDEX262_cmsbuild2, forPHEDEX262_cmsbuild, forPHEDEX262, forPHEDEX261-slc3, forPHEDEX261, forPHEDEX260-1, forPHEDEX260, ge20071212-phedex, forPHEDEX2542, forPHEDEX2541, forPHEDEX2540, forPHEDEX2536, forPHEDEX2535, forPHEDEX2534, CMSSW_1_3_5, forPHEDEX2533, forPHEDEX2532, CMSSW_1_3_1_HLT6-slc4, CMSSW_1_3_1_HLT6-slc3, dl070627c135, forPHEDEX2531, forPHEDEX253, CMSSW_1_3_1_HLT5-slc4, CMSSW_1_3_1_HLT5-slc3, CMSSW_1_3_1_HLT4-slc4, CMSSW_1_3_1_HLT4-slc3, CMSSW_1_3_4, CMSSW_1_3_1_HLT3-slc4, CMSSW_1_3_1_HLT3-slc3, CMSSW_1_3_3-slc4, CMSSW_1_3_3, CMSSW_1_3_2-slc4, CMSSW_1_3_2, pe20070429-for131hlt2-slc4, pe20070429-for131hlt2-slc3, CMSSW_1_3_1_HLT1-slc3, CMSSW_1_2_6, pe20070426-131hlt1-slc3, CMSSW_1_2_5, forPHEDEX252, forPHEDEX251-micro-pre1, CMSSW_1_2_4, CMSSW_1_3_1, CMSSW_1_3_1-slc4, pe20070408, CMSSW_1_2_3, dl070330, CMSSW_1_3_0-slc4, CMSSW_1_3_0, dl070327, CMSSW_1_3_0_pre6t3, CMSSW_1_3_0_pre6-slc4t2, CMSSW_1_3_0_pre6t2, CMSSW_1_3_0_pre6, CMSSW_1_3_0_pre6-slc4, for120_g4821, forPHEDEX251, POOL_2_4_9-p2-slc4, POOL_2_4_9-p2, nrCMSSW_1_3_0_pre5-m32-slc3, nrCMSSW_1_3_0_pre5-m32, nr20070307_130pre5-m32-slc4, nr20070307_m32, CMSSW_1_3_0_pre5, CMSSW_1_3_0_pre5-slc4, nr070301_amd64m32, CMSSW_1_3_0_pre4-slc4-p1, CMSSW_1_3_0_pre4-p1, CMSSW_1_3_0_pre4, CMSSW_1_3_0_pre4-slc4, CMS_145_2-slc4, CMS_145_2-slc3, sfa160207, CMSSW_1_3_0_pre3-slc4, CMSSW_1_3_0_pre3, sfa120207slc4_p1, sfa120207slc4, sfa120207slc3, dl070211, nr070211_cms144a_2-p1slc4, nr070210_cms144a_2-p1slc4, cms144a_2-p1slc3, forCMS145_2_slc4, forCMS145_2_slc3, cms145pre5-slc4, forCMSSW120g482, cms145pre5-slc3, cms145pre4-slc3, cms145pre3-slc3, cms145pre2-slc3, cms145pre1-slc3, pe20070208, GE20070207, pe20070205b, forPHEDEX250, CMSSW_1_3_0_SLC4_pre2, pe20070205a, pe20070205, CMSSW_1_3_0_pre2, forCMS144_2-slc3, forCMS144_2-slc4, sfa010207-slc4, sfa010207-slc3, forCMSSW121-slc3, forCMSSW122-slc3, cms144slc3p2, cms144slc4p1, cms144slc3p1, cms144spc3p1, sfa300107, sfa390107, sfa290107, CMSSW_1_3_0_SLC4_pre1, CMSSW_1_3_0_pre1, for143hsv1-slc3-p5, for143hsv1-slc4-p5, for143hsv1-slc3-p4, for143hsv1-slc4-p4, for143hsv1-slc4-p3, for143hsv1-slc3-p3, for143hsv1-slc4-p2, for143hsv1-slc3-p2, for143hsv1-slc3-p1, for143hsv1-slc4, for143hsv1-slc3, for143hsv1, test143f_sv1-slc4, forCMSSW120-slc4, forCMSSW120g481, forCMSSW120-slc3, forCMS143f-slc4, forCMS143f-slc3, for120p9, pe20061201c, pe20061201b, pe20061201a, ge200611302202, for120p8-g481p2cms1, for120p8, for112, for120p7, for111, for120p6, cms143a-slc3, for120p5-slc3, forPHEDEX242, for120p5slc4, for120p5slc3, forCMS143_2_rootfix, forCMS143_2_slc4, forCMS143_2_slc3, sfa061106pm, sfa061106am, sa20061106, sfa031106pm, sfa031106, sfa021106, sa20061002, for120p4, for120p3, for120p2-slc4-rc1, forPHEDEX241, for106, ge20061020-for106, pre-for106, for120p2, for105, for104, for110, for120p1, for110p4, for103, for110p3, for102, pe060927, for101-take3, for101-take2, for101, forGeant481, for110p2, CMSSW_1_0_0, for110p5, for110p1, for084, for100p4, argiro-20060904-for100p4, for092, for137a_pre083_take2, pe20060827a, for137a_pre083, ge20060825, for100p2
Branch point for: lcgaa_for120p6_branch, lcg47branch
Changes since 1.8: +3 -2 lines
Log Message:
clcommit added as an alias to avoid pollution of the environment.

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