summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/installperl
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-04-29 22:56:06 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-04-29 22:56:06 +0000
commit34f9bf6909906fd38708a02be6a1882168b8f631 (patch)
tree06b51fab29857441400d3af27ee1379fc35a05d8 /gnu/usr.bin/perl/installperl
parent28d9bfb21210e90251556c888367330d5e9645ab (diff)
New configuration method, use a combination of hints and config.over. Also add in OpenBSD-specific patches
Diffstat (limited to 'gnu/usr.bin/perl/installperl')
-rw-r--r--gnu/usr.bin/perl/installperl69
1 files changed, 58 insertions, 11 deletions
diff --git a/gnu/usr.bin/perl/installperl b/gnu/usr.bin/perl/installperl
index b1d5bfb5c93..f3ca6b182b0 100644
--- a/gnu/usr.bin/perl/installperl
+++ b/gnu/usr.bin/perl/installperl
@@ -1,4 +1,8 @@
#!./perl
+# $OpenBSD: installperl,v 1.7 1997/11/30 07:48:39 millert Exp $
+#
+# This is hacked up, in order to support DESTDIR and INSTALL_STRIP.
+#
BEGIN {
require 5.004;
@@ -25,7 +29,7 @@ use File::Copy ();
use File::Path ();
use ExtUtils::Packlist;
use Config;
-use subs qw(unlink link chmod);
+use subs qw(unlink link chmod cmd);
use vars qw($packlist);
# override the ones in the rest of the script
@@ -90,14 +94,38 @@ die "Patchlevel of perl ($patchlevel)",
"and patchlevel of config.sh ($Config{'PATCHLEVEL'}) don't match\n"
if $patchlevel != $Config{'PATCHLEVEL'};
-# Fetch some frequently-used items from %Config
-my $installbin = $Config{installbin};
-my $installscript = $Config{installscript};
-my $installprivlib = $Config{installprivlib};
-my $installarchlib = $Config{installarchlib};
-my $installsitelib = $Config{installsitelib};
-my $installsitearch = $Config{installsitearch};
-my $installman1dir = $Config{installman1dir};
+my $installbin;
+my $installscript;
+my $installprivlib;
+my $installarchlib;
+my $installsitelib;
+my $installsitearch;
+my $installman1dir;
+my $installdest = $ENV{"DESTDIR"};
+
+$installdest =~ s:/+$::;
+if ($installdest ne '') {
+ # Fetch some frequently-used items from %Config, prefixing with DESTDIR.
+ $installbin = "$installdest/$Config{installbin}";
+ $installscript = "$installdest/$Config{installscript}";
+ $installprivlib = "$installdest/$Config{installprivlib}";
+ $installarchlib = "$installdest/$Config{installarchlib}";
+ $installsitelib = "$installdest/$Config{installsitelib}";
+ $installsitearch = "$installdest/$Config{installsitearch}";
+ $installman1dir = "$installdest/$Config{installman1dir}";
+ # Also whack $mainperldir.
+ $mainperldir = "$installdest/$mainperldir";
+} else {
+ # Fetch some frequently-used items from %Config
+ $installbin = $Config{installbin};
+ $installscript = $Config{installscript};
+ $installprivlib = $Config{installprivlib};
+ $installarchlib = $Config{installarchlib};
+ $installsitelib = $Config{installsitelib};
+ $installsitearch = $Config{installsitearch};
+ $installman1dir = $Config{installman1dir};
+}
+
my $man1ext = $Config{man1ext};
my $libperl = $Config{libperl};
# Shared library and dynamic loading suffixes.
@@ -150,6 +178,14 @@ chmod(0755, "$installbin/$perldll");
my $packlist = ExtUtils::Packlist->new("$installarchlib/.packlist");
# First we install the version-numbered executables.
+my $installcmd;
+if (defined($ENV{"INSTALL"})) {
+ $installcmd = $ENV{"INSTALL"}
+ . " " . $ENV{"INSTALL_COPY"}
+ . " " . $ENV{"INSTALL_STRIP"};
+} else {
+ $installcmd = "cp";
+}
if ($Is_VMS) {
safe_unlink("$installbin/$perl$exe_ext");
@@ -171,7 +207,8 @@ elsif ($^O eq 'mpeix') {
}
elsif ($^O ne 'dos') {
safe_unlink("$installbin/$perl$ver$exe_ext");
- copy("perl$exe_ext", "$installbin/$perl$ver$exe_ext");
+ cmd("$installcmd perl$exe_ext $installbin/perl$ver$exe_ext");
+ #copy("perl$exe_ext", "$installbin/$perl$ver$exe_ext");
chmod(0755, "$installbin/$perl$ver$exe_ext");
}
else {
@@ -181,7 +218,8 @@ else {
safe_unlink("$installbin/s$perl$ver$exe_ext");
if ($d_dosuid) {
- copy("suidperl$exe_ext", "$installbin/s$perl$ver$exe_ext");
+ cmd("$installcmd suidperl$exe_ext $installbin/sperl$ver$exe_ext");
+ #copy("suidperl$exe_ext", "$installbin/s$perl$ver$exe_ext");
chmod(04711, "$installbin/s$perl$ver$exe_ext");
}
@@ -486,6 +524,15 @@ sub link {
$success;
}
+sub cmd {
+ my($cmd) = @_;
+ print STDERR " $cmd\n";
+ unless ($nonono) {
+ system $cmd;
+ warn "Command failed!!!\n" if $?;
+ }
+}
+
sub chmod {
my($mode,$name) = @_;