diff options
author | bmah <bmah@FreeBSD.org> | 2002-12-05 00:50:04 +0800 |
---|---|---|
committer | bmah <bmah@FreeBSD.org> | 2002-12-05 00:50:04 +0800 |
commit | 76e2aca9e3a1543a8ecec16ccf72f1acbb79bdb5 (patch) | |
tree | 366bf88058e3ddbe0eae1db8bc24749d40951f36 /lang | |
parent | 84028baab6d1145b85627307818eb8f0d72b10c6 (diff) | |
download | freebsd-ports-gnome-76e2aca9e3a1543a8ecec16ccf72f1acbb79bdb5.tar.gz freebsd-ports-gnome-76e2aca9e3a1543a8ecec16ccf72f1acbb79bdb5.tar.zst freebsd-ports-gnome-76e2aca9e3a1543a8ecec16ccf72f1acbb79bdb5.zip |
On recent 5-CURRENT, there is no Perl wrapper. It is therefore possible
that /usr/bin/perl5 doesn't exist, which violates some of use.perl's
assumptions. Take care of this case. [1]
Also in the case of a recent 5-CURRENT, automatically perform
"use.perl port" during package/port installation. This helps the
installation of sysinstall's new "Perl distribution", in that
sysinstall doesn't need to do this explicitly as Yet Another Special
Case. [2]
PORTREVISION bump after all this good stuff.
Requested by: bmah [1], jhb [2]
Submitted by: tobez (port MAINTAINER)
Approved by: portmgr (kris)
Diffstat (limited to 'lang')
-rw-r--r-- | lang/perl5.6/Makefile | 10 | ||||
-rw-r--r-- | lang/perl5.6/files/use.perl | 18 | ||||
-rw-r--r-- | lang/perl5.6/pkg-install | 9 | ||||
-rw-r--r-- | lang/perl5/Makefile | 10 | ||||
-rw-r--r-- | lang/perl5/files/use.perl | 18 | ||||
-rw-r--r-- | lang/perl5/pkg-install | 9 |
6 files changed, 62 insertions, 12 deletions
diff --git a/lang/perl5.6/Makefile b/lang/perl5.6/Makefile index 127b1d3f1dc2..16a684ea8990 100644 --- a/lang/perl5.6/Makefile +++ b/lang/perl5.6/Makefile @@ -7,7 +7,7 @@ PORTNAME= perl PORTVERSION= ${PERL_VER} -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= lang devel perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN} \ ${MASTER_SITE_LOCAL:S/$/:local/} @@ -56,6 +56,10 @@ INCLUDEDIR= /usr/include .include <bsd.port.pre.mk> +.if ${OSVERSION} >= 500043 +PKGMESSAGE= ${PKGDIR}/.not-here +.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 \ @@ -161,6 +165,10 @@ post-install: ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file} .endfor @(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h) +.if ${OSVERSION} < 500043 @fmt ${PKGMESSAGE} +.else + @${PREFIX}/bin/use.perl port +.endif .include <bsd.port.post.mk> diff --git a/lang/perl5.6/files/use.perl b/lang/perl5.6/files/use.perl index bed88bd46d44..0853b08da0a4 100644 --- a/lang/perl5.6/files/use.perl +++ b/lang/perl5.6/files/use.perl @@ -17,8 +17,6 @@ EOF my $port_perl = '%%PREFIX%%/bin/perl'; $port_perl =~ tr|/|/|s; -my $ident = `/usr/bin/ident -q /usr/bin/perl5`; - @ARGV == 1 or usage(); if ($ARGV[0] eq 'port') { switch_to_port(); @@ -43,6 +41,7 @@ sub switch_to_system link '/usr/bin/perl5', '/usr/bin/perl'; link '/usr/bin/perl5', '/usr/bin/perl%%PERL_VERSION%%'; + my $ident = `/usr/bin/ident -q /usr/bin/perl5`; if ($ident =~ m#src/usr.bin/perl/perl.c#) { link '/usr/bin/perl5', '/usr/bin/suidperl'; } else { @@ -81,10 +80,18 @@ sub switch_to_port { # 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'; + + my $need_perl5_link; + if (-e "/usr/bin/perl5" && !-l "/usr/bin/perl5") { + my $ident = `/usr/bin/ident -q /usr/bin/perl5`; + if ($ident =~ m#src/usr.bin/perl/perl.c#) { + rename '/usr/bin/perl', '/usr/bin/perl-wrapper'; + } else { + unlink '/usr/bin/perl'; + } } else { - unlink '/usr/bin/perl'; + unlink "/usr/bin/perl5"; + $need_perl5_link = 1; } unlink '/usr/bin/suidperl', '/usr/bin/perl%%PERL_VERSION%%'; @@ -92,6 +99,7 @@ sub switch_to_port symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl'; symlink '%%PREFIX%%/bin/suidperl', '/usr/bin/suidperl'; symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl%%PERL_VERSION%%'; + symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl5' if $need_perl5_link; } open MK, ">> /etc/make.conf" or die "/etc/make.conf: $!"; diff --git a/lang/perl5.6/pkg-install b/lang/perl5.6/pkg-install index 47fee558c9ae..46b4ae82fab1 100644 --- a/lang/perl5.6/pkg-install +++ b/lang/perl5.6/pkg-install @@ -9,5 +9,14 @@ INCLUDEDIR=/usr/include install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h +if [ -f /sbin/sysctl -a -x /sbin/sysctl ] ; then + osreldate=`/sbin/sysctl -n kern.osreldate` +else + osreldate=`/usr/sbin/sysctl -n kern.osreldate` +fi + +if [ $osreldate -ge 500043 ] ; then + ${PKG_PREFIX}/bin/use.perl port +fi exit 0 diff --git a/lang/perl5/Makefile b/lang/perl5/Makefile index 127b1d3f1dc2..16a684ea8990 100644 --- a/lang/perl5/Makefile +++ b/lang/perl5/Makefile @@ -7,7 +7,7 @@ PORTNAME= perl PORTVERSION= ${PERL_VER} -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= lang devel perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN} \ ${MASTER_SITE_LOCAL:S/$/:local/} @@ -56,6 +56,10 @@ INCLUDEDIR= /usr/include .include <bsd.port.pre.mk> +.if ${OSVERSION} >= 500043 +PKGMESSAGE= ${PKGDIR}/.not-here +.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 \ @@ -161,6 +165,10 @@ post-install: ${BSDPAN_WRKSRC}/${file} ${BSDPAN_DEST}/${file} .endfor @(cd ${INCLUDEDIR} && ${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h) +.if ${OSVERSION} < 500043 @fmt ${PKGMESSAGE} +.else + @${PREFIX}/bin/use.perl port +.endif .include <bsd.port.post.mk> diff --git a/lang/perl5/files/use.perl b/lang/perl5/files/use.perl index bed88bd46d44..0853b08da0a4 100644 --- a/lang/perl5/files/use.perl +++ b/lang/perl5/files/use.perl @@ -17,8 +17,6 @@ EOF my $port_perl = '%%PREFIX%%/bin/perl'; $port_perl =~ tr|/|/|s; -my $ident = `/usr/bin/ident -q /usr/bin/perl5`; - @ARGV == 1 or usage(); if ($ARGV[0] eq 'port') { switch_to_port(); @@ -43,6 +41,7 @@ sub switch_to_system link '/usr/bin/perl5', '/usr/bin/perl'; link '/usr/bin/perl5', '/usr/bin/perl%%PERL_VERSION%%'; + my $ident = `/usr/bin/ident -q /usr/bin/perl5`; if ($ident =~ m#src/usr.bin/perl/perl.c#) { link '/usr/bin/perl5', '/usr/bin/suidperl'; } else { @@ -81,10 +80,18 @@ sub switch_to_port { # 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'; + + my $need_perl5_link; + if (-e "/usr/bin/perl5" && !-l "/usr/bin/perl5") { + my $ident = `/usr/bin/ident -q /usr/bin/perl5`; + if ($ident =~ m#src/usr.bin/perl/perl.c#) { + rename '/usr/bin/perl', '/usr/bin/perl-wrapper'; + } else { + unlink '/usr/bin/perl'; + } } else { - unlink '/usr/bin/perl'; + unlink "/usr/bin/perl5"; + $need_perl5_link = 1; } unlink '/usr/bin/suidperl', '/usr/bin/perl%%PERL_VERSION%%'; @@ -92,6 +99,7 @@ sub switch_to_port symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl'; symlink '%%PREFIX%%/bin/suidperl', '/usr/bin/suidperl'; symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl%%PERL_VERSION%%'; + symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl5' if $need_perl5_link; } open MK, ">> /etc/make.conf" or die "/etc/make.conf: $!"; diff --git a/lang/perl5/pkg-install b/lang/perl5/pkg-install index 47fee558c9ae..46b4ae82fab1 100644 --- a/lang/perl5/pkg-install +++ b/lang/perl5/pkg-install @@ -9,5 +9,14 @@ INCLUDEDIR=/usr/include install -d ${PKG_PREFIX}/lib/perl5/site_perl/5.6.1/mach cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h +if [ -f /sbin/sysctl -a -x /sbin/sysctl ] ; then + osreldate=`/sbin/sysctl -n kern.osreldate` +else + osreldate=`/usr/sbin/sysctl -n kern.osreldate` +fi + +if [ $osreldate -ge 500043 ] ; then + ${PKG_PREFIX}/bin/use.perl port +fi exit 0 |