xisofs

 view release on metacpan or  search on metacpan

install.pl  view on Meta::CPAN

#!/usr/local/bin/perl

#----------------------------------------------------------------------
# Edit the lines below to customise
#----------------------------------------------------------------------

# Where the main files are stored
$libDir = "/usr/local/lib/xisofs";

# Where the main binary is sym-linked to
$binDir = "/usr/local/bin";

# Where the perl executable is, leave blank for PATH
$perlPath = "";

#----------------------------------------------------------------------
# Nothing below here should need changing
#----------------------------------------------------------------------

($who) = getpwuid($>);

if ($who ne 'root')
{
	print "You need to be 'root' to run this script, not '$who'\n";
	exit 1;
}

if ($perlPath eq '')
{
	chomp($perlPath = `which perl`);
	unless (-e $perlPath)
	{
		print "Cannot find perl executable on PATH, either set PATH to point to perl\nexecutable, or edit this script and alter the \$perlPath variable\n";
		exit 1;
	}
}

print <<EOT;

xisofs v1.3 Installation Script
(c) Copyright 1997 Steve Sherwood

Library Dir      : $libDir
Executable Dir   : $binDir
Perl Executable  : $perlPath
EOT

if (-d $libDir)
{
	if (-r "$libDir/VERSION")
	{
		open(IN,"$libDir/VERSION");
		$_ = <IN>;
		close(IN);

		if (/^xisofs/)
		{
			print "Previous Version : $_\n";
		}
		else
		{
			print "\nWARNING : $libDir exists, but does not contain a\n          recognised version of xisofs\n";
		}
	}
	else
	{
		print "\nWARNING : $libDir exists, but does not contain a\n          recognised version of xisofs\n"
	}
}

print "\nAre you sure you wish to install (y/n) ? ";
$_ = <STDIN>;

unless (/^y/)
{
	print "\nInstallation Aborted\n";
	exit 1;
}

foreach ($libDir,$binDir)



( run in 0.747 second using v1.01-cache-2.11-cpan-5b529ec07f3 )