From edwin@mavetju.org  Wed Oct 12 11:34:19 2005
Return-Path: <edwin@mavetju.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 52A2116A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Oct 2005 11:34:19 +0000 (GMT)
	(envelope-from edwin@mavetju.org)
Received: from mail3out.barnet.com.au (mail3out.barnet.com.au [202.83.176.17])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 45C1F43D48
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Oct 2005 11:34:18 +0000 (GMT)
	(envelope-from edwin@mavetju.org)
Received: by mail3out.barnet.com.au (Postfix, from userid 27)
	id 95888877C54; Wed, 12 Oct 2005 21:34:17 +1000 (EST)
Received: from mail3-auth.barnet.com.au (mail3.barnet.com.au [202.83.176.16])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "*.barnet.com.au", Issuer "BarNet Root Certificate Authority" (verified OK))
	by mail3.barnet.com.au (Postfix) with ESMTP id 4EFE3877C44
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Oct 2005 21:34:17 +1000 (EST)
Received: from k7.mavetju (edwin-3.int.barnet.com.au [10.10.12.2])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "edwin.adsl.barnet.com.au", Issuer "BarNet Root Certificate Authority" (not verified))
	by mail3-auth.barnet.com.au (Postfix) with ESMTP id B44B0877C32
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Oct 2005 21:34:15 +1000 (EST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id 8BE9A614E; Wed, 12 Oct 2005 21:34:14 +1000 (EST)
Message-Id: <20051012113414.8BE9A614E@k7.mavetju>
Date: Wed, 12 Oct 2005 21:34:14 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] bsd.port.mk - add support for PERL_RUN_DEPENDS and PERL_BUILD_DEPENDS
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         87318
>Category:       ports
>Synopsis:       [patch] bsd.port.mk - add support for PERL_RUN_DEPENDS and PERL_BUILD_DEPENDS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    edwin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 12 11:40:16 GMT 2005
>Closed-Date:    Tue Apr 04 22:50:08 GMT 2006
>Last-Modified:  Tue Apr 04 22:50:08 GMT 2006
>Originator:     Edwin Groothuis
>Release:        FreeBSD 5.2.1-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #8: Wed Dec 15 16:58:01 EST 2004 edwin@k7.mavetju:/usr/src-5.2.1/sys/i386/compile/k7 i386


>Description:

Perl modules produce horrible RUN_DEPENDS and BUILD_DEPENDS:

    BUILD_DEPENDS=  \
                ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
                ${SITE_PERL}/MIME/Tools.pm:${PORTSDIR}/mail/p5-MIME-Tools \
                ${SITE_PERL}/Time/Timezone.pm:${PORTSDIR}/devel/p5-Time-modules \
                ${SITE_PERL}/${PERL_ARCH}/DBD/SQLite2.pm:${PORTSDIR}/databases/p5-DBD-SQLite2 \
                ${SITE_PERL}/${PERL_ARCH}/XML/Parser.pm:${PORTSDIR}/textproc/p5-XML-Parser \
                ${SITE_PERL}/${PERL_ARCH}/Curses.pm:${PORTSDIR}/devel/p5-Curses \
                ${SITE_PERL}/Curses/UI.pm:${PORTSDIR}/devel/p5-Curses-UI \
                ${SITE_PERL}/Locale/TextDomain.pm:${PORTSDIR}/devel/p5-Locale-libintl

It would be much nicer if you could define it easier:

    PERL_BUILD_DEPENDS=	\
		Digest::MD5:${PORTSDIR}/security/p5-Digest-MD5 \
                MIME::Tools:${PORTSDIR}/mail/p5-MIME-Tools \
                Time::Timezone:${PORTSDIR}/devel/p5-Time-modules \
                DBD::SQLite2:${PORTSDIR}/databases/p5-DBD-SQLite2 \
                XML::Parser:${PORTSDIR}/textproc/p5-XML-Parser \
                Curses:${PORTSDIR}/devel/p5-Curses \
                Curses::UI:${PORTSDIR}/devel/p5-Curses-UI \
                Locale::TextDomain:${PORTSDIR}/devel/p5-Locale-libintl

Unfortunately, this introduced too much double code to handle the
::'s. But this layout didn't:

    PERL_BUILD_DEPENDS=	\
		Digest-MD5:${PORTSDIR}/security/p5-Digest-MD5 \
                MIME-Tools:${PORTSDIR}/mail/p5-MIME-Tools \
                Time-Timezone:${PORTSDIR}/devel/p5-Time-modules \
                DBD-SQLite2:${PORTSDIR}/databases/p5-DBD-SQLite2 \
                XML-Parser:${PORTSDIR}/textproc/p5-XML-Parser \
                Curses:${PORTSDIR}/devel/p5-Curses \
                Curses-UI:${PORTSDIR}/devel/p5-Curses-UI \
                Locale-TextDomain:${PORTSDIR}/devel/p5-Locale-libintl

