From fb226407ee460453e08f0c16d1ed0ff4cfe74ebf Mon Sep 17 00:00:00 2001 From: Anton Berezin Date: Wed, 19 Dec 2001 17:05:05 +0000 Subject: Unforbid the port for the use of general FreeBSD public. Compile perl with BSDPAN support, both -current and -stable. The version of BSDPAN used here coincides accidentally with the one present in the -current system perl, but is installed in a different place. Provide a script, use.perl, to facilitate switching of the perl used by default between the system perl and this port. Also print a message describing the usage of use.perl (this works for the port and for the package built from it). The switching to the port version is done by removing /usr/bin/perl and /usr/bin/suidperl (they both have link count >1, so this is reversible), and making them to be symlinks to the corresponding binaries in $PREFIX/bin. Also, assignments of the correct values of PERL_VER, PERL_VERSION, and PERL_ARCH are appended to /etc/make.conf. Last, NOPERL=yes is appended to /etc/make.conf, so that the changes made will survive system upgrades from source. The switching to the system version is more or less a reverse of the process described above. Set and use PERL_ARCH which is independed from the one used by the system perl. Fix the port for post-malloc.h -current. Fix a small bogon when PREFIX was used in pkg-install (PKG_PREFIX should have been used instead). Reviewed by: markm, joe --- lang/perl5.12/files/use.perl | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 lang/perl5.12/files/use.perl (limited to 'lang/perl5.12/files') diff --git a/lang/perl5.12/files/use.perl b/lang/perl5.12/files/use.perl new file mode 100644 index 000000000000..4bd8fdef66d1 --- /dev/null +++ b/lang/perl5.12/files/use.perl @@ -0,0 +1,82 @@ +#! /usr/bin/perl5 -w +# $FreeBSD$ +use strict; + +# XXX what to do with perldoc, pelbug, perlcc ?? + +sub usage +{ + print STDERR < /usr/bin/perl is the perl5 port + $0 system -> /usr/bin/perl is the system perl +EOF + exit 2; +} + +@ARGV == 1 or usage(); +if ($ARGV[0] eq 'port') { + switch_to_port(); +} elsif ($ARGV[0] eq 'system') { + switch_to_system(); +} else { + usage(); +} +exit 0; + +sub switch_to_system +{ + my $port_perl = '%%PREFIX%%/bin/perl'; + $port_perl =~ tr|/|/|s; + + # protect against cases where people use PREFIX=/usr + if ($port_perl ne '/usr/bin/perl') { + unlink '/usr/bin/perl', '/usr/bin/suidperl', + '/usr/bin/perl%%PERL_VERSION%%'; + + link '/usr/bin/perl5', '/usr/bin/perl'; + link '/usr/bin/sperl5', '/usr/bin/suidperl'; + } + + open MK, ">> /etc/make.conf" or die "/etc/make.conf: $!"; + print MK <> /etc/make.conf" or die "/etc/make.conf: $!"; + print MK <