Date: Mon, 28 Dec 2009 21:15:46 GMT From: Alex Deiter <alex.deiter@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/142110: [PATCH] lang/perl5.10 / BSDPAN-5.10.1_20090303: P5PORTER mode update Message-ID: <200912282115.nBSLFkxB005792@www.freebsd.org> Resent-Message-ID: <200912282120.nBSLK31U046852@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 142110 >Category: ports >Synopsis: [PATCH] lang/perl5.10 / BSDPAN-5.10.1_20090303: P5PORTER mode update >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 28 21:20:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Alex Deiter >Release: 9.0-CURRENT >Organization: N/A >Environment: FreeBSD blackbox.deiter.net.ru 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Sat Dec 19 19:24:58 MSK 2009 root@blackbox.deiter.net.ru:/usr/obj/usr/src/sys/BLACKBOX i386 >Description: Please review patch for lang/perl5.10 and BSDPAN-5.10.1_20090303: P5PORTER mode update: 1. handling man1 and man3 correctly 2. cut $PREFIX from bin files 3. creates a list of dependencies, using the names and versions of packages: BUILD_DEPENDS= p5-Algorithm-Diff>=1.1901:${PORTSDIR}/devel/p5-Algorithm-Diff \ p5-Algorithm-Merge>=0:${PORTSDIR}/devel/p5-Algorithm-Merge instead of: BUILD_DEPENDS= {SITE_PERL}/IO/String.pm:${PORTSDIR}/devel/p5-IO-String \ ${SITE_PERL}/Text/EtText.pm:${PORTSDIR}/textproc/p5-Text-EtText Example Makefile.skeleton: # New ports collection makefile for: XXX/p5-[% portname %] # Date created: [% today %] # Whom: Alex Deiter <Alex.Deiter@Gmail.COM> # # $FreeBSD$ # PORTNAME= [% portname %] PORTVERSION= [% portversion %] CATEGORIES= XXX perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN} MASTER_SITE_SUBDIR= [% subdir %] PKGNAMEPREFIX= p5- MAINTAINER= Alex.Deiter@Gmail.COM COMMENT= [% comment %] [% IF has_dependencies %]BUILD_DEPENDS= [% freebsd_dependencies %] RUN_DEPENDS= ${BUILD_DEPENDS} [% END %] PERL_CONFIGURE= yes [% IF has_man1 %]MAN1= [% man1 %] [% END %] [% IF has_man3 %]MAN3= [% man3 %] [% END %] .include <bsd.port.mk> >How-To-Repeat: >Fix: Patch attached with submission follows: --- ExtUtils/Packlist.pm.orig 2009-12-28 23:28:34.394379548 +0300 +++ ExtUtils/Packlist.pm 2009-12-28 23:34:26.781293701 +0300 @@ -13,6 +13,7 @@ # use strict; use Carp; +use Config; use Fcntl; use BSDPAN; use BSDPAN::Override; @@ -332,16 +333,19 @@ { my ($C) = @_; - my (@files, @man3, @dirs); + my (@files, @man1, @man3, @dirs); # massage files for my $file (@{$C->{files}}) { $_ = $file; - if (m!/man/man3/([^/]+\.3)$!) { + if (m!/man/man1/([^/]+\.1)$!) { + push @man1, $1; + } elsif (m!/man/man3/([^/]+\.3)$!) { push @man3, $1; } else { s|^.*/perl5/site_perl/[\d.]+/|%%SITE_PERL%%/|; s|(_PERL%%)/mach/|$1/%%PERL_ARCH%%/|; + s|^$Config{prefix}\/*||; push @files, $_; } } @@ -349,7 +353,7 @@ # massage dirs for my $dir (@{$C->{dirs}}) { $_ = $dir; - if (m!/man/man3$!) { + if (m!/man/man[13]$!) { # skip } else { s|^.*/perl5/site_perl/[\d.]+/|%%SITE_PERL%%/|; @@ -384,6 +388,9 @@ require Template; my $tt = Template->new(ABSOLUTE => 1); my $tt_vars = {%$C}; + $tt_vars->{has_man1} = @man1 > 0; + $tt_vars->{has_man3} = @man3 > 0; + $tt_vars->{man1} = join " \\\n\t", sort @man1; $tt_vars->{man3} = join " \\\n\t", sort @man3; my $output = ""; $tt->process("$ENV{P5PORTER}/Makefile.skeleton", $tt_vars, \$output) or $output = "ERROR: " . $tt->error; --- ExtUtils/MakeMaker.pm.orig 2009-12-28 23:11:34.733069989 +0300 +++ ExtUtils/MakeMaker.pm 2009-12-28 23:13:45.647510916 +0300 @@ -15,6 +15,7 @@ use Carp; use BSDPAN; use BSDPAN::Override; +use File::Basename; sub WriteMakefile { @@ -65,6 +66,7 @@ print "BSDPAN: Found $req in base perl\n"; } else { my $cand = $req; + my $req_ver = ${$p{PREREQ_PM}}{$req}; $cand =~ s/::.*$//; my @cand = `ls $PORTSDIR/*/p5-$cand*/pkg-plist`; my @ports; @@ -105,9 +107,10 @@ while (@ports) { my $p = shift @ports; my $f = shift @files; - push @{$C->{dependencies}}, "$f:$p"; + my $pn = basename $p; + push @{$C->{dependencies}}, "$pn>=$req_ver:$p"; } - $C->{freebsd_dependencies} = join " \\\n\t\t", @{$C->{dependencies}}; + $C->{freebsd_dependencies} = join " \\\n\t\t", sort @{$C->{dependencies}}; } } } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912282115.nBSLFkxB005792>