-
Notifications
You must be signed in to change notification settings - Fork 0
/
PREPARE
149 lines (121 loc) · 3.9 KB
/
PREPARE
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# -*- tcl -*-
# prepare module 'Trf' for distribution
## Make this script completely independent of external packages.
## Assume [pwd] == Toplevel directory of memchan distribution in
## preparation.
##
## This will be run via 'make dist'.
###
##
# ### Helper procedures.
##
###
proc LastChanges {} {
if {
[file exists ChangeLog.short] &&
![file isdirectory ChangeLog.short] &&
[file readable ChangeLog.short]
} {
set f [open ChangeLog.short r]
set t [read $f]
close $f
set start [string first "Changes from" $t]
set end $start
incr end
set offset [string first "Changes from" [string range $t $end end]]
if {$offset < 0} {
set end end
} else {
incr end $offset
incr end -1
}
return [string trim [string range $t $start $end]]
unset t
}
return {}
}
proc UpdateAnnounce {} {
set fh [open ANNOUNCE r]
set ano [read $fh]
close $fh
set fh [open ANNOUNCE w]
puts $fh [string map [list @CHANGES@ [LastChanges]] $ano]
close $fh
return
}
proc UpdateAnnounceMail {} {
set fh [open ANNOUNCE.MAIL r]
set mail [read $fh]
close $fh
set fh [open ANNOUNCE r]
set ano [read $fh]
close $fh
set fh [open ~/.signature r]
set sig [read $fh]
close $fh
set fh [open ANNOUNCE.MAIL w]
puts $fh [string map [list @ANO@ [LastChanges] @SIG@ $sig] $mail]
close $fh
return
}
###
##
#
# ### Eliminate data not required by a source distribution.
# ### Generate the official documentation in various formats.
# ### Also create the CHANGES file required by the Neosoft CS Archives.
# ### Ensure uptodate configure scripts for TEA and UNIX.
#
##
###
# do it ourself, must not be included into digest files!
file delete -force PREPARE customers zlib.vc
file delete -force md5-crypt/trf_features.h
file delete -force md5-crypt/trf_features.h.orig
file delete -force \
[glob patches/v7*] \
mails patches/v8.0a1 patches/v8.0a2 patches/v8.0b1 patches/v8.0b2 \
[glob patches/*/*.orig] generic/pkgIndex.tcl.in \
doc/install.tex doc/man.tex doc/html.sty doc/defs.tex \
[glob patches/nijtmans.*] DEPENDS doc/file doc/delete \
doc/FUN doc/ascii.man doc/ascii85 doc/scratch-pad \
doc/code34 doc/Notes doc/ToDo doc/trf.def \
doc/hash.operation doc/INSTALL doc/INSTALL.optional \
doc/ROADMAP doc/speed doc/trf.xpm doc/references \
patches/v8.1b3/gendiff patches/v8.1b3/getorig \
patches/v8.1b3/getcurrent patches/v8.1b3/setorig \
patches/v8.1/gendiff patches/v8.1/getorig patches/v8.1/genstubs \
patches/v8.1/getcurrent patches/v8.1/setorig \
patches/rc.h patches/patch.mp
file delete -force generic/blowfish generic/idea generic/rc4 generic/safer
file copy ChangeLog.short CHANGES
cd doc
exec ../tools/manpage_regen > /dev/null 2>/dev/null
cd ..
file mkdir doc/art/
file rename htdocs/art/logo100.gif doc/art/
file rename htdocs/art/logo520.jpg doc/art/
file rename htdocs/art/logo64.gif doc/art/
file delete -force htdocs
cd unix ; exec autoconf
cd .. ; exec autoconf
UpdateAnnounce
UpdateAnnounceMail
file rename ANNOUNCE.MAIL [file join .. [file tail [pwd]].AMAIL]
cd generic
exec tclsh ../tools/genStubs.tcl . trf.decls trfInt.decls
cd ..
# --------------------------------------------------------------
# generate message digests for all files and several digests
puts Generating digests (please wait)...
set files [exec /usr/bin/find . -type f -print]
regsub -all "\n" $files { } files
foreach md {crc crc-zlib adler md5 sha haval ripemd128 ripemd160} {
puts $md ...
catch {eval exec md -a $md $files > digests.$md}
}
# and now the tuning
exec chmod u+w unix mac win tests
eval exec chmod u+x unix/configure [glob tools/*]
eval exec chmod u+x configure mkinstalldirs testshell install-sh
exit