2006-11-02 07:39:12 -05:00
|
|
|
#! /usr/bin/perl
|
2001-07-12 17:51:18 -04:00
|
|
|
|
2001-08-22 09:26:40 -04:00
|
|
|
use DirHandle;
|
|
|
|
use FileHandle;
|
|
|
|
|
2003-04-16 04:40:59 -04:00
|
|
|
#
|
2005-04-05 18:50:56 -04:00
|
|
|
# We used to try and work out the default mail domain, but this made
|
2003-04-16 04:40:59 -04:00
|
|
|
# it difficult to build a package. Well configured MTAs should
|
|
|
|
# fully qualify all addresses anyway.
|
|
|
|
#
|
|
|
|
my $domain = "";
|
2001-08-22 09:26:40 -04:00
|
|
|
|
|
|
|
my $prefix = exists $ENV{"PREFIX"} ? $ENV{"PREFIX"} : "/usr/local";
|
|
|
|
my $localbase = exists $ENV{"LOCALBASE"} ? $ENV{"LOCALBASE"} : "/usr/local";
|
|
|
|
my $config = "
|
2001-07-12 17:51:18 -04:00
|
|
|
# Saved state from exmh.install
|
2005-04-05 18:50:56 -04:00
|
|
|
# Mon Mar 14 10:59:18 MST 2005
|
2003-12-27 18:30:05 -05:00
|
|
|
set wish $localbase/bin/wish8.4
|
2005-04-05 18:50:56 -04:00
|
|
|
set exmh(version) {version 2.7.2 01/07/2005}
|
2001-07-12 17:51:18 -04:00
|
|
|
set exmh(name) exmh
|
2001-08-22 09:26:40 -04:00
|
|
|
set exmh(maintainer) welch\@acm.org
|
|
|
|
set mh_path $localbase/bin
|
|
|
|
set exmh(slocal) $localbase/libexec/slocal
|
|
|
|
set mime(dir) $localbase/bin
|
2001-07-12 17:51:18 -04:00
|
|
|
set mailcap_default /etc/mailcap
|
2001-08-22 09:26:40 -04:00
|
|
|
set mimetypes_default $prefix/share/exmh/mime.types
|
|
|
|
set exmh(expect) $localbase/bin/expect
|
|
|
|
set exmh(expectk) $localbase/bin/expectk
|
|
|
|
set faces(dir) $localbase/faces/faces
|
2001-07-12 17:51:18 -04:00
|
|
|
set faces(set,user) {local users usenix misc}
|
|
|
|
set faces(set,unknown) {domains unknown}
|
|
|
|
set faces(set,news) news
|
2001-08-22 09:26:40 -04:00
|
|
|
set faces(defaultDomain) {$domain}
|
2001-07-12 17:51:18 -04:00
|
|
|
set faces(suffix) {xpm gif xbm}
|
2001-08-22 09:26:40 -04:00
|
|
|
set pgp(pgp,path) $localbase/bin
|
|
|
|
set pgp(pgp5,path) $localbase/bin
|
|
|
|
set pgp(gpg,path) $localbase/bin
|
|
|
|
set pgp(pgp6,path) $localbase/bin
|
|
|
|
set glimpse(path) $localbase/bin
|
2001-07-12 17:51:18 -04:00
|
|
|
set sound(cmd) /usr/bin/aucat
|
2001-08-22 09:26:40 -04:00
|
|
|
set exmh(library) $prefix/share/exmh
|
|
|
|
set install(dir,bin) $prefix/bin
|
|
|
|
set install(dir,man) $prefix/man/man1
|
|
|
|
set install(dir,lib) $prefix/share/exmh
|
|
|
|
";
|
|
|
|
|
|
|
|
exists $ENV{"WRKSRC"} or die ("WRKSRC: missing from environment\n");
|
|
|
|
exists $ENV{"WRKBUILD"} or die ("WRKBUILD: missing from environment\n");
|
|
|
|
|
|
|
|
my $srcdir = $ENV{"WRKSRC"};
|
|
|
|
my $dstdir = $ENV{"WRKBUILD"};
|
|
|
|
my $dir = new DirHandle ($srcdir) or die ("$srcdir: $!\n");
|
|
|
|
while (my $name = $dir->read ()){
|
|
|
|
$name =~ m/^([^.].*)\.MASTER$/ or next;
|
|
|
|
$src = "$srcdir/$name";
|
|
|
|
$dst = "$dstdir/$1";
|
|
|
|
|
|
|
|
my $in = new FileHandle ($src, "r") or die ("$src: $!\n");
|
|
|
|
my $out = new FileHandle ($dst, "w") or die ("$dst: $!\n");
|
|
|
|
|
|
|
|
if (my $line = $in->getline ()){
|
|
|
|
$line =~ s|^#!expect|#!$localbase/bin/expect|;
|
2003-12-27 18:30:05 -05:00
|
|
|
$line =~ s|^#!tclsh|#!$localbase/bin/tclsh8.4|;
|
|
|
|
$line =~ s|^#!wish|#!$localbase/bin/wish8.4|;
|
2001-08-22 09:26:40 -04:00
|
|
|
$out->print ($line) or die ("$dst: $!\n");
|
|
|
|
|
|
|
|
while ($line = $in->getline ()){
|
|
|
|
if ($line =~ m/^#CONFIGURATION$/){
|
|
|
|
$out->print ($line) or die ("$dst: $!\n");
|
|
|
|
$out->print ($config) or die ("$dst: $!\n");
|
|
|
|
while ($line = $in->getline ()){
|
|
|
|
if ($line =~ m/^#END CONFIGURATION$/){
|
2003-04-16 04:40:59 -04:00
|
|
|
$out->print ($line) or die (
|
2001-08-22 09:26:40 -04:00
|
|
|
"$dst: $!\n");
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$in->eof () and die ("$src: "
|
|
|
|
. "missing 'END CONFIGURATION'\n");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$out->print ($line) or die ("$dst: $!\n");
|
|
|
|
}
|
2001-07-12 17:51:18 -04:00
|
|
|
}
|
2001-08-22 09:26:40 -04:00
|
|
|
}
|
|
|
|
$in->eof () or die ("$src: $!\n");
|
|
|
|
|
|
|
|
$in->close () or die ("$src: $!\n");
|
|
|
|
$out->close () or die ("$dst: $!\n");
|
|
|
|
}
|
|
|
|
$dir->close () or die ("$srcdir: $!\n");
|
|
|
|
|
|
|
|
exit (0);
|
|
|
|
|