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
|
# Makefile.PL -- Makefile for makepatch
# Author : Ulrich Pfeifer
# Created On : Mon Feb 17 10:51:47 1997
# Last Modified By: Johan Vromans
# Last Modified On: Mon Oct 4 20:16:36 1999
# Update Count : 85
# Status : Released
# Verify perl version.
require 5.004;
# Verify CORE modules.
use Getopt::Long 2.00;
use IO;
use File::Basename;
use File::Spec;
use ExtUtils::MakeMaker;
# WriteMakefile parameter hash.
my %p = ( NAME => 'makepatch', VERSION => "2.00_03" );
# Extra info for newer versions.
if ( $[ >= 5.005 ) {
$p{AUTHOR} = 'Johan Vromans (jvromans@squirrel.nl)';
$p{ABSTRACT} = 'patchkit generate and apply tool';
}
# Scripts.
my @scripts = qw (makepatch applypatch);
if ( $^O eq "solaris" ) {
print STDERR <<EOD;
I see you're running Solaris.
The Solaris version of the 'patch' program is extremely buggy.
If the 'make test' command fails with a message
patch: Line must begin with '+ ', ' ', or '! '.
you must install a better version of 'patch', for example, GNU patch.
EOD
}
my $TMPDIR = $ENV{"TMPDIR"} || $ENV{TEMP} || "/tmp";
unless ( -d $TMPDIR && -w $TMPDIR ) {
print STDERR <<EOD;
The default location for temporary files ($TMPDIR) does not
exist, or is not accessible.
You must use environment variable TMPDIR or TEMP to designate a writable
directory to hold temporary files.
EOD
die ("Cannot continue\n");
}
=ignore
# Included modules.
my @mods = ();
# Required modules that are included in this kit for convenience.
# Syntax and semantics like PREREQ_PM.
my %req = ( Text::Filter => 0,
Text::Diff => 0,
Text::Patch => 0,
);
# Check modules, and ask to install them now.
$p{PREREQ_PM} = {};
foreach ( sort keys %req ) {
my $mod = $_;
my $rev = $req{$mod};
my $eval = "use $mod $rev";
eval $eval;
if ( $@ ) {
print STDERR ("\nI need the $mod package",
($rev ? ", version $rev or higher" : ""), ".\n",
"Shall I install it for you? ");
my $ans = <STDIN>;
if ( $ans =~ /^y/i ) {
$mod =~ s/::/\//g;
push (@mods, "$mod.pm");
}
else {
# Have MakeMaker complain.
$p{PREREQ_PM}->{$mod} = 0;
}
}
}
=cut
# Append scripts and modules to WriteMakefile args.
$p{EXE_FILES} = [ map { "script/$_" } @scripts ];
foreach ( @mods ) {
$p{PM}->{"lib/$_"} = '${INST_LIBDIR}'."/$_";
}
# Write the Makefile.
WriteMakefile (%p);
|