>How-To-Repeat:
>Fix:

This patch adds support for PERL_RUN_DEPENDS and PERL_BUILD_DEPENDS
by checking the existance of the Perl modules with the "perl -e
'use module;'" command. It completes all the possible -fetch, -list
and pretty-print targets.

If this patch gets commited, I volunteer for updating the Porters
Manual and, if given a carte blanch, a single sweep to convert all
the ports.


--- bsd.port.mk.orig	Wed Oct 12 17:45:38 2005
+++ bsd.port.mk	Wed Oct 12 21:32:51 2005
@@ -480,6 +480,18 @@
 #				  package depends on.  "lib" is the name of a shared library.
 #				  make will use "ldconfig -r" to search for the library.
 #				  lib can contain extended regular expressions.
+# PERL_BUILD_DEPENDS
+#				- A list of "module:dir" tuples of Perl modules this
+#				  package depends to build. "module" is the name of the Perl
+#				  module which should be "use"d. make will use
+#				  "perl -e 'use module'" to check if the module is
+#				  available.
+# PERL_RUN_DEPENDS
+#				- A list of "module:dir" tuples of Perl modules this
+#				  package depends to run. "module" is the name of the Perl
+#				  module which should be "use"d. make will use
+#				  "perl -e 'use module'" to check if the module is
+#				  available.
 # DEPENDS		- A list of "dir[:target]" tuples of other ports this
 #				  package depends on being made first.  Use this only for
 #				  things that don't fall into the above four categories.
@@ -1724,6 +1736,10 @@
 USE_REINPLACE=yes
 .endif
 
+.if defined(PERL_RUN_DEPENDS) || defined(PERL_BUILD_DEPENDS)
+USE_PERL5_BUILD=	yes
+.endif
+
 .if ${PERL_LEVEL} >= 500600
 .if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
 EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
@@ -3800,16 +3816,18 @@
 _PATCH_SEQ=		patch-message patch-depends patch-dos2unix pre-patch \
 				pre-patch-script do-patch post-patch post-patch-script
 _CONFIGURE_DEP=	patch
-_CONFIGURE_SEQ=	build-depends lib-depends misc-depends configure-message \
-				pre-configure pre-configure-script patch-autotools \
-				run-autotools do-configure post-configure post-configure-script
+_CONFIGURE_SEQ=	build-depends lib-depends perl-build-depends misc-depends \
+				configure-message pre-configure pre-configure-script \
+				patch-autotools run-autotools do-configure post-configure \
+				post-configure-script
 _BUILD_DEP=		configure
 _BUILD_SEQ=		build-message pre-build pre-build-script do-build \
 				post-build post-build-script
 _INSTALL_DEP=	build
 _INSTALL_SEQ=	install-message check-conflicts \
-			    run-depends lib-depends apply-slist pre-install \
-				pre-install-script generate-plist check-already-installed
+			    run-depends lib-depends perl-run-depends apply-slist \
+				pre-install pre-install-script generate-plist \
+				check-already-installed
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script do-install post-install \
 				post-install-script add-plist-info add-plist-docs \
@@ -4307,7 +4325,7 @@
 ################################################################
 
 .if !target(depends)
-depends: extract-depends patch-depends lib-depends misc-depends fetch-depends build-depends run-depends
+depends: extract-depends patch-depends lib-depends perl-build-depends perl-run-depends misc-depends fetch-depends build-depends run-depends
 
 .if defined(ALWAYS_BUILD_DEPENDS)
 _DEPEND_ALWAYS=	1
@@ -4460,6 +4478,46 @@
 	done
 .endif
 
