forked from rc0/jbofihe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_kit
executable file
·83 lines (74 loc) · 2.43 KB
/
build_kit
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
#!/usr/local/bin/perl
# $Header$
# Copyright (C) Richard P. Curnow 1998-2001
# LICENCE
# Script used to 'groom' the distribution for release after doing the 'cvs export'.
# (Although not really needed in the distribution, this is bundled for
# completeness and for 'disaster-recovery' purposes.)
# This is set here rather than computed as runtime so that it is
# version-controlled. Otherwise, there is no way to guarantee being able to
# recreate an old version if the year has incremented since the kit was last
# built
$year = 2001;
@files = qx|find . -type f -print|;
open(COPY, "<LICINS");
@copy=<COPY>;
close(COPY);
for $f (@files) {
chomp $f;
$done = 0;
print "doing $f\n";
rename "$f","$f.tmp";
open (IN, "<$f.tmp");
open (OUT, ">$f");
while (<IN>) {
if (!$done && m,\/\* COPYRIGHT \*\/,) {
# When the copyright string is not locally in the source file. This is the default
# for most of the parts Richard wrote.
print OUT "/**********************************************************************\n";
print OUT " * Copyright (C) Richard P. Curnow 1998-$year\n";
for (@copy) {
print OUT " * ".$_;
}
print OUT " *********************************************************************/\n";
$done = 1;
} elsif (!$done && m,\# COPYRIGHT,) {
print OUT "#\n";
print OUT "# Copyright (C) Richard P. Curnow 1998-$year\n";
for (@copy) {
print OUT "# ".$_;
}
print OUT "#\n";
$done = 1;
} elsif (!$done && m,\/\* LICEN[CS]E \*\/,) {
# For the case where the copyright strings are in the file itself. This may be
# the case with multiple contributors.
print OUT "/*\n";
for (@copy) {
print OUT " * ".$_;
}
print OUT "*/\n";
$done = 1;
} elsif (!$done && m,\# LICEN[CS]E,) {
# For the case where the copyright strings are in the file itself. This may be
# the case with multiple contributors.
for (@copy) {
print OUT "# ".$_;
}
$done = 1;
} else {
print OUT;
}
}
close(IN);
close(OUT);
unlink "$f.tmp";
}
# Remove files that are not relevant in the .tar.gz distribution
# (they can be obtained via CVS for people who want them.)
unlink "build_kit";
unlink "make_release.pl";
unlink "LICINS";
system "rm -rf tests";
# Ensure configure can run out of the box in the expected way!
chmod 0755, "configure";