#!/Perl/bin/Perl.exe require File::Spec; use File::Basename; use strict; use Config; use ExtUtils::MakeMaker; use LWP::Simple qw(getstore $ua is_success); if ($ENV{HTTP_proxy_user} and $ENV{HTTP_proxy_pass} and $ENV{HTTP_proxy} =~ /^http:\/\/([^@]+)$/) { my $proxy ="http://$ENV{HTTP_proxy_user}:$ENV{HTTP_proxy_pass}\@" . $1; print "setting user/pass into proxy_env...\n"; $ua->proxy(['http'], $proxy); } print <<'END'; ************************************************************************** This software package uses strong cryptography, so even if it is created, maintained and distributed from countries where it is legal to do this, it falls under certain export/import and/or use restrictions in some other parts of the world. PLEASE REMEMBER THAT EXPORT/IMPORT AND/OR USE OF STRONG CRYPTOGRAPHY SOFTWARE, PROVIDING CRYPTOGRAPHY HOOKS OR EVEN JUST COMMUNICATING TECHNICAL DETAILS ABOUT CRYPTOGRAPHY SOFTWARE IS ILLEGAL IN SOME PARTS OF THE WORLD. SO, WHEN YOU IMPORT THIS PACKAGE TO YOUR COUNTRY, RE-DISTRIBUTE IT FROM THERE OR EVEN JUST EMAIL TECHNICAL SUGGESTIONS OR EVEN SOURCE PATCHES TO THE AUTHOR OR OTHER PEOPLE YOU ARE STRONGLY ADVISED TO PAY CLOSE ATTENTION TO ANY EXPORT/IMPORT AND/OR USE LAWS WHICH APPLY TO YOU. THE AUTHORS OF OPENSSL ARE NOT LIABLE FOR ANY VIOLATIONS YOU MAKE HERE. SO BE CAREFUL, IT IS YOUR RESPONSIBILITY. CREDIT INFORMATION: This product includes cryptographic software written by Eric A. Young (eay@cryptsoft.com). This product includes software written by Tim J. Hudson (tjh@cryptsoft.com). ************************************************************************** END my $accept = prompt('Proceed with installation?', 'yes'); if ($accept =~ /^n/i) { suggest_manual('Installation aborted', 'fatal'); } my $lib1 = 'ssleay32.dll'; my $lib2 = 'libeay32.dll'; my $version = '0.9.8a'; my $default = $Config{binexp}; my $recommended = 'yes'; my $lib; foreach ($lib1, $lib2) { $lib = $_; if (my $hit = is_in_path($lib)) { print <<"END"; A copy of the needed library $lib was found in $hit. If this is compatible with the version ($version) used to compile the Perl module, all that is needed to complete the installation is to ensure $hit is in your PATH environment variable. END $recommended = 'no'; } if ($recommended eq 'yes') { print <<"END"; The library $lib is needed to complete the installation, and should be placed in a directory somewhere in your PATH environment variable. I can fetch and install this for you, if you don\'t already have it. END } my $proceed = prompt("Fetch $lib?", $recommended); suggest_manual("Aborting download of $lib.", 'warn') unless ($proceed =~ /^y/i); my $remote = 'http://theoryx5.uwinnipeg.ca/ppms/scripts/' . $lib; print "Fetching $remote ... "; getstore($remote, $lib); print " done!\n"; suggest_manual("Cannot find $lib", 'fatal') unless -f $lib; my $base = prompt("Where should $lib be placed?", $default); $base =~ s/$lib$//i; $base =~ s!\\!/!g; $base =~ s!/$!!; unless (-d $base) { my $ans = prompt("$base does not exist. Create it?", 'no'); if ($ans =~ /^y/i) { mkdir $base; suggest_manual("Could not create $base: $!", 'fatal') unless (-d $base); } else { suggest_manual("Will not create $base.", 'fatal'); } } if (-f "$base/$lib") { my $ans = prompt("$base/$lib exists. Overwrite?", 'no'); if ($ans =~ /^n/i) { suggest_manual("Will not overwrite $base/$lib.", 'fatal'); } } use File::Copy; move($lib, "$base/$lib"); suggest_manual("Moving $lib to $base failed: $!", 'fatal') unless (-f "$base/$lib"); print "$lib has been successfully installed to $base\n"; $default = $base; } sleep(5); sub suggest_manual { my ($msg, $type) = @_; print $msg, "\n"; print "Installation of $lib not completed.\n" if ($type eq 'fatal' and $lib); sleep (5); exit(0); } sub is_in_path { my $lib = shift; my $hit; foreach my $p (File::Spec->path) { my $candidate = File::Spec->catfile($p, $lib); if (-f $candidate) { $hit = $candidate; last; } } return $hit; }