+.for deptype in BUILD RUN
+perl-${deptype:L}-depends:
+.if defined(PERL_${deptype}_DEPENDS)
+	@for tupple in ${PERL_${deptype}_DEPENDS}; do \
+		mod=$${tupple%:*}; \
+		mod=`${ECHO_CMD} $${mod} | sed -e 's/\-/::/g'`; \
+		dir=$${tupple##*:}; \
+		${ECHO_MSG} -n "===>   ${PKGNAME} depends on Perl module: $$mod"; \
+		if ${PERL} -M$${mod} -e 1 2>/dev/null; then \
+			${ECHO_MSG} " - found"; \
+		else \
+			${ECHO_MSG} " - not found"; \
+			${ECHO_MSG} "===>    Verifying install for $$mod in $$dir"; \
+			if [ ! -d "$$dir" ]; then \
+				${ECHO_MSG} "     => No directory for $$mod.  Skipping.."; \
+			else \
+				if [ X${USE_PACKAGE_DEPENDS} != "X" ]; then \
+					subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \
+					if [ -r "$${subpkgfile}" -a "$$target" = "${DEPENDS_TARGET}" ]; then \
+						${ECHO_MSG} "===>   Installing existing package $${subpkgfile}"; \
+						${PKG_ADD} $${subpkgfile}; \
+					else \
+					  (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS install ) ; \
+					fi; \
+				else \
+					(cd $$dir; ${MAKE} -DINSTALLS_DEPENDS install) ; \
+				fi ; \
+				${ECHO_MSG} "===>   Returning to build of ${PKGNAME}"; \
+				if ! ${PERL} -M$${mod} -e 1 2>/dev/null; then \
+					${ECHO_MSG} "Error: Perl module \"$${mod}\" does not exist"; \
+					${FALSE}; \
+				fi; \
+			fi; \
+		fi; \
+    done
+.else
+	@${DO_NADA}
+.endif
+.endfor
+
 misc-depends:
 .if defined(DEPENDS)
 .if !defined(NO_DEPENDS)
@@ -4490,13 +4548,13 @@
 # Dependency lists: both build and runtime, recursive.  Print out directory names.
 
 all-depends-list:
-.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_BUILD_DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${ALL-DEPENDS-LIST}
 .endif
 
 ALL-DEPENDS-LIST= \
 	checked="${PARENT_CHECKED}"; \
-	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
+	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS} ${PERL_BUILD_DEPENDS} " | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
 				child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" all-depends-list); \
@@ -4541,7 +4599,7 @@
 .if !target(fetch-required)
 fetch-required: fetch
 	@${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
-.for deptype in EXTRACT PATCH FETCH BUILD RUN
+.for deptype in EXTRACT PATCH FETCH BUILD RUN PERL_BUILD PERL_RUN
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
 	@for i in ${${deptype}_DEPENDS}; do \
@@ -4569,7 +4627,7 @@
 
 .if !target(fetch-required-list)
 fetch-required-list: fetch-list
-.for deptype in EXTRACT PATCH FETCH BUILD RUN
+.for deptype in EXTRACT PATCH FETCH BUILD RUN PERL_BUILD PERL_RUN
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
 	@for i in ${${deptype}_DEPENDS}; do \
@@ -4611,12 +4669,12 @@
 # Dependency lists: build and runtime.  Print out directory names.
 
 build-depends-list:
-.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
+.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS) || defined(PERL_BUILD_DEPENDS)
 	@${BUILD-DEPENDS-LIST}
 .endif
 
 BUILD-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | ${SORT} -u); do \
+	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${PERL_BUILD_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
@@ -4625,12 +4683,12 @@
 	done | ${SORT} -u
 
 run-depends-list:
-.if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${RUN-DEPENDS-LIST}
 .endif
 
 RUN-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
+	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
@@ -4642,7 +4700,7 @@
 # and package names.
 
 package-depends-list:
-.if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${PACKAGE-DEPENDS-LIST}
 .endif
 
@@ -4661,7 +4719,7 @@
 		done; \
 	fi; \
 	checked="${PARENT_CHECKED}"; \
-	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
+	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
 		dir=$$(${REALPATH} $$dir); \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
@@ -4730,7 +4788,9 @@
 		@rdirs = map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \
 		@ddirs = map((split /:/)[0], split(q{ }, q{${DEPENDS}})); \
 		@ldirs = map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})); \
