File: Brasfile

package info (click to toggle)
clig 1.1.3-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 328 kB
  • ctags: 72
  • sloc: tcl: 1,459; ansic: 253; makefile: 109; sh: 60; csh: 52
file content (90 lines) | stat: -rw-r--r-- 2,636 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
########################################################################
# 
# This is a command-file for a tool called `bras', my personal
# replacement of `make' written in Tcl. 
#
# THIS FILE IS NOT USED IN THE OPERATION OF clig. I only leave it in
# here to spread the word of bras :-> You will note that this file
# very much looks like Tcl. In fact it is, but `bras' also knows how
# to execute commands based on rules. 
#
# I use this file only to prepare the WWW-subdirectory where you
# probably found clig.
# 
#
# $Revision: 1.3 $, $Date: 1999/06/21 07:07:50 $
########################################################################


#####
##### First some definition.
#####
## The name of the directory I am preparing here.
set CLIGWWW /home1/kir/work/WWWkir/clighome

set VERSION [lindex [exec cat .version] 2]
set CLIGTARGZ clig-$VERSION.tar.gz
set CLIGRPM clig-$VERSION-0.noarch.rpm

## Don't ask why, but I maintain more than one CVS repository. However
## I know, that this module is here:
set env(CVSROOT) [glob ~/CVS]


## prepare a shortcut for all targets we want to make
foreach x "cmdline.cli index.html clig.ps.gz CHANGES $CLIGTARGZ $CLIGRPM" {
  lappend TARGETS $CLIGWWW/$x
}

########################################################################
#
# So much for the definitions. Here come the rules.
#
########################################################################

## This rule is easy. It makes sure, all targets are made.
Always all $TARGETS {
  puts "Done."
}
 
## This rule makes sure that the destination directory exists. Its
## command is only executed if $CLIGWWW does not exist. The rule is
## invoked by most of the rules which follow.
Exist $CLIGWWW {} {
  mkdir -p $target
}


## Make sure the most recent copy of CLIGTARGZ is available
Newer $CLIGWWW/$CLIGTARGZ "/home1/kir/rpm/SOURCES/$CLIGTARGZ // $CLIGWWW" { 
  cp $trigger $target
}

## Make sure the most recent copy of CLIGRPM is available
Newer $CLIGWWW/$CLIGRPM "/home1/kir/rpm/RPMS/noarch/$CLIGRPM // $CLIGWWW" { 
  cp $trigger $target
}

Newer $CLIGWWW/clig.ps.gz clig.man {
  man -t ./clig.man | gzip  >$target
}

## Go get the CHANGES file
Newer $CLIGWWW/CHANGES "$CLIGWWW/$CLIGTARGZ // $CLIGWWW" {
  cd $CLIGWWW
  set x [file root [file root $CLIGTARGZ]]
  tar xzfO $CLIGTARGZ $x/CHANGES >CHANGES
}

## How to prepare the example file
Newer $CLIGWWW/cmdline.cli "example/cmdline.cli // $CLIGWWW" {
  cp $trigger $target
}

## Don't forget the WWW-page
Newer $CLIGWWW/index.html "index.html $CLIGWWW/$CLIGTARGZ // $CLIGWWW" {
  sed -e "s/|CLIGTARGZ|/$CLIGTARGZ/g" \
	-e "s/|CLIGRPM|/$CLIGRPM/g" \
	index.html >$target
}