From root@3wgraphics.net  Tue Jan 20 03:18:03 2004
Return-Path: <root@3wgraphics.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 388CF16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Jan 2004 03:18:03 -0800 (PST)
Received: from mail.3wgraphics.net (mail.3wgraphics.net [194.87.91.161])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7CF5C43D64
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Jan 2004 03:17:44 -0800 (PST)
	(envelope-from root@3wgraphics.net)
Received: from root by mail.3wgraphics.net with local (Exim 4.24; FreeBSD)
	id 1AitvR-0007B1-Nj
	for FreeBSD-gnats-submit@freebsd.org; Tue, 20 Jan 2004 14:20:05 +0300
Message-Id: <E1AitvR-0007B1-Nj@mail.3wgraphics.net>
Date: Tue, 20 Jan 2004 14:20:05 +0300
From: skv@FreeBSD.org
Reply-To: skv@FreeBSD.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: Add support for p5-Module::Build into bsd.port.mk
X-Send-Pr-Version: 3.2

>Number:         61621
>Category:       ports
>Synopsis:       Add support for p5-Module::Build into bsd.port.mk
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 20 03:20:12 PST 2004
>Closed-Date:    Tue Feb 03 21:33:34 PST 2004
>Last-Modified:  Tue Feb 03 21:33:34 PST 2004
>Originator:     Sergey Skvortsov
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
<Organization of PR author (multiple lines)>
>Environment:

	<Relevant environment information (multiple lines)>

>Description:

"Module::Build" is a system for building, testing, and installing Perl
modules.

It will replace obsoleted "ExtUtils::MakeMaker".

Many of perl modules on CPAN upgrade its Makefile.PL scripts to Build.PL.

This patch is intended to add support for such modules into bsd.port.mk.

In new-fashion ports just one line in port's Makefile should be added:
PERL_MODBUILD=	yes

(instead usual "PERL_CONFIGURE=	yes").

Also this patch make operations with SITE_PERL more simple and obvious.

>How-To-Repeat:

	<Code/input/activities to reproduce the problem (multiple lines)>

>Fix:

--- bsd.port.orig.mk	Tue Jan 20 13:00:44 2004
+++ bsd.port.mk	Tue Jan 20 13:54:09 2004
@@ -327,6 +327,7 @@
 #				  (value: perl5)
 # SITE_PERL		- Directory name where site specific perl packages go.
 #					This value is added to PLIST_SUB.
+# PERL_MODBUILD		- Use Module::Build to configure, build and install port.
 ##
 # USE_BISON		- Says that the port uses bison for building.
 ##
@@ -1095,7 +1096,8 @@
 PERL_PORT?=	perl5
 .endif
 
-SITE_PERL?=	${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}
+SITE_PERL_REL?=	lib/perl5/site_perl/${PERL_VER}
+SITE_PERL?=	${LOCALBASE}/${SITE_PERL_REL}
 
 .if exists(/usr/bin/perl5) && ${OSVERSION} >= 300000 && ${OSVERSION} < 500036
 PERL5=		/usr/bin/perl${PERL_VERSION}
@@ -1598,7 +1600,22 @@
 PLIST_SUB+=		PERL_VERSION=${PERL_VERSION} \
 				PERL_VER=${PERL_VER} \
 				PERL_ARCH=${PERL_ARCH} \
-				SITE_PERL=${SITE_PERL:S|^${LOCALBASE}/||}
+				SITE_PERL=${SITE_PERL_REL}
+
+.if defined(PERL_MODBUILD)
+PERL_CONFIGURE=	yes
+CONFIGURE_SCRIPT?=	Build.PL
+BUILD_DEPENDS+=	${SITE_PERL}/Module/Build.pm:${PORTSDIR}/devel/p5-Module-Build
+ALL_TARGET?=	
+PL_BUILD?=	Build
+CONFIGURE_ARGS+= \
+	install_path=lib="${PREFIX}/${SITE_PERL_REL}" \
+	install_path=arch="${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}" \
+	install_path=script="${PREFIX}/bin" \
+	install_path=bin="${PREFIX}/bin" \
+	install_path=libdoc="${MAN3PREFIX}/man/man3" \
+	install_path=bindoc="${MAN1PREFIX}/man/man1"
+.endif
 
 .if defined(PERL_CONFIGURE)
 USE_PERL5=	yes
@@ -3076,9 +3093,13 @@
 .if defined(USE_GMAKE)
 	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .else
+.if defined(PERL_MODBUILD)
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${ALL_TARGET})
+.else
 	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .endif
 .endif
+.endif
 
 # Check conflicts
 
@@ -3120,11 +3141,15 @@
 .endif
 .endif
 .else defined(USE_GMAKE)
+.if defined(PERL_MODBUILD)
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${INSTALL_TARGET})
+.else
 	@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
 .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
 	@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
 .if ${XFREE86_HTML_MAN:L} == yes
 	@${MKHTMLINDEX} ${PREFIX}/lib/X11/doc/html
+.endif
 .endif
 .endif
 .endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: skv 
Responsible-Changed-When: Tue Jan 20 04:13:43 PST 2004 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61621 
State-Changed-From-To: open->analyzed 
State-Changed-By: marcus 
State-Changed-When: Fri Jan 30 20:43:11 PST 2004 
State-Changed-Why:  
This is currently being tested on bento. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61621 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Tue Feb 3 21:33:23 PST 2004 
State-Changed-Why:  
Committed, thanks! 

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