summaryrefslogtreecommitdiffstats
path: root/mail/majordomo/scripts/configure
blob: 68dc3d105de91d3526e79def62403060a11c3481 (plain)
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
#!/usr/bin/perl
#

eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
& eval 'exec /usr/bin/perl -S $0 $argv:q'
if 0;

if( getpwnam( "majordom" ) ) {
	( $null, $null, $mjUID ) = getpwnam( "majordom" );
} else {
	print "\nMajordomo user not found - aborting!\n\n";
	exit 1;
}

if( getgrnam( "majordom" ) ) {
	( $null, $null, $mjGID ) = getgrnam( "majordom" );
} else {
	print "\nMajordomo group not found - aborting!\n\n";
	exit 1;
}

chop( $hostname = `hostname` );

system( "/usr/bin/perl -pi -e 's|%%MJUID%%|$mjUID|g' $ENV{'WRKSRC'}/Makefile" );
system( "/usr/bin/perl -pi -e 's|%%MJGID%%|$mjGID|g' $ENV{'WRKSRC'}/Makefile" );
system( "/usr/bin/perl -pi -e 's|%%HOSTNAME%%|$hostname|g' $ENV{'WRKSRC'}/sample.cf $ENV{'WRKSRC'}/aliases.majordomo" );
foreach $file( "bounce-remind", "contrib/archive_mh.pl", "archive2.pl", "digest", "contrib/digest.num", "contrib/new-list", "contrib/sequencer", "majordomo", "medit", "request-answer", "resend", "sample.cf" ) {
	system( "/usr/bin/perl -pi -e 's|%%PREFIX%%|$ENV{'PREFIX'}|g' $ENV{'WRKSRC'}/$file" ); 
}
OpenPOWER on IntegriCloud