aboutsummaryrefslogtreecommitdiffstats
path: root/lang/perl5.12
diff options
context:
space:
mode:
authortobez <tobez@FreeBSD.org>2005-02-01 21:36:21 +0800
committertobez <tobez@FreeBSD.org>2005-02-01 21:36:21 +0800
commita4e9ddb1705665666c117bfc30c9b9ba2d906f15 (patch)
tree7eb3053e4b7bd19cda6f9a9b36433fe3793f5472 /lang/perl5.12
parent0930f44c166a4c6ba6f3732ff94d50e7d7a49a3c (diff)
downloadfreebsd-ports-gnome-a4e9ddb1705665666c117bfc30c9b9ba2d906f15.tar.gz
freebsd-ports-gnome-a4e9ddb1705665666c117bfc30c9b9ba2d906f15.tar.zst
freebsd-ports-gnome-a4e9ddb1705665666c117bfc30c9b9ba2d906f15.zip
Update to 5.8.6. Also:
- redirect output from h2ph to /dev/null [1]; - fix File::Path insecure file/directory permissions [2]; this resolves CAN-2004-0452 (http://vuxml.freebsd.org/c418d472-6bd1-11d9-93ca-000a95bc6fae.html); - for OSVERSION < 500036, create symlinks in /usr/bin not only for perl and suidperl, but also for a2p, c2ph, find2perl, h2ph, h2xs, perlbug, perlcc, perldoc, pl2pm, pod2html, pod2latex, pod2man, pod2text, s2p, and splain; perl and suidperl are still enough for more recent FreeBSD versions [3]; - clean up created symlinks upon deinstallation [4]; - try to cleanup symlinks created by older versions of lang/perl5 and lang/perl5.8, during both installation and deinstallation [5]; - added support for DISABLE_BSDPAN environment variable [6]; - be explicit about use.perl usage after installation of 4.X systems [7]; - respect __MAKE_CONF partially (the build-time value is used) [8]; - fix threaded build - respect PTHREAD_CFLAGS and PTHREAD_LIBS [9]. - use.perl is now the same as pkg-install is now the same as pkg-deinstall; apart from the changes already mentioned above, this is a shell script now; - use.perl's logic is also simplified in several ways [10]; - fix a BSDPAN bug [11]. Outstanding issues: Module::Build support for BSDPAN, SU_CMD support (PR 70831), PR 64963 (partially), and anything else that I forgot. [1] Nudged by: krion [2] Reported by: nectar Patch from: Chris Turner @ RedHat [3] PR: 55760, 57151, 58406 [4] Requested by: kris PR: 54262 [5] PR: 51281, 51539 [6] PR: 57134 [7] PR: 60736 [8] PR: 74431 [9] PR: 73233 [10] Perl version submitted by des, implemented in sh [11] Reported by: Alexander Nagilum <freebsd %at% nagilum de>
Diffstat (limited to 'lang/perl5.12')
-rw-r--r--lang/perl5.12/Makefile44
-rw-r--r--lang/perl5.12/Makefile.man3
-rw-r--r--lang/perl5.12/distinfo8
-rw-r--r--lang/perl5.12/files/patch-Path.pm30
-rw-r--r--lang/perl5.12/files/patch-freebsd.sh39
-rw-r--r--lang/perl5.12/files/use.perl362
-rw-r--r--lang/perl5.12/pkg-install28
-rw-r--r--lang/perl5.12/pkg-message4
-rw-r--r--lang/perl5.12/pkg-plist10
9 files changed, 356 insertions, 172 deletions
diff --git a/lang/perl5.12/Makefile b/lang/perl5.12/Makefile
index c35231a4eb29..feb908223f83 100644
--- a/lang/perl5.12/Makefile
+++ b/lang/perl5.12/Makefile
@@ -19,7 +19,7 @@ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
MAINTAINER= tobez@FreeBSD.org
COMMENT= Practical Extraction and Report Language
-PERL_VER= 5.8.5
+PERL_VER= 5.8.6
PERL_ARCH= mach
PERL_VERSION= ${PERL_VER}
@@ -39,8 +39,6 @@ CONFIGURE_ARGS= -sde -Dprefix=${PREFIX} \
-Dcc="${CC}" -Doptimize="${CFLAGS}" -Duseshrplib \
-Dccflags=-DAPPLLIB_EXP=\"${BSDPAN_DEST}\"
-INCLUDEDIR= /usr/include
-
.include "Makefile.man"
.include <bsd.port.pre.mk>
@@ -51,7 +49,6 @@ PLIST_SUB+= ENABLE_SUIDPERL=""
CONFIGURE_ARGS+= -Ud_dosuid
PLIST_SUB+= ENABLE_SUIDPERL="@comment "
.endif
-# INSTALLS_SHLIB= yes
.if defined(WITH_GDBM)
CONFIGURE_ARGS+= -Di_gdbm
@@ -69,10 +66,16 @@ WITH_PERL_MALLOC= yes
.endif
.if defined(WITH_THREADS)
+.if ${ARCH} == "amd64"
+IGNORE= Threaded perl does not pass tests on ${ARCH}
+.endif
CONFIGURE_ARGS+= -Dusethreads=y
PKGNAMESUFFIX= -threaded
# it seems perl malloc has problems with threaded perl on FreeBSD
.undef WITH_PERL_MALLOC
+.if ${OSVERSION} < 492000
+CONFIGURE_ARGS+= -Ud_gethostbyaddr_r
+.endif
.else
CONFIGURE_ARGS+= -Dusethreads=n
.endif
@@ -89,8 +92,10 @@ CONFIGURE_ARGS+= -Duse64bitint
.if ${OSVERSION} < 502100
LATEST_LINK= perl5.8
+PLIST_SUB+= NEED_USE_PERL=""
.else
PKGMESSAGE= ${PKGDIR}/.not-here
+PLIST_SUB+= NEED_USE_PERL="@comment "
.endif
.if defined(WITH_GDBM)
@@ -103,16 +108,34 @@ 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-5.8.5
+ ExtUtils/MM_Unix.pm \
+ ExtUtils/MakeMaker.pm \
+ ExtUtils/Packlist.pm
+BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${PORTVERSION}
+
+PKGINSTALL= ${WRKDIR}/pkg-install
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+USE_REINPLACE= yes
post-patch:
${SED} -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;' \
+ -e 's|%%MAKE_CONF%%|${__MAKE_CONF}|g;' \
${FILESDIR}/use.perl \
> ${WRKDIR}/use.perl
+ ${CP} ${WRKDIR}/use.perl ${PKGINSTALL}
+ ${CP} ${WRKDIR}/use.perl ${PKGDEINSTALL}
+.if defined(WITH_THREADS)
+ ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \
+ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \
+ ${WRKSRC}/hints/freebsd.sh
+.else
+ ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%||g;' \
+ -e 's|%%PTHREAD_CFLAGS%%||g;' \
+ ${WRKSRC}/hints/freebsd.sh
+.endif
pre-install:
@${RM} -f ${PREFIX}/bin/perl${PERL_VER}
@@ -122,20 +145,15 @@ post-install:
@${STRIP_CMD} ${PREFIX}/bin/perl${PERL_VER}
@${STRIP_CMD} ${PREFIX}/bin/perl
@${LN} -sf ${PREFIX}/bin/perl${PERL_VER} ${PREFIX}/bin/perl5
- ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
.for files in ${BSDPAN_FILES}
${MKDIR} ${BSDPAN_DEST}/${files:H}
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${BSDPAN_WRKSRC}/${files} ${BSDPAN_DEST}/${files}
.endfor
- @(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)
- ${MKDIR} ${PREFIX}/${SITE_PERL_REL}/auto
- ${MKDIR} ${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto
- ${MKDIR} ${PREFIX}/lib/perl5/${PERL_VER}/man/man3
+ PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if ${OSVERSION} < 502100
+ ${INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl
@fmt ${PKGMESSAGE}
-.else
- @${PREFIX}/bin/use.perl port
.endif
.include <bsd.port.post.mk>
diff --git a/lang/perl5.12/Makefile.man b/lang/perl5.12/Makefile.man
index c56cfd90e9d9..5d09d5ca3c38 100644
--- a/lang/perl5.12/Makefile.man
+++ b/lang/perl5.12/Makefile.man
@@ -1,4 +1,4 @@
-# $Id$
+# $FreeBSD$
MAN1+= a2p.1
MAN1+= c2ph.1
@@ -23,6 +23,7 @@ MAN1+= perl582delta.1
MAN1+= perl583delta.1
MAN1+= perl584delta.1
MAN1+= perl585delta.1
+MAN1+= perl586delta.1
MAN1+= perl58delta.1
MAN1+= perlaix.1
MAN1+= perlamiga.1
diff --git a/lang/perl5.12/distinfo b/lang/perl5.12/distinfo
index d61c133591a2..7ea175187bca 100644
--- a/lang/perl5.12/distinfo
+++ b/lang/perl5.12/distinfo
@@ -1,4 +1,4 @@
-MD5 (perl-5.8.5.tar.bz2) = 9db6be76aa275f415d75c224ad1d4029
-SIZE (perl-5.8.5.tar.bz2) = 9464689
-MD5 (BSDPAN-5.8.5.tar.bz2) = 9a752ebc0d65671aeaa5350a260f516e
-SIZE (BSDPAN-5.8.5.tar.bz2) = 6278
+MD5 (perl-5.8.6.tar.bz2) = 3d030b6ff2a433840edb1a407d18dc0a
+SIZE (perl-5.8.6.tar.bz2) = 9693085
+MD5 (BSDPAN-5.8.6.tar.bz2) = e2be13e3698b3d95de3368a58be8a540
+SIZE (BSDPAN-5.8.6.tar.bz2) = 8217
diff --git a/lang/perl5.12/files/patch-Path.pm b/lang/perl5.12/files/patch-Path.pm
new file mode 100644
index 000000000000..2735b0f6a648
--- /dev/null
+++ b/lang/perl5.12/files/patch-Path.pm
@@ -0,0 +1,30 @@
+$FreeBSD$
+--- lib/File/Path.pm.orig Sat Jan 29 20:23:40 2005
++++ lib/File/Path.pm Sat Jan 29 20:24:56 2005
+@@ -196,7 +196,7 @@ sub rmtree {
+ # it's also intended to change it to writable in case we have
+ # to recurse in which case we are better than rm -rf for
+ # subtrees with strange permissions
+- chmod(0777, ($Is_VMS ? VMS::Filespec::fileify($root) : $root))
++ chmod(0700, ($Is_VMS ? VMS::Filespec::fileify($root) : $root))
+ or carp "Can't make directory $root read+writeable: $!"
+ unless $safe;
+
+@@ -230,7 +230,7 @@ sub rmtree {
+ print "skipped $root\n" if $verbose;
+ next;
+ }
+- chmod 0777, $root
++ chmod 0700, $root
+ or carp "Can't make directory $root writeable: $!"
+ if $force_writeable;
+ print "rmdir $root\n" if $verbose;
+@@ -252,7 +252,7 @@ sub rmtree {
+ print "skipped $root\n" if $verbose;
+ next;
+ }
+- chmod 0666, $root
++ chmod 0600, $root
+ or carp "Can't make file $root writeable: $!"
+ if $force_writeable;
+ print "unlink $root\n" if $verbose;
diff --git a/lang/perl5.12/files/patch-freebsd.sh b/lang/perl5.12/files/patch-freebsd.sh
index 68ec6d4cd8a1..6c5e9d7b0118 100644
--- a/lang/perl5.12/files/patch-freebsd.sh
+++ b/lang/perl5.12/files/patch-freebsd.sh
@@ -1,20 +1,51 @@
---- hints/freebsd.sh.orig Sun May 30 17:55:47 2004
-+++ hints/freebsd.sh Sun May 30 17:57:16 2004
-@@ -88,6 +88,7 @@ case "$osvers" in
+--- hints/freebsd.sh.orig Wed Mar 24 22:47:33 2004
++++ hints/freebsd.sh Sun Jan 30 23:39:33 2005
+@@ -88,6 +88,8 @@ case "$osvers" in
esac
libswanted=`echo $libswanted | sed 's/ malloc / /'`
libswanted=`echo $libswanted | sed 's/ bind / /'`
+ libswanted=`echo $libswanted | sed 's/ dl / /'`
++ libswanted=`echo $libswanted | sed 's/ c / /'`
# iconv gone in Perl 5.8.1, but if someone compiles 5.8.0 or earlier.
libswanted=`echo $libswanted | sed 's/ iconv / /'`
d_setregid='define'
-@@ -102,6 +103,9 @@ case "$osvers" in
+@@ -102,6 +103,10 @@ case "$osvers" in
;;
esac
libswanted=`echo $libswanted | sed 's/ malloc / /'`
+ libswanted=`echo $libswanted | sed 's/ bind / /'`
+ libswanted=`echo $libswanted | sed 's/ dl / /'`
+ libswanted=`echo $libswanted | sed 's/ iconv / /'`
++ libswanted=`echo $libswanted | sed 's/ c / /'`
;;
esac
+@@ -119,7 +123,7 @@ case "$osvers" in
+ if [ x$objformat = xelf ]; then
+ libpth="/usr/lib /usr/local/lib"
+ glibpth="/usr/lib /usr/local/lib"
+- ldflags="-Wl,-E "
++ ldflags="%%PTHREAD_LIBS%% -Wl,-E"
+ lddlflags="-shared "
+ else
+ if [ -e /usr/lib/aout ]; then
+@@ -136,7 +140,7 @@ case "$osvers" in
+ 0*|1*|2*|3*) ;;
+
+ *)
+- ccflags="${ccflags} -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H"
++ ccflags="${ccflags} %%PTHREAD_CFLAGS%% -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H"
+ if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq "not stripped" ; then
+ usenm=false
+ fi
+@@ -183,7 +187,9 @@ esac
+
+ # This script UU/usethreads.cbu will get 'called-back' by Configure
+ # after it has prompted the user for whether to use threads.
+-cat > UU/usethreads.cbu <<'EOCBU'
++## not quite - modern FreeBSD perl port is supposed to take care of that
++## we just add extra libraries and cflags nowadays
++cat > /dev/null <<'EOCBU'
+ case "$usethreads" in
+ $define|true|[yY]*)
+ lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|sed -n '$p'`
diff --git a/lang/perl5.12/files/use.perl b/lang/perl5.12/files/use.perl
index ba6057f1c5db..c20a441b65da 100644
--- a/lang/perl5.12/files/use.perl
+++ b/lang/perl5.12/files/use.perl
@@ -1,134 +1,264 @@
-#! %%PREFIX%%/bin/perl -w
-# $FreeBSD$
-use strict;
+#!/bin/sh
-# XXX what to do with perldoc, pelbug, perlcc ??
+# $FreeBSD$
-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;
-}
+this=`echo -n $0 | /usr/bin/sed -e 's!^.*/!!'`
+PERL_VERSION="%%PERL_VERSION%%"
+MAKE_CONF=%%MAKE_CONF%%
+banner=`date +"%F %T"`
+banner="# added by use.perl $banner"
+if [ -z "${OSVERSION}" ]; then
+ if [ -f /sbin/sysctl -a -x /sbin/sysctl ] ; then
+ osreldate=`/sbin/sysctl -n kern.osreldate`
+ else
+ osreldate=`/usr/sbin/sysctl -n kern.osreldate`
+ fi
+else
+ osreldate=${OSVERSION}
+fi
-my $port_perl = '%%PREFIX%%/bin/perl';
-$port_perl =~ tr|/|/|s;
+if [ "x$this" = "xuse.perl" ]; then
+ PKG_PREFIX="%%PREFIX%%"
+ if [ "$1" = "port" ] ; then
+ need_remove_links=yes
+ need_create_links=yes
+ need_cleanup_make_conf=yes
+ need_cleanup_manpath=yes
+ need_spam_make_conf=yes
+ need_spam_manpath=yes
+ elif [ "$1" = "system" ] ; then
+ need_remove_links=yes
+ if [ $osreldate -lt 500036 ] ; then
+ need_base_system_perl=yes
+ fi
+ need_cleanup_make_conf=yes
+ need_cleanup_manpath=yes
+ else
+ echo 'Usage:
+ $0 port -> /usr/bin/perl is the perl5 port
+ $0 system -> /usr/bin/perl is the system perl'
+ exit 2;
+ fi
+else
+ if [ "$2" = "POST-INSTALL" ] ; then
+ need_remove_links=yes
+ if [ $osreldate -ge 502100 ] ; then
+ need_create_links=yes
+ need_cleanup_make_conf=yes
+ need_cleanup_manpath=yes
+ need_spam_make_conf=yes
+ need_spam_manpath=yes
+ fi
+ need_post_install=yes
+ elif [ "$2" = "POST-DEINSTALL" ] ; then
+ need_remove_links=yes
+ if [ $osreldate -lt 500036 ] ; then
+ need_base_system_perl=yes
+ fi
+ need_cleanup_make_conf=yes
+ need_cleanup_manpath=yes
+ else
+ exit 0;
+ fi
+fi
-my $ident = `[ -r /usr/bin/perl5 ] && /usr/bin/ident -q /usr/bin/perl5`;
+link_list="
+ a2p
+ c2ph
+ find2perl
+ h2ph
+ h2xs
+ perlbug
+ perlcc
+ perldoc
+ pl2pm
+ pod2html
+ pod2latex
+ pod2man
+ pod2text
+ s2p
+ splain"
+if [ $osreldate -ge 500036 ] ; then
+ link_list=""
+fi
+special_link_list="
+ perl
+ perl5
+ suidperl"
-@ARGV == 1 or usage();
-if ($ARGV[0] eq 'port') {
- switch_to_port();
-} elsif ($ARGV[0] eq 'system') {
- switch_to_system();
-} else {
- usage();
+do_remove_links()
+{
+ echo "Removing stale symlinks from /usr/bin..."
+ for binary in $link_list $special_link_list
+ do
+ if [ -L "/usr/bin/$binary" ] ; then
+ echo " Removing /usr/bin/$binary"
+ /bin/rm -f "/usr/bin/$binary"
+ else
+ echo " Skipping /usr/bin/$binary"
+ fi
+ done
+ bins=`/bin/ls /usr/bin/*perl*5.* ${PKG_PREFIX}/bin/*perl*5.* 2>/dev/null`
+ for binary in $bins
+ do
+ if [ -L "$binary" ] ; then
+ echo " Removing $binary installed by an older perl port"
+ /bin/rm -f "$binary"
+ fi
+ done
+ echo "Done."
}
-exit 0;
-
-# 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.
-sub switch_to_system
+do_create_links()
{
- # 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/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';
- }
- }
-
- 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
-.undef NO_PERL
-
-EOF
- close MK;
+ echo "Creating various symlinks in /usr/bin..."
+ for binary in $link_list
+ do
+ if [ -f "/usr/bin/$binary" ] ; then
+ echo " Backing up /usr/bin/$binary as /usr/bin/$binary.freebsd"
+ /bin/mv -f "/usr/bin/$binary" "/usr/bin/$binary.freebsd"
+ fi
+ if [ -e "/usr/bin/$binary" ] ; then
+ echo " *** /usr/bin/$binary is still there, which should not happen"
+ elif [ -e "$PKG_PREFIX/bin/$binary" ] ; then
+ echo " Symlinking $PKG_PREFIX/bin/$binary to /usr/bin/$binary"
+ /bin/ln -sf "$PKG_PREFIX/bin/$binary" "/usr/bin/$binary"
+ else
+ echo " *** $PKG_PREFIX/bin/$binary is not there, a symlink won't do any good"
+ fi
+ done
+ for binary in $special_link_list
+ do
+ if [ -f "/usr/bin/$binary" ] ; then
+ echo " Removing /usr/bin/$binary"
+ fi
+ bin=`echo $binary | /usr/bin/sed -e 's!perl5!perl!'`
+ bin=`echo $bin | /usr/bin/sed -e 's!suidperl!sperl!'`
+ if [ -e "/usr/bin/$binary.XXX" ] ; then
+ echo " *** /usr/bin/$binary is still there, which should not happen"
+ elif [ -e "$PKG_PREFIX/bin/${bin}%%PERL_VERSION%%" ] ; then
+ echo " Symlinking $PKG_PREFIX/bin/${bin}%%PERL_VERSION%% to /usr/bin/$binary"
+ /bin/ln -sf "$PKG_PREFIX/bin/${bin}%%PERL_VERSION%%" "/usr/bin/$binary"
+ else
+ echo " *** $PKG_PREFIX/bin/${bin}%%PERL_VERSION%% is not there, a symlink won't do any good"
+ fi
+ done
+ echo "Done."
+}
- 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*$|;
- next if m|^\s*OPTIONAL_MANPATH\s+\S+/lib/perl5/%%PERL_VERSION%%/perl/man\s*$|;
- print MPNEW;
- }
- close MPNEW;
- close MPOLD;
- rename '/etc/manpath.config', '/etc/manpath.config.bak';
- rename '/etc/manpath.config.new', '/etc/manpath.config';
+do_base_system_perl()
+{
+ echo "Restoring base system perl binaries..."
+ for binary in $link_list
+ do
+ if [ -e "/usr/bin/$binary" ] ; then
+ echo " *** /usr/bin/$binary is there, which should not happen"
+ else
+ if [ -f "/usr/bin/$binary.freebsd" ] ; then
+ echo " Moving /usr/bin/$binary.freebsd to /usr/bin/$binary"
+ /bin/mv -f "/usr/bin/$binary.freebsd" "/usr/bin/$binary"
+ else
+ echo " *** /usr/bin/$binary.freebsd is NOT there, nothing to restore"
+ fi
+ fi
+ done
+ for binary in $special_link_list
+ do
+ if [ -e "/usr/bin/$binary" ] ; then
+ echo " *** /usr/bin/$binary is there, which should not happen"
+ else
+ bin=`echo $binary | /usr/bin/sed -e 's!perl5!perl!'`
+ bin=`echo $bin | /usr/bin/sed -e 's!suidperl!sperl!'`
+ bins=`/bin/ls /usr/bin/${bin}5.* 2>/dev/null | /usr/bin/sort`
+ bin=""
+ for b in $bins
+ do
+ if [ -f $b -a ! -L $b ] ; then
+ bin=$b
+ fi
+ done
+ if [ -z $bin ] ; then
+ echo " *** cannot find what /usr/bin/$binary shall be restored FROM"
+ elif [ -f $bin ] ; then
+ echo " Hardlinking $bin to /usr/bin/$binary"
+ ln -f "$bin" "/usr/bin/$binary"
+ else
+ echo " *** $bin is NOT there, nothing to restore"
+ fi
+ fi
+ done
+ echo "Done."
}
-sub switch_to_port
+do_post_install()
{
- # protect against cases where people use PREFIX=/usr
- if ($port_perl ne '/usr/bin/perl') {
- if ($ident =~ m#src/usr.bin/perl/perl.c#) {
- rename '/usr/bin/perl', '/usr/bin/perl-wrapper';
- } else {
- unlink '/usr/bin/perl';
- }
+ INCLUDEDIR=/usr/include
+ install -d ${PKG_PREFIX}/lib/perl5/site_perl/%%PERL_VERSION%%/%%PERL_ARCH%%/auto
+ install -d ${PKG_PREFIX}/lib/perl5/site_perl/%%PERL_VERSION%%/auto
+ install -d ${PKG_PREFIX}/lib/perl5/%%PERL_VERSION%%/man/man3
+ cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h >/dev/null
+}
- unlink '/usr/bin/suidperl', '/usr/bin/perl%%PERL_VERSION%%';
+do_cleanup_make_conf()
+{
+ echo -n "Cleaning up ${MAKE_CONF}..."
+ if [ -f ${MAKE_CONF} ] ; then
+ /usr/bin/awk 's=0;
+ /^#.*use.perl/ { s=1; mode=1 }
+ /^#/ { s=1; if (mode != 1) { mode=0 } }
+ /.*PERL.*=/ { s=1; if (mode == 1) { mode=2 } }
+ /^$/ { s=1; if (mode != 2) { mode = 0 } }
+ { if (s != 1) { mode = 0 } if (mode == 0) print }' ${MAKE_CONF} >${MAKE_CONF}.new
+ /bin/mv ${MAKE_CONF} ${MAKE_CONF}.bak
+ /bin/mv ${MAKE_CONF}.new ${MAKE_CONF}
+ fi
+ echo " Done."
+}
- symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl';
- symlink '%%PREFIX%%/bin/suidperl', '/usr/bin/suidperl';
- symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl%%PERL_VERSION%%';
- }
+do_cleanup_manpath()
+{
+ echo -n "Cleaning up /etc/manpath.config..."
+ if [ -f /etc/manpath.config ] ; then
+ /usr/bin/awk 's=0;
+ /^#.*use.perl/ { s=1; mode=1 }
+ /^#/ { s=1; if (mode != 1) { mode=0 } }
+ /^OPTIONAL_MANPATH.*perl5/ { s=1; if (mode == 1) { mode=2 } }
+ /^$/ { s=1; if (mode != 2) { mode = 0 } }
+ { if (s != 1) { mode = 0 } if (mode == 0) print }' /etc/manpath.config >/etc/manpath.config.new
+ /bin/mv /etc/manpath.config /etc/manpath.config.bak
+ /bin/mv /etc/manpath.config.new /etc/manpath.config
+ fi
+ echo " Done."
+}
- 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
-NO_PERL=yo
-NO_PERL_WRAPPER=yo
+do_spam_make_conf()
+{
+ echo -n "Spamming ${MAKE_CONF}..."
+ echo "$banner" >>${MAKE_CONF}
+ echo "PERL_VER=%%PERL_VER%%" >>${MAKE_CONF}
+ echo "PERL_VERSION=%%PERL_VERSION%%" >>${MAKE_CONF}
+ if [ $osreldate -lt 500036 ] ; then
+ echo "NOPERL=yes" >>${MAKE_CONF}
+ fi
+ echo " Done."
+}
-EOF
- close MK;
+do_spam_manpath()
+{
+ echo -n "Spamming /etc/manpath.config..."
+ echo "$banner" >>/etc/manpath.config
+ echo "OPTIONAL_MANPATH ${PKG_PREFIX}/lib/perl5/%%PERL_VERSION%%/man" >>/etc/manpath.config
+ echo "OPTIONAL_MANPATH ${PKG_PREFIX}/lib/perl5/%%PERL_VERSION%%/perl/man" >>/etc/manpath.config
+ echo " Done."
+}
- my $perl_port_manpath = <<EOF;
-# -- use.perl generated line -- #
-OPTIONAL_MANPATH %%PREFIX%%/lib/perl5/%%PERL_VERSION%%/man
-OPTIONAL_MANPATH %%PREFIX%%/lib/perl5/%%PERL_VERSION%%/perl/man
-EOF
+[ $need_remove_links ] && do_remove_links
+[ $need_create_links ] && do_create_links
+[ $need_base_system_perl ] && do_base_system_perl
+[ $need_post_install ] && do_post_install
+[ $need_cleanup_make_conf ] && do_cleanup_make_conf
+[ $need_spam_make_conf ] && do_spam_make_conf
+[ $need_cleanup_manpath ] && do_cleanup_manpath
+[ $need_spam_manpath ] && do_spam_manpath
- 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;
- }
- print MPNEW;
- }
- print MPNEW $perl_port_manpath unless $modified;
- close MPNEW;
- close MPOLD;
- rename '/etc/manpath.config', '/etc/manpath.config.bak';
- rename '/etc/manpath.config.new', '/etc/manpath.config';
-}
+exit 0
diff --git a/lang/perl5.12/pkg-install b/lang/perl5.12/pkg-install
deleted file mode 100644
index f971f4563bd7..000000000000
--- a/lang/perl5.12/pkg-install
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-if [ "$2" != POST-INSTALL ] ; then
- exit 0
-fi
-
-INCLUDEDIR=/usr/include
-
-install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.8.5/mach/auto
-install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.8.5/auto
-install -d ${PKG_PREFIX}/lib/perl5/5.8.5/man/man3
-cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h
-
-if [ -z "${OSVERSION}" ]; then
- if [ -f /sbin/sysctl -a -x /sbin/sysctl ] ; then
- osreldate=`/sbin/sysctl -n kern.osreldate`
- else
- osreldate=`/usr/sbin/sysctl -n kern.osreldate`
- fi
-else
- osreldate=${OSVERSION}
-fi
-
-if [ $osreldate -ge 502100 ] ; then
- ${PKG_PREFIX}/bin/use.perl port
-fi
-
-exit 0
diff --git a/lang/perl5.12/pkg-message b/lang/perl5.12/pkg-message
index e575728b19be..0438edb18a19 100644
--- a/lang/perl5.12/pkg-message
+++ b/lang/perl5.12/pkg-message
@@ -15,6 +15,10 @@ 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.
+Note that use.perl port is specific to a given perl installation. If
+you later upgrade the perl port, run use.perl port again to update the
+symbolic links and /etc/make.conf.
+
At any time you can also type
use.perl system
diff --git a/lang/perl5.12/pkg-plist b/lang/perl5.12/pkg-plist
index 0e1c77d09099..fd3225420c46 100644
--- a/lang/perl5.12/pkg-plist
+++ b/lang/perl5.12/pkg-plist
@@ -11,7 +11,7 @@ bin/libnetcfg
bin/perl
bin/perl%%PERL_VER%%
@exec ln -fs %D/%F %B/perl5
-@unexec rm %B/perl5
+@unexec rm -f %B/perl5 2>&1 >/dev/null || true
bin/perlbug
bin/perlcc
bin/perldoc
@@ -32,7 +32,7 @@ bin/s2p
%%ENABLE_SUIDPERL%%bin/sperl%%PERL_VER%%
bin/splain
%%ENABLE_SUIDPERL%%bin/suidperl
-bin/use.perl
+%%NEED_USE_PERL%%bin/use.perl
bin/xsubpp
lib/perl5/%%PERL_VER%%/AnyDBM_File.pm
lib/perl5/%%PERL_VER%%/Attribute/Handlers.pm
@@ -62,6 +62,7 @@ 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/MakeMaker.pm
lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils/Packlist.pm
lib/perl5/%%PERL_VER%%/Benchmark.pm
lib/perl5/%%PERL_VER%%/CGI.pm
@@ -869,6 +870,7 @@ lib/perl5/%%PERL_VER%%/pod/perl582delta.pod
lib/perl5/%%PERL_VER%%/pod/perl583delta.pod
lib/perl5/%%PERL_VER%%/pod/perl584delta.pod
lib/perl5/%%PERL_VER%%/pod/perl585delta.pod
+lib/perl5/%%PERL_VER%%/pod/perl586delta.pod
lib/perl5/%%PERL_VER%%/pod/perl58delta.pod
lib/perl5/%%PERL_VER%%/pod/perlaix.pod
lib/perl5/%%PERL_VER%%/pod/perlamiga.pod
@@ -1458,12 +1460,9 @@ lib/perl5/%%PERL_VER%%/warnings/register.pm
@dirrm lib/perl5/%%PERL_VER%%/BSDPAN/ExtUtils
@dirrm lib/perl5/%%PERL_VER%%/BSDPAN
@unexec find %D/%%SITE_PERL%%/%%PERL_ARCH%%/ -name '*.ph' -delete 2>/dev/null || true
-@unexec rmdir %D/%%SITE_PERL%% 2>/dev/null || true
-@unexec rmdir %D/lib/perl5/site_perl 2>/dev/null || true
%%GDBM%%@dirrm lib/perl5/%%PERL_VER%%/%%PERL_ARCH%%/auto/GDBM_File
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/auto/POSIX/SigAction 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/auto/POSIX 2>/dev/null || true
-@unexec rmdir %D/lib/perl5/%%PERL_VER%%/auto 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/%%PERL_ARCH%%/threads 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/%%PERL_ARCH%%/XS 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/%%PERL_ARCH%%/Sys 2>/dev/null || true
@@ -1566,7 +1565,6 @@ lib/perl5/%%PERL_VER%%/warnings/register.pm
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/Encode/MIME 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/Encode/KR 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/Encode/JP 2>/dev/null || true
-@unexec rmdir %D/lib/perl5/%%PERL_VER%%/Encode 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/CPAN 2>/dev/null || true
@unexec rmdir %D/lib/perl5/%%PERL_VER%%/Carp 2>/dev/null || true
@dirrm lib/perl5/%%PERL_VER%%/unicore/To