#!/usr/bin/perl
$TARGET="/usr/local/bin";
print 'drsync.pl installer ($Id: install.pl,v 1.2 2000/12/30 14:14:32 dlux Exp $)'."\n";
eval {
  require File::Copy or die "You need to get and install File::Copy module from CPAN to use drsync!\n";
  @INC=grep { $_ ne '.' } @INC;
  require Getopt::Mixed and $has_gm=1;
};
if (!$has_gm) {
  my ($target_dir)=grep { /site.perl$/i } @INC;
  mkdir $target_dir."/Getopt",0777;
  print "copying Getopt/Mixed.pm to $target_dir\n";
  File::Copy::copy("Getopt/Mixed.pm",$target_dir."/Getopt")
    or die "Cannot copy Getopt/Mixed.pm to $target_dir\n";
};
print "copying drsync.pl to $TARGET\n";
File::Copy::copy("drsync.pl",$TARGET)
  or die "Cannot copy drsync.pl to $TARGET\n";
chmod 0755,$TARGET."/drsync.pl"
  or die "Cannot chmod drsync.pl";
