-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.PL
83 lines (68 loc) · 2.08 KB
/
Makefile.PL
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
#!/usr/bin/perl
# $Id: Makefile.PL,v 1.15 2011/01/01 00:56:12 ehood Exp $
# Pseudo Makefile.PL: Since MHonArc's history goes back to Perl 4 days,
# it has its own installation process. This file generates a simple
# Makefile to (paritally) satisfy the standard Perl 5 way to install
# software.
use Config;
open(MAKEFILE, ">Makefile") ||
die "Unable to create Makefile: $!\n";
## Map variable settings to install.me options
%vars = ( );
foreach (@ARGV) {
# make sure to only process arguments that look like variables
if (/=/) {
($var, $value) = split(/=/, $_, 2);
$vars{$var} = $value;
}
}
my $opt_prefix = defined($vars{'PREFIX'}) ?
"-prefix $vars{'PREFIX'}" : "";
my $opt_binpath = defined($vars{'INSTALLSCRIPT'}) ?
"-binpath $vars{'INSTALLSCRIPT'}" : "";
my $opt_libpath = defined($vars{'LIB'}) ?
"-libpath $vars{'LIB'}" :
defined($vars{'INSTALLSITELIB'}) ?
"-libpath $vars{'INSTALLSITELIB'}" :
defined($vars{'INSTALLPRIVLIB'}) ?
"-libpath $vars{'INSTALLPRIVLIB'}" : "";
my $opt_manpath = defined($vars{'INSTALLMAN1DIR'}) ?
"-manpath $vars{'INSTALLMAN1DIR'}" : "";
$opt_manpath =~ s/man1$//;
my $instme_args = "$opt_prefix $opt_binpath $opt_libpath $opt_manpath";
## Determine which perl should be used
my $perl = $Config{'perlpath'};
unless (-x $perl) {
$perl = join('/', $Config{'installbin'}, $Config{'perl'});
}
unless (-x $perl) {
$perl = 'perl';
}
## Determine other commands that will be used
my $chmod = $Config{'chmod'} || '/bin/chmod';
my $mkdir = $Config{'mkdir'} || '/bin/mkdir';
my $rm = $Config{'rm'} || '/bin/rm';
## Print Makefile
print MAKEFILE <<EOF;
# This Makefile is for the MHonArc software package.
CHMOD = $chmod
MKDIR = $mkdir
RM = $rm
PRGS = mhonarc mha-dbrecover mha-dbedit mha-decode
PERL = $perl
INSTALLPRG = install.me
default: _FORCE
\$(CHMOD) a+x \$(PRGS)
\$(CHMOD) -R a+r,a+X .
install: _FORCE
\$(PERL) \$(INSTALLPRG) -batch $instme_args
install-ask: _FORCE
\$(PERL) \$(INSTALLPRG) $instme_args
test: _FORCE
\@echo "No tests"
clean: _FORCE
\@echo "Nothing to clean"
_FORCE:
EOF
close(MAKEFILE);
exit(0);