Snapback2

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use 5.006001;
use ExtUtils::MakeMaker;
use Data::Dumper;

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

sub initialize {
	my @scripts = map { "scripts/$_" } qw(
		snap_charge
		snapback_loop
		snapback2
		snapcopy
	);

	my $clink = `cp --help`;
	$clink =~ /--link/ 
		or print <<EOF;
###############

	WARNING
		This module will not work properly until it has access to the GNU cp command.
		It is required for the --link option, which is central to the functionality.
		If you install GNU cp in a non-standard place which is not first in your
		path, add this to snapback.conf:

			cp  /path/to/gnu/cp

##############
EOF
	my %X;
	$X{INSTALLDIRS}	= "perl";
	$X{clean} = {
		FILES => join(" ", 'scripts/initp.pl', @scripts, 'b_target', 'b_source', 'b_source2'),
	};
	$X{EXE_FILES}	= [ @scripts ];
	$X{PL_FILES}	= { 'relocate.util' => [ @scripts ] };
	for(%MV::Default) {
		$X{$_} = $MV::Default{$_}
			unless defined $X{$_};
	}
	mk_initp(\%X);
	return \%X;
}

sub mk_initp {
	my ($ref) = @_;
	local($Data::Dumper::Terse);
	$Data::Dumper::Terse = 1;
	open (INITP, ">scripts/initp.pl")
		or die "Can't write initp.pl: $!\n";
	print INITP '$MV::Self = ';
	print INITP Dumper($ref);
	print INITP ";\n1;";
	close INITP;
}


my %mv_specific = qw/
	CP            1
	RM            1
	SENDMAIL      1
	MV            1
	RSYNC         1
	RSYNCSHELL    1
/;

my %delete;
use Getopt::Long;
my @saveargs = @ARGV;
my %optctl = (
	'junk'			=> sub { 1 },
	'<>'			=> sub {
							my ($arg) = @_;
	warn "checking option $arg\n";
							my ($opt, $val);
							if($arg !~ /=/) {
								$opt = $arg;
								$val = 1;
							}
							else {
								($opt, $val) = split /=/, $arg, 2;
							}

							if ($mv_specific{uc $opt}) {
								$delete{$arg} = 1;
								$delete{$opt} = 1;
								$delete{$val} = 1;
								warn "It was specific arg=$arg\n";
							}

							$MV::Default{$opt} = $val;
							return;
						},
);

my @options = ( qw/



( run in 0.649 second using v1.01-cache-2.11-cpan-5511b514fd6 )