2002-05-19 20:03:07 -04:00
|
|
|
#! %%PREFIX%%/bin/perl -w
|
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
2001-12-19 12:05:05 -05:00
|
|
|
# $FreeBSD$
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
# XXX what to do with perldoc, pelbug, perlcc ??
|
|
|
|
|
|
|
|
sub usage
|
|
|
|
{
|
|
|
|
print STDERR <<EOF;
|
|
|
|
Usage:
|
|
|
|
$0 port -> /usr/bin/perl is the perl5 port
|
|
|
|
$0 system -> /usr/bin/perl is the system perl
|
|
|
|
EOF
|
|
|
|
exit 2;
|
|
|
|
}
|
|
|
|
|
2002-06-09 07:24:22 -04:00
|
|
|
my $port_perl = '%%PREFIX%%/bin/perl';
|
|
|
|
$port_perl =~ tr|/|/|s;
|
|
|
|
|
2002-06-16 08:28:01 -04:00
|
|
|
my $ident = `/usr/bin/ident -q /usr/bin/perl5`;
|
2002-06-09 07:24:22 -04:00
|
|
|
|
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
2001-12-19 12:05:05 -05:00
|
|
|
@ARGV == 1 or usage();
|
|
|
|
if ($ARGV[0] eq 'port') {
|
|
|
|
switch_to_port();
|
|
|
|
} elsif ($ARGV[0] eq 'system') {
|
|
|
|
switch_to_system();
|
|
|
|
} else {
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
exit 0;
|
|
|
|
|
2002-06-09 07:24:22 -04:00
|
|
|
# Both functions depend on the idea that switch_to_port leaves
|
|
|
|
# perl5 alone. If the wrapper is installed on a -current system,
|
|
|
|
# /usr/bin/perl5 will also be the wrapper.
|
|
|
|
|
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
2001-12-19 12:05:05 -05:00
|
|
|
sub switch_to_system
|
|
|
|
{
|
|
|
|
# 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';
|
2002-06-09 07:24:22 -04:00
|
|
|
link '/usr/bin/perl5', '/usr/bin/perl%%PERL_VERSION%%';
|
|
|
|
|
|
|
|
if ($ident =~ m#src/usr.bin/perl/perl.c#) {
|
|
|
|
link '/usr/bin/perl5', '/usr/bin/suidperl';
|
|
|
|
} else {
|
|
|
|
link '/usr/bin/sperl5', '/usr/bin/suidperl';
|
|
|
|
}
|
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
2001-12-19 12:05:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
open MK, ">> /etc/make.conf" or die "/etc/make.conf: $!";
|
|
|
|
print MK <<EOF;
|
|
|
|
# -- use.perl generated deltas -- #
|
|
|
|
# Created: @{[scalar localtime]}
|
|
|
|
# Setting to use base system perl:
|
|
|
|
.undef PERL_VER
|
|
|
|
.undef PERL_VERSION
|
|
|
|
.undef PERL_ARCH
|
|
|
|
.undef NOPERL
|
2002-06-09 07:24:22 -04:00
|
|
|
.undef NO_PERL
|
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
2001-12-19 12:05:05 -05:00
|
|
|
|
|
|
|
EOF
|
|
|
|
close MK;
|
2002-06-16 08:28:01 -04:00
|
|
|
|
|
|
|
open MPOLD, "< /etc/manpath.config" or die "/etc/manpath.config: $!";
|
|
|
|
open MPNEW, "> /etc/manpath.config.new" or die "/etc/manpath.config.new: $!";
|
|
|
|
while (<MPOLD>) {
|
|
|
|
next if m|use.perl generated line|;
|
|
|
|
next if m|^\s*OPTIONAL_MANPATH\s+\S+/lib/perl5/%%PERL_VERSION%%/man\s*$|;
|
|
|
|
print MPNEW;
|
|
|
|
}
|
|
|
|
close MPNEW;
|
|
|
|
close MPOLD;
|
|
|
|
rename '/etc/manpath.config', '/etc/manpath.config.bak';
|
|
|
|
rename '/etc/manpath.config.new', '/etc/manpath.config';
|
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
2001-12-19 12:05:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sub switch_to_port
|
|
|
|
{
|
|
|
|
# protect against cases where people use PREFIX=/usr
|
|
|
|
if ($port_perl ne '/usr/bin/perl') {
|
2002-06-09 07:24:22 -04:00
|
|
|
if ($ident =~ m#src/usr.bin/perl/perl.c#) {
|
|
|
|
rename '/usr/bin/perl', '/usr/bin/perl-wrapper';
|
|
|
|
} else {
|
|
|
|
unlink '/usr/bin/perl';
|
|
|
|
}
|
|
|
|
|
|
|
|
unlink '/usr/bin/suidperl', '/usr/bin/perl%%PERL_VERSION%%';
|
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
2001-12-19 12:05:05 -05:00
|
|
|
|
|
|
|
symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl';
|
|
|
|
symlink '%%PREFIX%%/bin/suidperl', '/usr/bin/suidperl';
|
|
|
|
symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl%%PERL_VERSION%%';
|
|
|
|
}
|
|
|
|
|
|
|
|
open MK, ">> /etc/make.conf" or die "/etc/make.conf: $!";
|
|
|
|
print MK <<EOF;
|
|
|
|
# -- use.perl generated deltas -- #
|
|
|
|
# Created: @{[scalar localtime]}
|
|
|
|
# Setting to use base perl from ports:
|
|
|
|
PERL_VER=%%PERL_VER%%
|
|
|
|
PERL_VERSION=%%PERL_VERSION%%
|
|
|
|
PERL_ARCH=%%PERL_ARCH%%
|
|
|
|
NOPERL=yo
|
2002-06-09 07:24:22 -04:00
|
|
|
NO_PERL=yo
|
|
|
|
NO_PERL_WRAPPER=yo
|
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
2001-12-19 12:05:05 -05:00
|
|
|
|
|
|
|
EOF
|
|
|
|
close MK;
|
2002-06-16 08:28:01 -04:00
|
|
|
|
2002-06-16 08:40:13 -04:00
|
|
|
my $perl_port_manpath = <<EOF;
|
2002-06-16 08:28:01 -04:00
|
|
|
# -- use.perl generated line -- #
|
|
|
|
OPTIONAL_MANPATH %%PREFIX%%/lib/perl5/%%PERL_VERSION%%/man
|
|
|
|
EOF
|
2002-06-16 08:40:13 -04:00
|
|
|
|
|
|
|
open MPOLD, "< /etc/manpath.config" or die "/etc/manpath.config: $!";
|
|
|
|
open MPNEW, "> /etc/manpath.config.new" or die "/etc/manpath.config.new: $!";
|
|
|
|
my $modified = 0;
|
|
|
|
while (<MPOLD>) {
|
|
|
|
if (!$modified && m|^\s*OPTIONAL_MANPATH\s+\S+/lib/perl5/\S+/man\s*$|) {
|
|
|
|
print MPNEW $perl_port_manpath;
|
|
|
|
$modified = 1;
|
|
|
|
}
|
2002-06-16 08:28:01 -04:00
|
|
|
print MPNEW;
|
|
|
|
}
|
2002-06-16 08:40:13 -04:00
|
|
|
print MPNEW $perl_port_manpath unless $modified;
|
2002-06-16 08:28:01 -04:00
|
|
|
close MPNEW;
|
|
|
|
close MPOLD;
|
|
|
|
rename '/etc/manpath.config', '/etc/manpath.config.bak';
|
|
|
|
rename '/etc/manpath.config.new', '/etc/manpath.config';
|
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
2001-12-19 12:05:05 -05:00
|
|
|
}
|