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