summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/installperl
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-08-26 05:31:53 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-08-26 05:31:53 +0000
commitf7783de83886622dd836d065ce99f8e17110ee1a (patch)
tree51df7b5079f775fdb5643c15c4d8df863e8e2606 /gnu/usr.bin/perl/installperl
parent1ac73728e4fb9188de899a35eb12fe3adad86b1d (diff)
First cut at teaching perl about $DESTDIR. Also add a run of h2ph, creating
the .ph include files.
Diffstat (limited to 'gnu/usr.bin/perl/installperl')
-rw-r--r--gnu/usr.bin/perl/installperl33
1 files changed, 25 insertions, 8 deletions
diff --git a/gnu/usr.bin/perl/installperl b/gnu/usr.bin/perl/installperl
index bf8e6927eab..0ca0b5c4e4c 100644
--- a/gnu/usr.bin/perl/installperl
+++ b/gnu/usr.bin/perl/installperl
@@ -1,4 +1,9 @@
#!./perl
+# $OpenBSD$
+#
+# This is hacked up, in order to support DESTDIR.
+#
+
BEGIN { @INC=('./lib', '../lib') }
use File::Find;
use File::Path qw(mkpath);
@@ -35,14 +40,26 @@ 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
-$installbin = $Config{installbin};
-$installscript = $Config{installscript};
-$installprivlib = $Config{installprivlib};
-$installarchlib = $Config{installarchlib};
-$installsitelib = $Config{installsitelib};
-$installsitearch = $Config{installsitearch};
-$installman1dir = $Config{installman1dir};
+$installdest = $ENV{"DESTDIR"};
+if ($installdest ne '') {
+ # Fetch some frequently-used items from %Config, prefixing them 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}";
+} 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};
+}
$man1ext = $Config{man1ext};
# Did we build libperl as a shared library?
$d_shrplib = $Config{d_shrplib};