-		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs) { \
+		@prdirs = map((split /:/)[1], split(q{ }, q{${PERL_RUN_DEPENDS}})); \
+		@pbdirs = map((split /:/)[1], split(q{ }, q{${PERL_BUILD_DEPENDS}})); \
+		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs, \@prdirs, \@pbdirs) { \
 			my @dirs = @$$i; \
 			@$$i = (); \
 			for (@dirs) { \
@@ -4754,11 +4814,11 @@
 			$$xf{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xf), q{|}; \
-		for (@bdirs, @ddirs, @ldirs) { \
+		for (@bdirs, @ddirs, @ldirs, @pbdirs) { \
 			$$xb{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xb), q{|}; \
-		for (@rdirs, @ddirs, @ldirs) { \
+		for (@rdirs, @ddirs, @ldirs, @prdirs) { \
 			$$xr{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xr), q{|}; \
@@ -4819,7 +4879,8 @@
 pretty-print-build-depends-list:
 .if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
 	defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
-	defined(LIB_DEPENDS) || defined(DEPENDS)
+	defined(LIB_DEPENDS) || defined(DEPENDS) || \
+	defined(PERL_BUILD_DEPENDS)
 	@${ECHO_CMD} -n 'This port requires package(s) "'
 	@${ECHO_CMD} -n `${GREP} '^${PKGNAME}|' ${PORTSDIR}/${INDEXFILE} | ${AWK} -F\| '{print $$8;}'`
 	@${ECHO_CMD} '" to build.'
@@ -4828,7 +4889,8 @@
 
 .if !target(pretty-print-run-depends-list)
 pretty-print-run-depends-list:
-.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
+.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || \
+	defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${ECHO_CMD} -n 'This port requires package(s) "'
 	@${ECHO_CMD} -n `${GREP} '^${PKGNAME}|' ${PORTSDIR}/${INDEXFILE} | ${AWK} -F\| '{print $$9;}'`
 	@${ECHO_CMD} '" to run.'
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: tobez 
Responsible-Changed-When: Wed Oct 12 13:45:58 CEST 2005 
Responsible-Changed-Why:  
Portmgr territory. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87318 

From: Anton Berezin <tobez@FreeBSD.org>
To: Edwin Groothuis <edwin@mavetju.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/87318: [patch] bsd.port.mk - add support for PERL_RUN_DEPENDS and PERL_BUILD_DEPENDS
Date: Wed, 12 Oct 2005 13:45:41 +0200

 On Wed, Oct 12, 2005 at 09:34:14PM +1000, Edwin Groothuis wrote:
 > 
 > >Number:         87318
 > >Category:       ports
 > >Synopsis:       [patch] bsd.port.mk - add support for PERL_RUN_DEPENDS and PERL_BUILD_DEPENDS
 
 >     PERL_BUILD_DEPENDS=	\
 > 		Digest-MD5:${PORTSDIR}/security/p5-Digest-MD5 \
 >                 MIME-Tools:${PORTSDIR}/mail/p5-MIME-Tools \
 >                 Time-Timezone:${PORTSDIR}/devel/p5-Time-modules \
 >                 DBD-SQLite2:${PORTSDIR}/databases/p5-DBD-SQLite2 \
 >                 XML-Parser:${PORTSDIR}/textproc/p5-XML-Parser \
 >                 Curses:${PORTSDIR}/devel/p5-Curses \
 >                 Curses-UI:${PORTSDIR}/devel/p5-Curses-UI \
 >                 Locale-TextDomain:${PORTSDIR}/devel/p5-Locale-libintl
 
 If I get a vote, I am all for it!  Nice job, Edwin!
 
 \Anton.
 -- 
 An undefined problem has an infinite number of solutions.
 -- Robert A. Humphrey

From: Edwin Groothuis <edwin@mavetju.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: ports/87318 : [patch] bsd.port.mk - add support for PERL_RUN_DEPENDS and PERL_BUILD_DEPENDS
Date: Fri, 14 Oct 2005 18:11:26 +1000

 Please see the discussion at 
     http://docs.freebsd.org/cgi/mid.cgi?20051012114222.GD1278
 for other peoples opinions and my replies.
 
 
 -- 
 Edwin Groothuis      |            Personal website: http://www.mavetju.org
 edwin@mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/

Adding to audit trail by mcl:

I was not able to get the above patch to work on patch #3 due to some
whitespace issues.  While merging the changes I also found that the
patch-dos2unix target (introduced in another PR) had become commingled.

Here is my updated version of the patch:

--- bsd.port.mk.cvs	Sun Dec 11 00:23:19 2005
+++ bsd.port.mk	Sun Dec 11 00:34:40 2005
@@ -250,6 +250,18 @@
 #				  package depends on.  "lib" is the name of a shared library.
 #				  make will use "ldconfig -r" to search for the library.
 #				  lib can contain extended regular expressions.
+# PERL_BUILD_DEPENDS
+#				- A list of "module:dir" tuples of Perl modules this
+#				  package depends to build. "module" is the name of the Perl
+#				  module which should be "use"d. make will use
+#				  "perl -e 'use module'" to check if the module is
+#				  available.
+# PERL_RUN_DEPENDS
+#				- A list of "module:dir" tuples of Perl modules this
+#				  package depends to run. "module" is the name of the Perl
+#				  module which should be "use"d. make will use
+#				  "perl -e 'use module'" to check if the module is
+#				  available.
 # DEPENDS		- A list of "dir[:target]" tuples of other ports this
 #				  package depends on being made first.  Use this only for
 #				  things that don't fall into the above four categories.
@@ -1718,6 +1730,10 @@
 USE_REINPLACE=yes
 .endif
 
+.if defined(PERL_RUN_DEPENDS) || defined(PERL_BUILD_DEPENDS)
+USE_PERL5_BUILD=	yes
+.endif
+
 .if ${PERL_LEVEL} >= 500600
 .if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
 EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
@@ -3690,16 +3706,18 @@
 _PATCH_SEQ=		patch-message patch-depends pre-patch pre-patch-script \
 				do-patch post-patch post-patch-script
 _CONFIGURE_DEP=	patch
-_CONFIGURE_SEQ=	build-depends lib-depends misc-depends configure-message \
-		pre-configure pre-configure-script patch-autotools \
-		run-autotools do-configure post-configure post-configure-script
+_CONFIGURE_SEQ=	build-depends lib-depends perl-build-depends misc-depends \
+				configure-message pre-configure pre-configure-script \
+				patch-autotools run-autotools do-configure post-configure \
+				post-configure-script
 _BUILD_DEP=		configure
 _BUILD_SEQ=		build-message pre-build pre-build-script do-build \
 				post-build post-build-script
 _INSTALL_DEP=	build
 _INSTALL_SEQ=	install-message check-conflicts \
-			    run-depends lib-depends apply-slist pre-install \
-				pre-install-script generate-plist check-already-installed
+				run-depends lib-depends perl-run-depends apply-slist \
+				pre-install pre-install-script generate-plist \
+				check-already-installed
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script do-install install-desktop-entries \
 				post-install post-install-script add-plist-info \
@@ -4285,7 +4303,7 @@
 ################################################################
 
 .if !target(depends)
-depends: extract-depends patch-depends lib-depends misc-depends fetch-depends build-depends run-depends
+depends: extract-depends patch-depends lib-depends perl-build-depends perl-run-depends misc-depends fetch-depends build-depends run-depends
 
 .if defined(ALWAYS_BUILD_DEPENDS)
 _DEPEND_ALWAYS=	1
@@ -4438,6 +4456,46 @@
 	done
 .endif
 
+.for deptype in BUILD RUN
+perl-${deptype:L}-depends:
+.if defined(PERL_${deptype}_DEPENDS)
+	@for tupple in ${PERL_${deptype}_DEPENDS}; do \
+		mod=$${tupple%:*}; \
+		mod=`${ECHO_CMD} $${mod} | sed -e 's/\-/::/g'`; \
+		dir=$${tupple##*:}; \
+		${ECHO_MSG} -n "===>   ${PKGNAME} depends on Perl module: $$mod"; \
+		if ${PERL} -M$${mod} -e 1 2>/dev/null; then \
+			${ECHO_MSG} " - found"; \
+		else \
+			${ECHO_MSG} " - not found"; \
+			${ECHO_MSG} "===>    Verifying install for $$mod in $$dir"; \
+			if [ ! -d "$$dir" ]; then \
+				${ECHO_MSG} "     => No directory for $$mod.  Skipping.."; \
+			else \
+				if [ X${USE_PACKAGE_DEPENDS} != "X" ]; then \
+					subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \
+					if [ -r "$${subpkgfile}" -a "$$target" = "${DEPENDS_TARGET}" ]; then \
+						${ECHO_MSG} "===>   Installing existing package $${subpkgfile}"; \
+						${PKG_ADD} $${subpkgfile}; \
+					else \
+					  (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS install ) ; \
+					fi; \
+				else \
+					(cd $$dir; ${MAKE} -DINSTALLS_DEPENDS install) ; \
+				fi ; \
+				${ECHO_MSG} "===>   Returning to build of ${PKGNAME}"; \
+				if ! ${PERL} -M$${mod} -e 1 2>/dev/null; then \
+					${ECHO_MSG} "Error: Perl module \"$${mod}\" does not exist"; \
+					${FALSE}; \
+				fi; \
+			fi; \
+		fi; \
+    done
+.else
+	@${DO_NADA}
+.endif
+.endfor
+
 misc-depends:
 .if defined(DEPENDS)
 .if !defined(NO_DEPENDS)
@@ -4468,13 +4526,13 @@
 # Dependency lists: both build and runtime, recursive.  Print out directory names.
 
 all-depends-list:
-.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_BUILD_DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${ALL-DEPENDS-LIST}
 .endif
 
 ALL-DEPENDS-LIST= \
 	checked="${PARENT_CHECKED}"; \
-	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
+	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS} ${PERL_BUILD_DEPENDS} " | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
 				child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" all-depends-list); \
@@ -4519,7 +4577,7 @@
 .if !target(fetch-required)
 fetch-required: fetch
 	@${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
-.for deptype in EXTRACT PATCH FETCH BUILD RUN
+.for deptype in EXTRACT PATCH FETCH BUILD RUN PERL_BUILD PERL_RUN
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
 	@for i in ${${deptype}_DEPENDS}; do \
@@ -4547,7 +4605,7 @@
 
 .if !target(fetch-required-list)
 fetch-required-list: fetch-list
-.for deptype in EXTRACT PATCH FETCH BUILD RUN
+.for deptype in EXTRACT PATCH FETCH BUILD RUN PERL_BUILD PERL_RUN
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
 	@for i in ${${deptype}_DEPENDS}; do \
@@ -4584,12 +4642,12 @@
 # Dependency lists: build and runtime.  Print out directory names.
 
 build-depends-list:
-.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
+.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS) || defined(PERL_BUILD_DEPENDS)
 	@${BUILD-DEPENDS-LIST}
 .endif
 
 BUILD-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | ${SORT} -u); do \
+	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${PERL_BUILD_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
@@ -4598,12 +4656,12 @@
 	done | ${SORT} -u
 
 run-depends-list:
-.if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${RUN-DEPENDS-LIST}
 .endif
 
 RUN-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
+	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
@@ -4615,7 +4673,7 @@
 # and package names.
 
 package-depends-list:
-.if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${PACKAGE-DEPENDS-LIST}
 .endif
 
@@ -4634,7 +4692,7 @@
 		done; \
 	fi; \
 	checked="${PARENT_CHECKED}"; \
-	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
+	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
 		dir=$$(${REALPATH} $$dir); \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
@@ -4699,7 +4757,9 @@
 		@rdirs = map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \
 		@ddirs = map((split /:/)[0], split(q{ }, q{${DEPENDS}})); \
 		@ldirs = map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})); \
-		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs) { \
+		@prdirs = map((split /:/)[1], split(q{ }, q{${PERL_RUN_DEPENDS}})); \
+		@pbdirs = map((split /:/)[1], split(q{ }, q{${PERL_BUILD_DEPENDS}})); \
+		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs, \@prdirs, \@pbdirs) { \
 			my @dirs = @$$i; \
 			@$$i = (); \
 			for (@dirs) { \
@@ -4723,11 +4783,11 @@
 			$$xf{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xf), q{|}; \
-		for (@bdirs, @ddirs, @ldirs) { \
+		for (@bdirs, @ddirs, @ldirs, @pbdirs) { \
 			$$xb{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xb), q{|}; \
-		for (@rdirs, @ddirs, @ldirs) { \
+		for (@rdirs, @ddirs, @ldirs, @prdirs) { \
 			$$xr{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xr), q{|}; \
@@ -4788,7 +4848,8 @@
 pretty-print-build-depends-list:
 .if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
 	defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
-	defined(LIB_DEPENDS) || defined(DEPENDS)
+	defined(LIB_DEPENDS) || defined(DEPENDS) || \
+	defined(PERL_BUILD_DEPENDS)
 	@${ECHO_CMD} -n 'This port requires package(s) "'
 	@${ECHO_CMD} -n `${GREP} '^${PKGNAME}|' ${PORTSDIR}/${INDEXFILE} | ${AWK} -F\| '{print $$8;}'`
 	@${ECHO_CMD} '" to build.'
@@ -4797,7 +4858,8 @@
 
 .if !target(pretty-print-run-depends-list)
 pretty-print-run-depends-list:
-.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
+.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || \
+	defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${ECHO_CMD} -n 'This port requires package(s) "'
 	@${ECHO_CMD} -n `${GREP} '^${PKGNAME}|' ${PORTSDIR}/${INDEXFILE} | ${AWK} -F\| '{print $$9;}'`
 	@${ECHO_CMD} '" to run.'
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sun Dec 11 06:35:28 UTC 2005 
State-Changed-Why:  
I was not able to get the patch to apply due to two items: a) whitespace 
issues; b) premature inclusion of patch-dos2unix which is introduced in 
another PR.  Submitter should double-check my work. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87318 
State-Changed-From-To: feedback->open 
State-Changed-By: edwin 
State-Changed-When: Mon Dec 12 23:11:53 UTC 2005 
State-Changed-Why:  
Feedback given 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87318 

Adding to audit trail from misfiled PR ports/90314:

Date: Tue, 13 Dec 2005 10:11:33 +1100
From: Edwin Groothuis <edwin@mavetju.org>

As requested by linimon@, here is the patch which does not involve
the dos2unix patches which were wrongly included earlier.


Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.518
diff -u -r1.518 bsd.port.mk
--- bsd.port.mk	8 Nov 2005 09:02:51 -0000	1.518
+++ bsd.port.mk	12 Dec 2005 23:06:41 -0000
@@ -250,6 +250,18 @@
 #				  package depends on.  "lib" is the name of a shared library.
 #				  make will use "ldconfig -r" to search for the library.
 #				  lib can contain extended regular expressions.
+# PERL_BUILD_DEPENDS
+#				- A list of "module:dir" tuples of Perl modules this
+#				  package depends to build. "module" is the name of the Perl
+#				  module which should be "use"d. make will use
+#				  "perl -e 'use module'" to check if the module is
+#				  available.
+# PERL_RUN_DEPENDS
+#				- A list of "module:dir" tuples of Perl modules this
+#				  package depends to run. "module" is the name of the Perl
+#				  module which should be "use"d. make will use
+#				  "perl -e 'use module'" to check if the module is
+#				  available.
 # DEPENDS		- A list of "dir[:target]" tuples of other ports this
 #				  package depends on being made first.  Use this only for
 #				  things that don't fall into the above four categories.
@@ -1718,6 +1730,10 @@
 USE_REINPLACE=yes
 .endif
 
+.if defined(PERL_RUN_DEPENDS) || defined(PERL_BUILD_DEPENDS)
+USE_PERL5_BUILD=	yes
+.endif
+
 .if ${PERL_LEVEL} >= 500600
 .if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
 EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
@@ -3690,16 +3706,18 @@
 _PATCH_SEQ=		patch-message patch-depends pre-patch pre-patch-script \
 				do-patch post-patch post-patch-script
 _CONFIGURE_DEP=	patch
-_CONFIGURE_SEQ=	build-depends lib-depends misc-depends configure-message \
-		pre-configure pre-configure-script patch-autotools \
-		run-autotools do-configure post-configure post-configure-script
+_CONFIGURE_SEQ=	build-depends lib-depends perl-build-depends misc-depends \
+				configure-message pre-configure pre-configure-script \
+				patch-autotools run-autotools do-configure post-configure \
+				post-configure-script
 _BUILD_DEP=		configure
 _BUILD_SEQ=		build-message pre-build pre-build-script do-build \
 				post-build post-build-script
 _INSTALL_DEP=	build
 _INSTALL_SEQ=	install-message check-conflicts \
-			    run-depends lib-depends apply-slist pre-install \
-				pre-install-script generate-plist check-already-installed
+			    run-depends lib-depends perl-run-depends apply-slist \
+				pre-install pre-install-script generate-plist \
+				check-already-installed
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script do-install install-desktop-entries \
 				post-install post-install-script add-plist-info \
@@ -4285,7 +4303,7 @@
 ################################################################
 
 .if !target(depends)
-depends: extract-depends patch-depends lib-depends misc-depends fetch-depends build-depends run-depends
+depends: extract-depends patch-depends lib-depends perl-build-depends perl-run-depends misc-depends fetch-depends build-depends run-depends
 
 .if defined(ALWAYS_BUILD_DEPENDS)
 _DEPEND_ALWAYS=	1
@@ -4438,6 +4456,46 @@
 	done
 .endif
 
+.for deptype in BUILD RUN
+perl-${deptype:L}-depends:
+.if defined(PERL_${deptype}_DEPENDS)
+	@for tupple in ${PERL_${deptype}_DEPENDS}; do \
+		mod=$${tupple%:*}; \
+		mod=`${ECHO_CMD} $${mod} | sed -e 's/\-/::/g'`; \
+		dir=$${tupple##*:}; \
+		${ECHO_MSG} -n "===>   ${PKGNAME} depends on Perl module: $$mod"; \
+		if ${PERL} -M$${mod} -e 1 2>/dev/null; then \
+			${ECHO_MSG} " - found"; \
+		else \
+			${ECHO_MSG} " - not found"; \
+			${ECHO_MSG} "===>    Verifying install for $$mod in $$dir"; \
+			if [ ! -d "$$dir" ]; then \
+				${ECHO_MSG} "     => No directory for $$mod.  Skipping.."; \
+			else \
+				if [ X${USE_PACKAGE_DEPENDS} != "X" ]; then \
+					subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \
+					if [ -r "$${subpkgfile}" -a "$$target" = "${DEPENDS_TARGET}" ]; then \
+						${ECHO_MSG} "===>   Installing existing package $${subpkgfile}"; \
+						${PKG_ADD} $${subpkgfile}; \
+					else \
+					  (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS install ) ; \
+					fi; \
+				else \
+					(cd $$dir; ${MAKE} -DINSTALLS_DEPENDS install) ; \
+				fi ; \
+				${ECHO_MSG} "===>   Returning to build of ${PKGNAME}"; \
+				if ! ${PERL} -M$${mod} -e 1 2>/dev/null; then \
+					${ECHO_MSG} "Error: Perl module \"$${mod}\" does not exist"; \
+					${FALSE}; \
+				fi; \
+			fi; \
+		fi; \
+    done
+.else
+	@${DO_NADA}
+.endif
+.endfor
+
 misc-depends:
 .if defined(DEPENDS)
 .if !defined(NO_DEPENDS)
@@ -4468,13 +4526,13 @@
 # Dependency lists: both build and runtime, recursive.  Print out directory names.
 
 all-depends-list:
-.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_BUILD_DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${ALL-DEPENDS-LIST}
 .endif
 
 ALL-DEPENDS-LIST= \
 	checked="${PARENT_CHECKED}"; \
-	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
+	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS} ${PERL_BUILD_DEPENDS} " | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e  'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
 				child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" all-depends-list); \
@@ -4519,7 +4577,7 @@
 .if !target(fetch-required)
 fetch-required: fetch
 	@${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
-.for deptype in EXTRACT PATCH FETCH BUILD RUN
+.for deptype in EXTRACT PATCH FETCH BUILD RUN PERL_BUILD PERL_RUN
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
 	@for i in ${${deptype}_DEPENDS}; do \
@@ -4547,7 +4605,7 @@
 
 .if !target(fetch-required-list)
 fetch-required-list: fetch-list
-.for deptype in EXTRACT PATCH FETCH BUILD RUN
+.for deptype in EXTRACT PATCH FETCH BUILD RUN PERL_BUILD PERL_RUN
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
 	@for i in ${${deptype}_DEPENDS}; do \
@@ -4584,12 +4642,12 @@
 # Dependency lists: build and runtime.  Print out directory names.
 
 build-depends-list:
-.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
+.if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS) || defined(PERL_BUILD_DEPENDS)
 	@${BUILD-DEPENDS-LIST}
 .endif
 
 BUILD-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/: .*//' | ${SORT} -u); do \
+	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${PERL_BUILD_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' ' \012' | ${SED} -e 's/:.*//' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
@@ -4598,12 +4656,12 @@
 	done | ${SORT} -u
 
 run-depends-list:
-.if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${RUN-DEPENDS-LIST}
 .endif
 
 RUN-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
+	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
@@ -4615,7 +4673,7 @@
 # and package names.
 
 package-depends-list:
-.if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
+.if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${PACKAGE-DEPENDS-LIST}
 .endif
 
@@ -4634,7 +4692,7 @@
 		done; \
 	fi; \
 	checked="${PARENT_CHECKED}"; \
-	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
+	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS} ${PERL_RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
 		dir=$$(${REALPATH} $$dir); \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
@@ -4699,7 +4757,9 @@
 		@rdirs = map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \
 		@ddirs = map((split /:/)[0], split(q{ }, q{${DEPENDS}})); \
 		@ldirs = map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})); \
-		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs) { \
+		@prdirs = map((split /:/)[1], split(q{ }, q{${PERL_RUN_DEPENDS}})); \
+		@pbdirs = map((split /:/)[1], split(q{ }, q{${PERL_BUILD_DEPENDS}})); \
+		for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs, \@prdirs, \@pbdirs) { \
 			my @dirs = @$$i; \
 			@$$i = (); \
 			for (@dirs) { \
@@ -4723,11 +4783,11 @@
 			$$xf{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xf), q{|}; \
-		for (@bdirs, @ddirs, @ldirs) { \
+		for (@bdirs, @ddirs, @ldirs, @pbdirs) { \
 			$$xb{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xb), q{|}; \
-		for (@rdirs, @ddirs, @ldirs) { \
+		for (@rdirs, @ddirs, @ldirs, @prdirs) { \
 			$$xr{$$_} = 1; \
 		} \
 		print join(q{ }, sort keys %xr), q{|}; \
@@ -4788,7 +4848,8 @@
 pretty-print-build-depends-list:
 .if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
 	defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
-	defined(LIB_DEPENDS) || defined(DEPENDS)
+	defined(LIB_DEPENDS) || defined(DEPENDS) || \
+	defined(PERL_BUILD_DEPENDS)
 	@${ECHO_CMD} -n 'This port requires package(s) "'
 	@${ECHO_CMD} -n `${GREP} '^${PKGNAME}|' ${PORTSDIR}/${INDEXFILE} | ${AWK} -F\| '{print $$8;}'`
 	@${ECHO_CMD} '" to build.'
@@ -4797,7 +4858,8 @@
 
 .if !target(pretty-print-run-depends-list)
 pretty-print-run-depends-list:
-.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
+.if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || \
+	defined(DEPENDS) || defined(PERL_RUN_DEPENDS)
 	@${ECHO_CMD} -n 'This port requires package(s) "'
 	@${ECHO_CMD} -n `${GREP} '^${PKGNAME}|' ${PORTSDIR}/${INDEXFILE} | ${AWK} -F\| '{print $$9;}'`
 	@${ECHO_CMD} '" to run.'

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin@mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/
State-Changed-From-To: open->analyzed 
State-Changed-By: linimon 
State-Changed-When: Mon Dec 19 01:27:59 UTC 2005 
State-Changed-Why:  
Accepted for testing on the cluster. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87318 
State-Changed-From-To: analyzed->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Jan 21 19:52:02 UTC 2006 
State-Changed-Why:  
Committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87318 
State-Changed-From-To: closed->open 
State-Changed-By: edwin 
State-Changed-When: Sat Jan 21 21:48:34 UTC 2006 
State-Changed-Why:  
over to myself for documentation and implementation 


Responsible-Changed-From-To: portmgr->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Jan 21 21:48:34 UTC 2006 
Responsible-Changed-Why:  
over to myself for documentation and implementation 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87234 
State-Changed-From-To: closed->open 
State-Changed-By: edwin 
State-Changed-When: Sat Jan 21 21:48:34 UTC 2006 
State-Changed-Why:  
over to myself for documentation and implementation 


Responsible-Changed-From-To: portmgr->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Jan 21 21:48:34 UTC 2006 
Responsible-Changed-Why:  
Over to myself for documentation and implementation 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87318 
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Tue Apr 4 22:49:55 UTC 2006 
State-Changed-Why:  
patch not implemented 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87318 
>Unformatted:
