aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authortobez <tobez@FreeBSD.org>2001-12-20 01:05:05 +0800
committertobez <tobez@FreeBSD.org>2001-12-20 01:05:05 +0800
commit61a01042c97a9e12395089eba07a7850fc4597e1 (patch)
tree167fa02a68276e52c3e73969ff0b746f0b1068c2 /lang
parent5e90804273b510ae1e97b2a564b62ab72989abac (diff)
downloadfreebsd-ports-gnome-61a01042c97a9e12395089eba07a7850fc4597e1.tar.gz
freebsd-ports-gnome-61a01042c97a9e12395089eba07a7850fc4597e1.tar.zst
freebsd-ports-gnome-61a01042c97a9e12395089eba07a7850fc4597e1.zip
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
Diffstat (limited to 'lang')
-rw-r--r--lang/perl5.10/Makefile37
-rw-r--r--lang/perl5.10/distinfo1
-rw-r--r--lang/perl5.10/files/use.perl82
-rw-r--r--lang/perl5.10/pkg-descr6
-rw-r--r--lang/perl5.10/pkg-install4
-rw-r--r--lang/perl5.10/pkg-message22
-rw-r--r--lang/perl5.10/pkg-plist6
-rw-r--r--lang/perl5.12/Makefile37
-rw-r--r--lang/perl5.12/distinfo1
-rw-r--r--lang/perl5.12/files/use.perl82
-rw-r--r--lang/perl5.12/pkg-descr6
-rw-r--r--lang/perl5.12/pkg-install4
-rw-r--r--lang/perl5.12/pkg-message22
-rw-r--r--lang/perl5.12/pkg-plist6
-rw-r--r--lang/perl5.14/Makefile37
-rw-r--r--lang/perl5.14/distinfo1
-rw-r--r--lang/perl5.14/files/use.perl82
-rw-r--r--lang/perl5.14/pkg-descr6
-rw-r--r--lang/perl5.14/pkg-install4
-rw-r--r--lang/perl5.14/pkg-message22
-rw-r--r--lang/perl5.14/pkg-plist6
-rw-r--r--lang/perl5.16/Makefile37
-rw-r--r--lang/perl5.16/distinfo1
-rw-r--r--lang/perl5.16/files/use.perl82
-rw-r--r--lang/perl5.16/pkg-descr6
-rw-r--r--lang/perl5.16/pkg-install4
-rw-r--r--lang/perl5.16/pkg-message22
-rw-r--r--lang/perl5.16/pkg-plist6
-rw-r--r--lang/perl5.6/Makefile37
-rw-r--r--lang/perl5.6/distinfo1
-rw-r--r--lang/perl5.6/files/use.perl82
-rw-r--r--lang/perl5.6/pkg-descr6
-rw-r--r--lang/perl5.6/pkg-install4
-rw-r--r--lang/perl5.6/pkg-message22
-rw-r--r--lang/perl5.6/pkg-plist6
-rw-r--r--lang/perl5.8/Makefile37
-rw-r--r--lang/perl5.8/distinfo1
-rw-r--r--lang/perl5.8/files/use.perl82
-rw-r--r--lang/perl5.8/pkg-descr6
-rw-r--r--lang/perl5.8/pkg-install4
-rw-r--r--lang/perl5.8/pkg-message22
-rw-r--r--lang/perl5.8/pkg-plist6
-rw-r--r--lang/perl5/Makefile37
-rw-r--r--lang/perl5/distinfo1
-rw-r--r--lang/perl5/files/use.perl82
-rw-r--r--lang/perl5/pkg-descr6
-rw-r--r--lang/perl5/pkg-install4
-rw-r--r--lang/perl5/pkg-message22
-rw-r--r--lang/perl5/pkg-plist6
49 files changed, 994 insertions, 112 deletions
diff --git a/lang/perl5.10/Makefile b/lang/perl5.10/Makefile
index 3982ac9c2780..4f6e1b718cfc 100644
--- a/lang/perl5.10/Makefile
+++ b/lang/perl5.10/Makefile
@@ -7,13 +7,19 @@
PORTNAME= perl
PORTVERSION= ${PERL_VER}
+PORTREVISION= 1
CATEGORIES= lang devel perl5
-MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S|/modules/by-module|/src|}
+# If you don't use MASTER_SITE_OVERRIDE set to one of the
+# ftp.FreeBSD.org mirrors, fetching will be *very* slow.
+MASTER_SITES= ${MASTER_SITE_LOCAL} ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= ../../src tobez
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} BSDPAN-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= tobez@FreeBSD.org
-# This will need to be "fixed" in ../../Mk/bsd.port.mk as well.
PERL_VER= 5.6.1
+PERL_ARCH= mach
+PERL_VERSION= ${PERL_VER}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT=Configure
@@ -23,18 +29,13 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dman3dir=${PREFIX}/lib/perl5/${PERL_VER}/man/man3 \
-Dsitearch=${PREFIX}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH} \
-Dsitelib=${PREFIX}/lib/perl5/site_perl/${PERL_VER} \
- -Ui_gdbm
+ -Ui_gdbm -Ui_malloc -Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
INSTALLS_SHLIB= yes
INCLUDEDIR= /usr/include
.include <bsd.port.pre.mk>
-# If you know what you are doing, you may disable this!
-.if ${OSVERSION} > 300003
-FORBIDDEN= perl is in system
-.endif
-
MAN1= a2p.1 c2ph.1 dprofpp.1 find2perl.1 h2ph.1 h2xs.1 perl.1 \
perl5004delta.1 perl5005delta.1 perlaix.1 perlamiga.1 \
perlapi.1 perlapio.1 perlbook.1 perlboot.1 perlbot.1 \
@@ -112,10 +113,30 @@ MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}
test:
@(cd ${WRKSRC}; make test)
+BSDPAN_DEST= ${PREFIX}/lib/perl5/${PERL_VER}/BSDPAN
+BSDPAN_FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm \
+ ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+post-patch:
+ ${CP} ${FILESDIR}/use.perl ${WRKDIR}
+ ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g;' \
+ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \
+ -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \
+ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \
+ ${WRKDIR}/use.perl
+
post-install:
@strip ${PREFIX}/bin/perl ${PREFIX}/bin/suidperl
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl5
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL_VER}
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
+.for file in ${BSDPAN_FILES}
+ ${MKDIR} ${BSDPAN_DEST}/${file:H}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file}
+.endfor
@(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
+ @fmt ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/lang/perl5.10/distinfo b/lang/perl5.10/distinfo
index 06a932104bc7..366f0ccc3a75 100644
--- a/lang/perl5.10/distinfo
+++ b/lang/perl5.10/distinfo
@@ -1 +1,2 @@
MD5 (perl-5.6.1.tar.gz) = ec1ff15464809b562aecfaa2e65edba6
+MD5 (BSDPAN-5.6.1.tar.gz) = 2e80d385547ac4a9e0d8360c943ad155
diff --git a/lang/perl5.10/files/use.perl b/lang/perl5.10/files/use.perl
new file mode 100644
index 000000000000..4bd8fdef66d1
--- /dev/null
+++ b/lang/perl5.10/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 <<EOF;
+Usage:
+ $0 port -> /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 <<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
+
+EOF
+ close MK;
+}
+
+sub switch_to_port
+{
+ 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%%';
+
+ 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
+
+EOF
+ close MK;
+}
diff --git a/lang/perl5.10/pkg-descr b/lang/perl5.10/pkg-descr
index 8741d148a278..8493844a09da 100644
--- a/lang/perl5.10/pkg-descr
+++ b/lang/perl5.10/pkg-descr
@@ -3,10 +3,4 @@ awk and shell. See the manual page for more hype. There are also
many published by O'Reilly & Assoc. See pod/perlbook.pod for more
information.
---
-
-This port is marked FORBIDDEN as it conflics badly with the Perl5
-that is in the 'base' system. Sysadmins and users who know how to
-override this may do so, and must accept the risk of doing so.
-
- MarkM
diff --git a/lang/perl5.10/pkg-install b/lang/perl5.10/pkg-install
index e0d6a6bc7a46..47fee558c9ae 100644
--- a/lang/perl5.10/pkg-install
+++ b/lang/perl5.10/pkg-install
@@ -6,8 +6,8 @@ fi
INCLUDEDIR=/usr/include
-install -d ${PREFIX}/lib/perl5/site_perl/5.6.1/arch
-cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
+install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach
+cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
exit 0
diff --git a/lang/perl5.10/pkg-message b/lang/perl5.10/pkg-message
new file mode 100644
index 000000000000..e575728b19be
--- /dev/null
+++ b/lang/perl5.10/pkg-message
@@ -0,0 +1,22 @@
+Installation of Perl distribution is finished. Please note, that since
+Perl is also in the base system, this distribution will not be used by
+default.
+
+If you want this version of Perl to be used by default, please type
+
+ use.perl port
+
+Assuming that use.perl script (which was installed with the rest of the
+Perl distribution) can be found in your PATH (you might have to type
+`rehash' first, depending upon a shell you use), this action will
+replace /usr/bin/perl and /usr/bin/suidperl with symbolic links to the
+versions of these binaries in the Perl distribution. This action will
+also put some variables into your /etc/make.conf file, so that newly
+installed ports (not packages!) will use new version of perl, and the
+system upgrades from the source will not overwrite the changes made.
+
+At any time you can also type
+
+ use.perl system
+
+if you wish to revert back to the system version of perl.
diff --git a/lang/perl5.10/pkg-plist b/lang/perl5.10/pkg-plist
index 00b454a19b9d..132d7bf80a72 100644
--- a/lang/perl5.10/pkg-plist
+++ b/lang/perl5.10/pkg-plist
@@ -26,6 +26,7 @@ bin/podselect
bin/pstruct
bin/s2p
bin/splain
+bin/use.perl
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/AutoLoader.pm
lib/perl5/%%PERL_VER%%/AutoSplit.pm
@@ -33,6 +34,11 @@ lib/perl5/%%PERL_VER%%/B/assemble
lib/perl5/%%PERL_VER%%/B/cc_harness
lib/perl5/%%PERL_VER%%/B/disassemble
lib/perl5/%%PERL_VER%%/B/makeliblinks
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN/Override.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/Config.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/MM_Unix.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
lib/perl5/%%PERL_VER%%/CGI/Apache.pm
diff --git a/lang/perl5.12/Makefile b/lang/perl5.12/Makefile
index 3982ac9c2780..4f6e1b718cfc 100644
--- a/lang/perl5.12/Makefile
+++ b/lang/perl5.12/Makefile
@@ -7,13 +7,19 @@
PORTNAME= perl
PORTVERSION= ${PERL_VER}
+PORTREVISION= 1
CATEGORIES= lang devel perl5
-MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S|/modules/by-module|/src|}
+# If you don't use MASTER_SITE_OVERRIDE set to one of the
+# ftp.FreeBSD.org mirrors, fetching will be *very* slow.
+MASTER_SITES= ${MASTER_SITE_LOCAL} ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= ../../src tobez
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} BSDPAN-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= tobez@FreeBSD.org
-# This will need to be "fixed" in ../../Mk/bsd.port.mk as well.
PERL_VER= 5.6.1
+PERL_ARCH= mach
+PERL_VERSION= ${PERL_VER}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT=Configure
@@ -23,18 +29,13 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dman3dir=${PREFIX}/lib/perl5/${PERL_VER}/man/man3 \
-Dsitearch=${PREFIX}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH} \
-Dsitelib=${PREFIX}/lib/perl5/site_perl/${PERL_VER} \
- -Ui_gdbm
+ -Ui_gdbm -Ui_malloc -Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
INSTALLS_SHLIB= yes
INCLUDEDIR= /usr/include
.include <bsd.port.pre.mk>
-# If you know what you are doing, you may disable this!
-.if ${OSVERSION} > 300003
-FORBIDDEN= perl is in system
-.endif
-
MAN1= a2p.1 c2ph.1 dprofpp.1 find2perl.1 h2ph.1 h2xs.1 perl.1 \
perl5004delta.1 perl5005delta.1 perlaix.1 perlamiga.1 \
perlapi.1 perlapio.1 perlbook.1 perlboot.1 perlbot.1 \
@@ -112,10 +113,30 @@ MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}
test:
@(cd ${WRKSRC}; make test)
+BSDPAN_DEST= ${PREFIX}/lib/perl5/${PERL_VER}/BSDPAN
+BSDPAN_FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm \
+ ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+post-patch:
+ ${CP} ${FILESDIR}/use.perl ${WRKDIR}
+ ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g;' \
+ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \
+ -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \
+ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \
+ ${WRKDIR}/use.perl
+
post-install:
@strip ${PREFIX}/bin/perl ${PREFIX}/bin/suidperl
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl5
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL_VER}
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
+.for file in ${BSDPAN_FILES}
+ ${MKDIR} ${BSDPAN_DEST}/${file:H}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file}
+.endfor
@(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
+ @fmt ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/lang/perl5.12/distinfo b/lang/perl5.12/distinfo
index 06a932104bc7..366f0ccc3a75 100644
--- a/lang/perl5.12/distinfo
+++ b/lang/perl5.12/distinfo
@@ -1 +1,2 @@
MD5 (perl-5.6.1.tar.gz) = ec1ff15464809b562aecfaa2e65edba6
+MD5 (BSDPAN-5.6.1.tar.gz) = 2e80d385547ac4a9e0d8360c943ad155
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 <<EOF;
+Usage:
+ $0 port -> /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 <<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
+
+EOF
+ close MK;
+}
+
+sub switch_to_port
+{
+ 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%%';
+
+ 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
+
+EOF
+ close MK;
+}
diff --git a/lang/perl5.12/pkg-descr b/lang/perl5.12/pkg-descr
index 8741d148a278..8493844a09da 100644
--- a/lang/perl5.12/pkg-descr
+++ b/lang/perl5.12/pkg-descr
@@ -3,10 +3,4 @@ awk and shell. See the manual page for more hype. There are also
many published by O'Reilly & Assoc. See pod/perlbook.pod for more
information.
---
-
-This port is marked FORBIDDEN as it conflics badly with the Perl5
-that is in the 'base' system. Sysadmins and users who know how to
-override this may do so, and must accept the risk of doing so.
-
- MarkM
diff --git a/lang/perl5.12/pkg-install b/lang/perl5.12/pkg-install
index e0d6a6bc7a46..47fee558c9ae 100644
--- a/lang/perl5.12/pkg-install
+++ b/lang/perl5.12/pkg-install
@@ -6,8 +6,8 @@ fi
INCLUDEDIR=/usr/include
-install -d ${PREFIX}/lib/perl5/site_perl/5.6.1/arch
-cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
+install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach
+cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
exit 0
diff --git a/lang/perl5.12/pkg-message b/lang/perl5.12/pkg-message
new file mode 100644
index 000000000000..e575728b19be
--- /dev/null
+++ b/lang/perl5.12/pkg-message
@@ -0,0 +1,22 @@
+Installation of Perl distribution is finished. Please note, that since
+Perl is also in the base system, this distribution will not be used by
+default.
+
+If you want this version of Perl to be used by default, please type
+
+ use.perl port
+
+Assuming that use.perl script (which was installed with the rest of the
+Perl distribution) can be found in your PATH (you might have to type
+`rehash' first, depending upon a shell you use), this action will
+replace /usr/bin/perl and /usr/bin/suidperl with symbolic links to the
+versions of these binaries in the Perl distribution. This action will
+also put some variables into your /etc/make.conf file, so that newly
+installed ports (not packages!) will use new version of perl, and the
+system upgrades from the source will not overwrite the changes made.
+
+At any time you can also type
+
+ use.perl system
+
+if you wish to revert back to the system version of perl.
diff --git a/lang/perl5.12/pkg-plist b/lang/perl5.12/pkg-plist
index 00b454a19b9d..132d7bf80a72 100644
--- a/lang/perl5.12/pkg-plist
+++ b/lang/perl5.12/pkg-plist
@@ -26,6 +26,7 @@ bin/podselect
bin/pstruct
bin/s2p
bin/splain
+bin/use.perl
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/AutoLoader.pm
lib/perl5/%%PERL_VER%%/AutoSplit.pm
@@ -33,6 +34,11 @@ lib/perl5/%%PERL_VER%%/B/assemble
lib/perl5/%%PERL_VER%%/B/cc_harness
lib/perl5/%%PERL_VER%%/B/disassemble
lib/perl5/%%PERL_VER%%/B/makeliblinks
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN/Override.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/Config.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/MM_Unix.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
lib/perl5/%%PERL_VER%%/CGI/Apache.pm
diff --git a/lang/perl5.14/Makefile b/lang/perl5.14/Makefile
index 3982ac9c2780..4f6e1b718cfc 100644
--- a/lang/perl5.14/Makefile
+++ b/lang/perl5.14/Makefile
@@ -7,13 +7,19 @@
PORTNAME= perl
PORTVERSION= ${PERL_VER}
+PORTREVISION= 1
CATEGORIES= lang devel perl5
-MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S|/modules/by-module|/src|}
+# If you don't use MASTER_SITE_OVERRIDE set to one of the
+# ftp.FreeBSD.org mirrors, fetching will be *very* slow.
+MASTER_SITES= ${MASTER_SITE_LOCAL} ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= ../../src tobez
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} BSDPAN-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= tobez@FreeBSD.org
-# This will need to be "fixed" in ../../Mk/bsd.port.mk as well.
PERL_VER= 5.6.1
+PERL_ARCH= mach
+PERL_VERSION= ${PERL_VER}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT=Configure
@@ -23,18 +29,13 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dman3dir=${PREFIX}/lib/perl5/${PERL_VER}/man/man3 \
-Dsitearch=${PREFIX}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH} \
-Dsitelib=${PREFIX}/lib/perl5/site_perl/${PERL_VER} \
- -Ui_gdbm
+ -Ui_gdbm -Ui_malloc -Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
INSTALLS_SHLIB= yes
INCLUDEDIR= /usr/include
.include <bsd.port.pre.mk>
-# If you know what you are doing, you may disable this!
-.if ${OSVERSION} > 300003
-FORBIDDEN= perl is in system
-.endif
-
MAN1= a2p.1 c2ph.1 dprofpp.1 find2perl.1 h2ph.1 h2xs.1 perl.1 \
perl5004delta.1 perl5005delta.1 perlaix.1 perlamiga.1 \
perlapi.1 perlapio.1 perlbook.1 perlboot.1 perlbot.1 \
@@ -112,10 +113,30 @@ MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}
test:
@(cd ${WRKSRC}; make test)
+BSDPAN_DEST= ${PREFIX}/lib/perl5/${PERL_VER}/BSDPAN
+BSDPAN_FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm \
+ ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+post-patch:
+ ${CP} ${FILESDIR}/use.perl ${WRKDIR}
+ ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g;' \
+ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \
+ -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \
+ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \
+ ${WRKDIR}/use.perl
+
post-install:
@strip ${PREFIX}/bin/perl ${PREFIX}/bin/suidperl
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl5
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL_VER}
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
+.for file in ${BSDPAN_FILES}
+ ${MKDIR} ${BSDPAN_DEST}/${file:H}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file}
+.endfor
@(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
+ @fmt ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/lang/perl5.14/distinfo b/lang/perl5.14/distinfo
index 06a932104bc7..366f0ccc3a75 100644
--- a/lang/perl5.14/distinfo
+++ b/lang/perl5.14/distinfo
@@ -1 +1,2 @@
MD5 (perl-5.6.1.tar.gz) = ec1ff15464809b562aecfaa2e65edba6
+MD5 (BSDPAN-5.6.1.tar.gz) = 2e80d385547ac4a9e0d8360c943ad155
diff --git a/lang/perl5.14/files/use.perl b/lang/perl5.14/files/use.perl
new file mode 100644
index 000000000000..4bd8fdef66d1
--- /dev/null
+++ b/lang/perl5.14/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 <<EOF;
+Usage:
+ $0 port -> /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 <<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
+
+EOF
+ close MK;
+}
+
+sub switch_to_port
+{
+ 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%%';
+
+ 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
+
+EOF
+ close MK;
+}
diff --git a/lang/perl5.14/pkg-descr b/lang/perl5.14/pkg-descr
index 8741d148a278..8493844a09da 100644
--- a/lang/perl5.14/pkg-descr
+++ b/lang/perl5.14/pkg-descr
@@ -3,10 +3,4 @@ awk and shell. See the manual page for more hype. There are also
many published by O'Reilly & Assoc. See pod/perlbook.pod for more
information.
---
-
-This port is marked FORBIDDEN as it conflics badly with the Perl5
-that is in the 'base' system. Sysadmins and users who know how to
-override this may do so, and must accept the risk of doing so.
-
- MarkM
diff --git a/lang/perl5.14/pkg-install b/lang/perl5.14/pkg-install
index e0d6a6bc7a46..47fee558c9ae 100644
--- a/lang/perl5.14/pkg-install
+++ b/lang/perl5.14/pkg-install
@@ -6,8 +6,8 @@ fi
INCLUDEDIR=/usr/include
-install -d ${PREFIX}/lib/perl5/site_perl/5.6.1/arch
-cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
+install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach
+cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
exit 0
diff --git a/lang/perl5.14/pkg-message b/lang/perl5.14/pkg-message
new file mode 100644
index 000000000000..e575728b19be
--- /dev/null
+++ b/lang/perl5.14/pkg-message
@@ -0,0 +1,22 @@
+Installation of Perl distribution is finished. Please note, that since
+Perl is also in the base system, this distribution will not be used by
+default.
+
+If you want this version of Perl to be used by default, please type
+
+ use.perl port
+
+Assuming that use.perl script (which was installed with the rest of the
+Perl distribution) can be found in your PATH (you might have to type
+`rehash' first, depending upon a shell you use), this action will
+replace /usr/bin/perl and /usr/bin/suidperl with symbolic links to the
+versions of these binaries in the Perl distribution. This action will
+also put some variables into your /etc/make.conf file, so that newly
+installed ports (not packages!) will use new version of perl, and the
+system upgrades from the source will not overwrite the changes made.
+
+At any time you can also type
+
+ use.perl system
+
+if you wish to revert back to the system version of perl.
diff --git a/lang/perl5.14/pkg-plist b/lang/perl5.14/pkg-plist
index 00b454a19b9d..132d7bf80a72 100644
--- a/lang/perl5.14/pkg-plist
+++ b/lang/perl5.14/pkg-plist
@@ -26,6 +26,7 @@ bin/podselect
bin/pstruct
bin/s2p
bin/splain
+bin/use.perl
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/AutoLoader.pm
lib/perl5/%%PERL_VER%%/AutoSplit.pm
@@ -33,6 +34,11 @@ lib/perl5/%%PERL_VER%%/B/assemble
lib/perl5/%%PERL_VER%%/B/cc_harness
lib/perl5/%%PERL_VER%%/B/disassemble
lib/perl5/%%PERL_VER%%/B/makeliblinks
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN/Override.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/Config.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/MM_Unix.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
lib/perl5/%%PERL_VER%%/CGI/Apache.pm
diff --git a/lang/perl5.16/Makefile b/lang/perl5.16/Makefile
index 3982ac9c2780..4f6e1b718cfc 100644
--- a/lang/perl5.16/Makefile
+++ b/lang/perl5.16/Makefile
@@ -7,13 +7,19 @@
PORTNAME= perl
PORTVERSION= ${PERL_VER}
+PORTREVISION= 1
CATEGORIES= lang devel perl5
-MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S|/modules/by-module|/src|}
+# If you don't use MASTER_SITE_OVERRIDE set to one of the
+# ftp.FreeBSD.org mirrors, fetching will be *very* slow.
+MASTER_SITES= ${MASTER_SITE_LOCAL} ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= ../../src tobez
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} BSDPAN-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= tobez@FreeBSD.org
-# This will need to be "fixed" in ../../Mk/bsd.port.mk as well.
PERL_VER= 5.6.1
+PERL_ARCH= mach
+PERL_VERSION= ${PERL_VER}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT=Configure
@@ -23,18 +29,13 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dman3dir=${PREFIX}/lib/perl5/${PERL_VER}/man/man3 \
-Dsitearch=${PREFIX}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH} \
-Dsitelib=${PREFIX}/lib/perl5/site_perl/${PERL_VER} \
- -Ui_gdbm
+ -Ui_gdbm -Ui_malloc -Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
INSTALLS_SHLIB= yes
INCLUDEDIR= /usr/include
.include <bsd.port.pre.mk>
-# If you know what you are doing, you may disable this!
-.if ${OSVERSION} > 300003
-FORBIDDEN= perl is in system
-.endif
-
MAN1= a2p.1 c2ph.1 dprofpp.1 find2perl.1 h2ph.1 h2xs.1 perl.1 \
perl5004delta.1 perl5005delta.1 perlaix.1 perlamiga.1 \
perlapi.1 perlapio.1 perlbook.1 perlboot.1 perlbot.1 \
@@ -112,10 +113,30 @@ MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}
test:
@(cd ${WRKSRC}; make test)
+BSDPAN_DEST= ${PREFIX}/lib/perl5/${PERL_VER}/BSDPAN
+BSDPAN_FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm \
+ ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+post-patch:
+ ${CP} ${FILESDIR}/use.perl ${WRKDIR}
+ ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g;' \
+ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \
+ -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \
+ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \
+ ${WRKDIR}/use.perl
+
post-install:
@strip ${PREFIX}/bin/perl ${PREFIX}/bin/suidperl
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl5
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL_VER}
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
+.for file in ${BSDPAN_FILES}
+ ${MKDIR} ${BSDPAN_DEST}/${file:H}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file}
+.endfor
@(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
+ @fmt ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/lang/perl5.16/distinfo b/lang/perl5.16/distinfo
index 06a932104bc7..366f0ccc3a75 100644
--- a/lang/perl5.16/distinfo
+++ b/lang/perl5.16/distinfo
@@ -1 +1,2 @@
MD5 (perl-5.6.1.tar.gz) = ec1ff15464809b562aecfaa2e65edba6
+MD5 (BSDPAN-5.6.1.tar.gz) = 2e80d385547ac4a9e0d8360c943ad155
diff --git a/lang/perl5.16/files/use.perl b/lang/perl5.16/files/use.perl
new file mode 100644
index 000000000000..4bd8fdef66d1
--- /dev/null
+++ b/lang/perl5.16/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 <<EOF;
+Usage:
+ $0 port -> /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 <<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
+
+EOF
+ close MK;
+}
+
+sub switch_to_port
+{
+ 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%%';
+
+ 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
+
+EOF
+ close MK;
+}
diff --git a/lang/perl5.16/pkg-descr b/lang/perl5.16/pkg-descr
index 8741d148a278..8493844a09da 100644
--- a/lang/perl5.16/pkg-descr
+++ b/lang/perl5.16/pkg-descr
@@ -3,10 +3,4 @@ awk and shell. See the manual page for more hype. There are also
many published by O'Reilly & Assoc. See pod/perlbook.pod for more
information.
---
-
-This port is marked FORBIDDEN as it conflics badly with the Perl5
-that is in the 'base' system. Sysadmins and users who know how to
-override this may do so, and must accept the risk of doing so.
-
- MarkM
diff --git a/lang/perl5.16/pkg-install b/lang/perl5.16/pkg-install
index e0d6a6bc7a46..47fee558c9ae 100644
--- a/lang/perl5.16/pkg-install
+++ b/lang/perl5.16/pkg-install
@@ -6,8 +6,8 @@ fi
INCLUDEDIR=/usr/include
-install -d ${PREFIX}/lib/perl5/site_perl/5.6.1/arch
-cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
+install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach
+cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
exit 0
diff --git a/lang/perl5.16/pkg-message b/lang/perl5.16/pkg-message
new file mode 100644
index 000000000000..e575728b19be
--- /dev/null
+++ b/lang/perl5.16/pkg-message
@@ -0,0 +1,22 @@
+Installation of Perl distribution is finished. Please note, that since
+Perl is also in the base system, this distribution will not be used by
+default.
+
+If you want this version of Perl to be used by default, please type
+
+ use.perl port
+
+Assuming that use.perl script (which was installed with the rest of the
+Perl distribution) can be found in your PATH (you might have to type
+`rehash' first, depending upon a shell you use), this action will
+replace /usr/bin/perl and /usr/bin/suidperl with symbolic links to the
+versions of these binaries in the Perl distribution. This action will
+also put some variables into your /etc/make.conf file, so that newly
+installed ports (not packages!) will use new version of perl, and the
+system upgrades from the source will not overwrite the changes made.
+
+At any time you can also type
+
+ use.perl system
+
+if you wish to revert back to the system version of perl.
diff --git a/lang/perl5.16/pkg-plist b/lang/perl5.16/pkg-plist
index 00b454a19b9d..132d7bf80a72 100644
--- a/lang/perl5.16/pkg-plist
+++ b/lang/perl5.16/pkg-plist
@@ -26,6 +26,7 @@ bin/podselect
bin/pstruct
bin/s2p
bin/splain
+bin/use.perl
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/AutoLoader.pm
lib/perl5/%%PERL_VER%%/AutoSplit.pm
@@ -33,6 +34,11 @@ lib/perl5/%%PERL_VER%%/B/assemble
lib/perl5/%%PERL_VER%%/B/cc_harness
lib/perl5/%%PERL_VER%%/B/disassemble
lib/perl5/%%PERL_VER%%/B/makeliblinks
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN/Override.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/Config.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/MM_Unix.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
lib/perl5/%%PERL_VER%%/CGI/Apache.pm
diff --git a/lang/perl5.6/Makefile b/lang/perl5.6/Makefile
index 3982ac9c2780..4f6e1b718cfc 100644
--- a/lang/perl5.6/Makefile
+++ b/lang/perl5.6/Makefile
@@ -7,13 +7,19 @@
PORTNAME= perl
PORTVERSION= ${PERL_VER}
+PORTREVISION= 1
CATEGORIES= lang devel perl5
-MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S|/modules/by-module|/src|}
+# If you don't use MASTER_SITE_OVERRIDE set to one of the
+# ftp.FreeBSD.org mirrors, fetching will be *very* slow.
+MASTER_SITES= ${MASTER_SITE_LOCAL} ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= ../../src tobez
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} BSDPAN-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= tobez@FreeBSD.org
-# This will need to be "fixed" in ../../Mk/bsd.port.mk as well.
PERL_VER= 5.6.1
+PERL_ARCH= mach
+PERL_VERSION= ${PERL_VER}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT=Configure
@@ -23,18 +29,13 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dman3dir=${PREFIX}/lib/perl5/${PERL_VER}/man/man3 \
-Dsitearch=${PREFIX}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH} \
-Dsitelib=${PREFIX}/lib/perl5/site_perl/${PERL_VER} \
- -Ui_gdbm
+ -Ui_gdbm -Ui_malloc -Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
INSTALLS_SHLIB= yes
INCLUDEDIR= /usr/include
.include <bsd.port.pre.mk>
-# If you know what you are doing, you may disable this!
-.if ${OSVERSION} > 300003
-FORBIDDEN= perl is in system
-.endif
-
MAN1= a2p.1 c2ph.1 dprofpp.1 find2perl.1 h2ph.1 h2xs.1 perl.1 \
perl5004delta.1 perl5005delta.1 perlaix.1 perlamiga.1 \
perlapi.1 perlapio.1 perlbook.1 perlboot.1 perlbot.1 \
@@ -112,10 +113,30 @@ MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}
test:
@(cd ${WRKSRC}; make test)
+BSDPAN_DEST= ${PREFIX}/lib/perl5/${PERL_VER}/BSDPAN
+BSDPAN_FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm \
+ ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+post-patch:
+ ${CP} ${FILESDIR}/use.perl ${WRKDIR}
+ ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g;' \
+ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \
+ -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \
+ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \
+ ${WRKDIR}/use.perl
+
post-install:
@strip ${PREFIX}/bin/perl ${PREFIX}/bin/suidperl
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl5
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL_VER}
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
+.for file in ${BSDPAN_FILES}
+ ${MKDIR} ${BSDPAN_DEST}/${file:H}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file}
+.endfor
@(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
+ @fmt ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/lang/perl5.6/distinfo b/lang/perl5.6/distinfo
index 06a932104bc7..366f0ccc3a75 100644
--- a/lang/perl5.6/distinfo
+++ b/lang/perl5.6/distinfo
@@ -1 +1,2 @@
MD5 (perl-5.6.1.tar.gz) = ec1ff15464809b562aecfaa2e65edba6
+MD5 (BSDPAN-5.6.1.tar.gz) = 2e80d385547ac4a9e0d8360c943ad155
diff --git a/lang/perl5.6/files/use.perl b/lang/perl5.6/files/use.perl
new file mode 100644
index 000000000000..4bd8fdef66d1
--- /dev/null
+++ b/lang/perl5.6/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 <<EOF;
+Usage:
+ $0 port -> /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 <<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
+
+EOF
+ close MK;
+}
+
+sub switch_to_port
+{
+ 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%%';
+
+ 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
+
+EOF
+ close MK;
+}
diff --git a/lang/perl5.6/pkg-descr b/lang/perl5.6/pkg-descr
index 8741d148a278..8493844a09da 100644
--- a/lang/perl5.6/pkg-descr
+++ b/lang/perl5.6/pkg-descr
@@ -3,10 +3,4 @@ awk and shell. See the manual page for more hype. There are also
many published by O'Reilly & Assoc. See pod/perlbook.pod for more
information.
---
-
-This port is marked FORBIDDEN as it conflics badly with the Perl5
-that is in the 'base' system. Sysadmins and users who know how to
-override this may do so, and must accept the risk of doing so.
-
- MarkM
diff --git a/lang/perl5.6/pkg-install b/lang/perl5.6/pkg-install
index e0d6a6bc7a46..47fee558c9ae 100644
--- a/lang/perl5.6/pkg-install
+++ b/lang/perl5.6/pkg-install
@@ -6,8 +6,8 @@ fi
INCLUDEDIR=/usr/include
-install -d ${PREFIX}/lib/perl5/site_perl/5.6.1/arch
-cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
+install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach
+cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
exit 0
diff --git a/lang/perl5.6/pkg-message b/lang/perl5.6/pkg-message
new file mode 100644
index 000000000000..e575728b19be
--- /dev/null
+++ b/lang/perl5.6/pkg-message
@@ -0,0 +1,22 @@
+Installation of Perl distribution is finished. Please note, that since
+Perl is also in the base system, this distribution will not be used by
+default.
+
+If you want this version of Perl to be used by default, please type
+
+ use.perl port
+
+Assuming that use.perl script (which was installed with the rest of the
+Perl distribution) can be found in your PATH (you might have to type
+`rehash' first, depending upon a shell you use), this action will
+replace /usr/bin/perl and /usr/bin/suidperl with symbolic links to the
+versions of these binaries in the Perl distribution. This action will
+also put some variables into your /etc/make.conf file, so that newly
+installed ports (not packages!) will use new version of perl, and the
+system upgrades from the source will not overwrite the changes made.
+
+At any time you can also type
+
+ use.perl system
+
+if you wish to revert back to the system version of perl.
diff --git a/lang/perl5.6/pkg-plist b/lang/perl5.6/pkg-plist
index 00b454a19b9d..132d7bf80a72 100644
--- a/lang/perl5.6/pkg-plist
+++ b/lang/perl5.6/pkg-plist
@@ -26,6 +26,7 @@ bin/podselect
bin/pstruct
bin/s2p
bin/splain
+bin/use.perl
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/AutoLoader.pm
lib/perl5/%%PERL_VER%%/AutoSplit.pm
@@ -33,6 +34,11 @@ lib/perl5/%%PERL_VER%%/B/assemble
lib/perl5/%%PERL_VER%%/B/cc_harness
lib/perl5/%%PERL_VER%%/B/disassemble
lib/perl5/%%PERL_VER%%/B/makeliblinks
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN/Override.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/Config.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/MM_Unix.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
lib/perl5/%%PERL_VER%%/CGI/Apache.pm
diff --git a/lang/perl5.8/Makefile b/lang/perl5.8/Makefile
index 3982ac9c2780..4f6e1b718cfc 100644
--- a/lang/perl5.8/Makefile
+++ b/lang/perl5.8/Makefile
@@ -7,13 +7,19 @@
PORTNAME= perl
PORTVERSION= ${PERL_VER}
+PORTREVISION= 1
CATEGORIES= lang devel perl5
-MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S|/modules/by-module|/src|}
+# If you don't use MASTER_SITE_OVERRIDE set to one of the
+# ftp.FreeBSD.org mirrors, fetching will be *very* slow.
+MASTER_SITES= ${MASTER_SITE_LOCAL} ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= ../../src tobez
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} BSDPAN-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= tobez@FreeBSD.org
-# This will need to be "fixed" in ../../Mk/bsd.port.mk as well.
PERL_VER= 5.6.1
+PERL_ARCH= mach
+PERL_VERSION= ${PERL_VER}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT=Configure
@@ -23,18 +29,13 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dman3dir=${PREFIX}/lib/perl5/${PERL_VER}/man/man3 \
-Dsitearch=${PREFIX}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH} \
-Dsitelib=${PREFIX}/lib/perl5/site_perl/${PERL_VER} \
- -Ui_gdbm
+ -Ui_gdbm -Ui_malloc -Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
INSTALLS_SHLIB= yes
INCLUDEDIR= /usr/include
.include <bsd.port.pre.mk>
-# If you know what you are doing, you may disable this!
-.if ${OSVERSION} > 300003
-FORBIDDEN= perl is in system
-.endif
-
MAN1= a2p.1 c2ph.1 dprofpp.1 find2perl.1 h2ph.1 h2xs.1 perl.1 \
perl5004delta.1 perl5005delta.1 perlaix.1 perlamiga.1 \
perlapi.1 perlapio.1 perlbook.1 perlboot.1 perlbot.1 \
@@ -112,10 +113,30 @@ MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}
test:
@(cd ${WRKSRC}; make test)
+BSDPAN_DEST= ${PREFIX}/lib/perl5/${PERL_VER}/BSDPAN
+BSDPAN_FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm \
+ ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+post-patch:
+ ${CP} ${FILESDIR}/use.perl ${WRKDIR}
+ ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g;' \
+ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \
+ -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \
+ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \
+ ${WRKDIR}/use.perl
+
post-install:
@strip ${PREFIX}/bin/perl ${PREFIX}/bin/suidperl
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl5
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL_VER}
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
+.for file in ${BSDPAN_FILES}
+ ${MKDIR} ${BSDPAN_DEST}/${file:H}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file}
+.endfor
@(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
+ @fmt ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/lang/perl5.8/distinfo b/lang/perl5.8/distinfo
index 06a932104bc7..366f0ccc3a75 100644
--- a/lang/perl5.8/distinfo
+++ b/lang/perl5.8/distinfo
@@ -1 +1,2 @@
MD5 (perl-5.6.1.tar.gz) = ec1ff15464809b562aecfaa2e65edba6
+MD5 (BSDPAN-5.6.1.tar.gz) = 2e80d385547ac4a9e0d8360c943ad155
diff --git a/lang/perl5.8/files/use.perl b/lang/perl5.8/files/use.perl
new file mode 100644
index 000000000000..4bd8fdef66d1
--- /dev/null
+++ b/lang/perl5.8/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 <<EOF;
+Usage:
+ $0 port -> /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 <<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
+
+EOF
+ close MK;
+}
+
+sub switch_to_port
+{
+ 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%%';
+
+ 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
+
+EOF
+ close MK;
+}
diff --git a/lang/perl5.8/pkg-descr b/lang/perl5.8/pkg-descr
index 8741d148a278..8493844a09da 100644
--- a/lang/perl5.8/pkg-descr
+++ b/lang/perl5.8/pkg-descr
@@ -3,10 +3,4 @@ awk and shell. See the manual page for more hype. There are also
many published by O'Reilly & Assoc. See pod/perlbook.pod for more
information.
---
-
-This port is marked FORBIDDEN as it conflics badly with the Perl5
-that is in the 'base' system. Sysadmins and users who know how to
-override this may do so, and must accept the risk of doing so.
-
- MarkM
diff --git a/lang/perl5.8/pkg-install b/lang/perl5.8/pkg-install
index e0d6a6bc7a46..47fee558c9ae 100644
--- a/lang/perl5.8/pkg-install
+++ b/lang/perl5.8/pkg-install
@@ -6,8 +6,8 @@ fi
INCLUDEDIR=/usr/include
-install -d ${PREFIX}/lib/perl5/site_perl/5.6.1/arch
-cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
+install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach
+cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
exit 0
diff --git a/lang/perl5.8/pkg-message b/lang/perl5.8/pkg-message
new file mode 100644
index 000000000000..e575728b19be
--- /dev/null
+++ b/lang/perl5.8/pkg-message
@@ -0,0 +1,22 @@
+Installation of Perl distribution is finished. Please note, that since
+Perl is also in the base system, this distribution will not be used by
+default.
+
+If you want this version of Perl to be used by default, please type
+
+ use.perl port
+
+Assuming that use.perl script (which was installed with the rest of the
+Perl distribution) can be found in your PATH (you might have to type
+`rehash' first, depending upon a shell you use), this action will
+replace /usr/bin/perl and /usr/bin/suidperl with symbolic links to the
+versions of these binaries in the Perl distribution. This action will
+also put some variables into your /etc/make.conf file, so that newly
+installed ports (not packages!) will use new version of perl, and the
+system upgrades from the source will not overwrite the changes made.
+
+At any time you can also type
+
+ use.perl system
+
+if you wish to revert back to the system version of perl.
diff --git a/lang/perl5.8/pkg-plist b/lang/perl5.8/pkg-plist
index 00b454a19b9d..132d7bf80a72 100644
--- a/lang/perl5.8/pkg-plist
+++ b/lang/perl5.8/pkg-plist
@@ -26,6 +26,7 @@ bin/podselect
bin/pstruct
bin/s2p
bin/splain
+bin/use.perl
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/AutoLoader.pm
lib/perl5/%%PERL_VER%%/AutoSplit.pm
@@ -33,6 +34,11 @@ lib/perl5/%%PERL_VER%%/B/assemble
lib/perl5/%%PERL_VER%%/B/cc_harness
lib/perl5/%%PERL_VER%%/B/disassemble
lib/perl5/%%PERL_VER%%/B/makeliblinks
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN/Override.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/Config.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/MM_Unix.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
lib/perl5/%%PERL_VER%%/CGI/Apache.pm
diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile
index 3982ac9c2780..4f6e1b718cfc 100644
--- a/lang/perl5/Makefile
+++ b/lang/perl5/Makefile
@@ -7,13 +7,19 @@
PORTNAME= perl
PORTVERSION= ${PERL_VER}
+PORTREVISION= 1
CATEGORIES= lang devel perl5
-MASTER_SITES= ${MASTER_SITE_PERL_CPAN:S|/modules/by-module|/src|}
+# If you don't use MASTER_SITE_OVERRIDE set to one of the
+# ftp.FreeBSD.org mirrors, fetching will be *very* slow.
+MASTER_SITES= ${MASTER_SITE_LOCAL} ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= ../../src tobez
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} BSDPAN-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= tobez@FreeBSD.org
-# This will need to be "fixed" in ../../Mk/bsd.port.mk as well.
PERL_VER= 5.6.1
+PERL_ARCH= mach
+PERL_VERSION= ${PERL_VER}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT=Configure
@@ -23,18 +29,13 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dman3dir=${PREFIX}/lib/perl5/${PERL_VER}/man/man3 \
-Dsitearch=${PREFIX}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH} \
-Dsitelib=${PREFIX}/lib/perl5/site_perl/${PERL_VER} \
- -Ui_gdbm
+ -Ui_gdbm -Ui_malloc -Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
INSTALLS_SHLIB= yes
INCLUDEDIR= /usr/include
.include <bsd.port.pre.mk>
-# If you know what you are doing, you may disable this!
-.if ${OSVERSION} > 300003
-FORBIDDEN= perl is in system
-.endif
-
MAN1= a2p.1 c2ph.1 dprofpp.1 find2perl.1 h2ph.1 h2xs.1 perl.1 \
perl5004delta.1 perl5005delta.1 perlaix.1 perlamiga.1 \
perlapi.1 perlapio.1 perlbook.1 perlboot.1 perlbot.1 \
@@ -112,10 +113,30 @@ MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}
test:
@(cd ${WRKSRC}; make test)
+BSDPAN_DEST= ${PREFIX}/lib/perl5/${PERL_VER}/BSDPAN
+BSDPAN_FILES= BSDPAN.pm BSDPAN/Override.pm Config.pm \
+ ExtUtils/MM_Unix.pm ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+post-patch:
+ ${CP} ${FILESDIR}/use.perl ${WRKDIR}
+ ${PERL} -pi -e 's|%%PREFIX%%|${PREFIX}|g;' \
+ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \
+ -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \
+ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \
+ ${WRKDIR}/use.perl
+
post-install:
@strip ${PREFIX}/bin/perl ${PREFIX}/bin/suidperl
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl5
@${LN} -sf ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL_VER}
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
+.for file in ${BSDPAN_FILES}
+ ${MKDIR} ${BSDPAN_DEST}/${file:H}
+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+ ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file}
+.endfor
@(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
+ @fmt ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/lang/perl5/distinfo b/lang/perl5/distinfo
index 06a932104bc7..366f0ccc3a75 100644
--- a/lang/perl5/distinfo
+++ b/lang/perl5/distinfo
@@ -1 +1,2 @@
MD5 (perl-5.6.1.tar.gz) = ec1ff15464809b562aecfaa2e65edba6
+MD5 (BSDPAN-5.6.1.tar.gz) = 2e80d385547ac4a9e0d8360c943ad155
diff --git a/lang/perl5/files/use.perl b/lang/perl5/files/use.perl
new file mode 100644
index 000000000000..4bd8fdef66d1
--- /dev/null
+++ b/lang/perl5/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 <<EOF;
+Usage:
+ $0 port -> /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 <<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
+
+EOF
+ close MK;
+}
+
+sub switch_to_port
+{
+ 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%%';
+
+ 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
+
+EOF
+ close MK;
+}
diff --git a/lang/perl5/pkg-descr b/lang/perl5/pkg-descr
index 8741d148a278..8493844a09da 100644
--- a/lang/perl5/pkg-descr
+++ b/lang/perl5/pkg-descr
@@ -3,10 +3,4 @@ awk and shell. See the manual page for more hype. There are also
many published by O'Reilly & Assoc. See pod/perlbook.pod for more
information.
---
-
-This port is marked FORBIDDEN as it conflics badly with the Perl5
-that is in the 'base' system. Sysadmins and users who know how to
-override this may do so, and must accept the risk of doing so.
-
- MarkM
diff --git a/lang/perl5/pkg-install b/lang/perl5/pkg-install
index e0d6a6bc7a46..47fee558c9ae 100644
--- a/lang/perl5/pkg-install
+++ b/lang/perl5/pkg-install
@@ -6,8 +6,8 @@ fi
INCLUDEDIR=/usr/include
-install -d ${PREFIX}/lib/perl5/site_perl/5.6.1/arch
-cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
+install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach
+cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
exit 0
diff --git a/lang/perl5/pkg-message b/lang/perl5/pkg-message
new file mode 100644
index 000000000000..e575728b19be
--- /dev/null
+++ b/lang/perl5/pkg-message
@@ -0,0 +1,22 @@
+Installation of Perl distribution is finished. Please note, that since
+Perl is also in the base system, this distribution will not be used by
+default.
+
+If you want this version of Perl to be used by default, please type
+
+ use.perl port
+
+Assuming that use.perl script (which was installed with the rest of the
+Perl distribution) can be found in your PATH (you might have to type
+`rehash' first, depending upon a shell you use), this action will
+replace /usr/bin/perl and /usr/bin/suidperl with symbolic links to the
+versions of these binaries in the Perl distribution. This action will
+also put some variables into your /etc/make.conf file, so that newly
+installed ports (not packages!) will use new version of perl, and the
+system upgrades from the source will not overwrite the changes made.
+
+At any time you can also type
+
+ use.perl system
+
+if you wish to revert back to the system version of perl.
diff --git a/lang/perl5/pkg-plist b/lang/perl5/pkg-plist
index 00b454a19b9d..132d7bf80a72 100644
--- a/lang/perl5/pkg-plist
+++ b/lang/perl5/pkg-plist
@@ -26,6 +26,7 @@ bin/podselect
bin/pstruct
bin/s2p
bin/splain
+bin/use.perl
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/AutoLoader.pm
lib/perl5/%%PERL_VER%%/AutoSplit.pm
@@ -33,6 +34,11 @@ lib/perl5/%%PERL_VER%%/B/assemble
lib/perl5/%%PERL_VER%%/B/cc_harness
lib/perl5/%%PERL_VER%%/B/disassemble
lib/perl5/%%PERL_VER%%/B/makeliblinks
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/BSDPAN/Override.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/Config.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/MM_Unix.pm
+lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
lib/perl5/%%PERL_VER%%/CGI/Apache.pm