From neuhauser@sigpipe.cz  Wed Sep 28 17:45:58 2005
Return-Path: <neuhauser@sigpipe.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 331A716A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Sep 2005 17:45:58 +0000 (GMT)
	(envelope-from neuhauser@sigpipe.cz)
Received: from isis.sigpipe.cz (fw.sigpipe.cz [62.245.70.224])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5D6D843D49
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Sep 2005 17:45:54 +0000 (GMT)
	(envelope-from neuhauser@sigpipe.cz)
Received: by isis.sigpipe.cz (Postfix, from userid 1001)
	id 5D0081F87BED; Wed, 28 Sep 2005 19:45:53 +0200 (CEST)
Message-Id: <20050928174553.5D0081F87BED@isis.sigpipe.cz>
Date: Wed, 28 Sep 2005 19:45:53 +0200 (CEST)
From: Roman Neuhauser <neuhauser@sigpipe.cz>
Reply-To: Roman Neuhauser <neuhauser@sigpipe.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc: antonio@php.net
Subject: [PATCH] pear-PEAR/Makefile.common trimming
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         86684
>Category:       ports
>Synopsis:       [PATCH] pear-PEAR/Makefile.common trimming
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    thierry
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 28 17:50:18 GMT 2005
>Closed-Date:    Sat Dec 10 20:42:20 GMT 2005
>Last-Modified:  Sat Dec 10 20:42:20 GMT 2005
>Originator:     Roman Neuhauser
>Release:        FreeBSD 4.10-STABLE i386
>Organization:
>Environment:


	
>Description:
Maintainer on cc.

The attached patch for devel/pear-PEAR/Makefile.common replaces
the do-install-<foo> targets with a .for loop that generates them similarly
to the way default do-install-<foo>-msg targets are created.

I remeber thinking about doing it this way when I was writing the code two
years ago, I don't know why I didn't do it then.

The ${REINPLACE_CMD} calls from do-install-scriptfiles were moved into
a separate post-patch dependency. The patching can easily work for any files
(not just ${SCRIPTFILES}), but I'll leave that for later.

I have tested this with mail/pear-Mail and databases/pear-DB (on 4.10-STABLE),
works with or without NOPORTDOCS.

>How-To-Repeat:
	
>Fix:

	

--- devel::pear-PEAR::Makefile.common-do-install-foo,1.patch begins here ---
Index: devel/pear-PEAR/Makefile.common
===================================================================
RCS file: /home/ncvs/ports/devel/pear-PEAR/Makefile.common,v
retrieving revision 1.13
diff -u -u -r1.13 Makefile.common
--- devel/pear-PEAR/Makefile.common	21 Feb 2005 18:05:04 -0000	1.13
+++ devel/pear-PEAR/Makefile.common	28 Sep 2005 17:08:52 -0000
@@ -58,6 +58,7 @@
 SQLS?=
 SCRIPTFILES?=
 TESTS?=
+_FILESDIR?=
 _DATADIR?=	data
 _DOCSDIR?=	docs
 _EXAMPLESDIR?=	examples
@@ -140,96 +141,53 @@
 	echo "@unexec rmdir %D/${LSQLSDIR:H} 2> /dev/null || true") > ${PLIST}
 . endif
 
-. for t in files docs tests sqls scriptfiles examples data
-.  if !target(do-install-${t}-msg)
-do-install-${t}-msg: .USE
-.  endif
-. endfor
-
-pre-install: 	do-generate-plist
-do-install: 	do-install-files do-install-docs do-install-tests do-install-sqls \
-		do-install-scriptfiles do-install-examples do-install-data
 
-do-install-files: do-install-files-msg
-	@${MKDIR} ${INSTDIR}
-. for dir in ${FILESDIRS}
-	@${MKDIR} ${INSTDIR}/${dir}
-. endfor
-. for file in ${FILES}
-	@${INSTALL_DATA} ${WRKSRC}/${file} ${INSTDIR}/${file}
-. endfor
-
-do-install-docs: do-install-docs-msg
-. if !defined(NOPORTDOCS) && !empty(DOCS)
-	@${ECHO_MSG} "===> Installing documentation in ${DOCSDIR}."
-	@${MKDIR} ${DOCSDIR}
-.  for dir in ${DOCSDIRS}
-	@${MKDIR} ${DOCSDIR}/${dir}
-.  endfor
-.  for file in ${DOCS}
-	@${INSTALL_DATA} ${WRKSRC}/${_DOCSDIR}/${file} ${DOCSDIR}/${file}
-.  endfor
-. endif
-
-do-install-tests: do-install-tests-msg
-. if !empty(TESTS)
-	@${ECHO_MSG} "===> Installing tests in ${TESTSDIR}."
-	@${MKDIR} ${TESTSDIR}
-.  for dir in ${TESTSDIRS}
-	@${MKDIR} ${TESTSDIR}/${dir}
-.  endfor
-.  for file in ${TESTS}
-	@${INSTALL_DATA} ${WRKSRC}/${_TESTSDIR}/${file} ${TESTSDIR}/${file}
-.  endfor
-. endif
-
-do-install-data: do-install-data-msg
-. if !empty(DATA)
-	@${ECHO_MSG} "===> Installing data in ${DATADIR}."
-	@${MKDIR} ${DATADIR}
-.  for dir in ${DATADIRS}
-	@${MKDIR} ${DATADIR}/${dir}
-.  endfor
-.  for file in ${DATA}
-	@${INSTALL_DATA} ${WRKSRC}/${_DATADIR}/${file} ${DATADIR}/${file}
-.  endfor
+INSTALLTGTS=	files tests sqls scriptfiles data 
+. if !defined(NOPORTDOCS)
+INSTALLTGTS+=	docs examples
 . endif
 
-do-install-sqls: do-install-sqls-msg
-. if !empty(SQLS)
-	@${ECHO_MSG} "===> Installing sqls in ${SQLSDIR}."
-	@${MKDIR} ${SQLSDIR}
-.  for dir in ${SQLSDIRS}
-	@${MKDIR} ${SQLSDIR}/${dir}
-.  endfor
-.  for file in ${SQLS}
-	@${INSTALL_DATA} ${WRKSRC}/${_SQLSDIR}/${file} ${SQLSDIR}/${file}
-.  endfor
-. endif
+post-patch:	do-subst-paths
+pre-install: 	do-generate-plist
+do-install: 	${INSTALLTGTS:S/^/do-install-&/}
 
-do-install-scriptfiles: do-install-scriptfiles-msg
-. if !empty(SCRIPTFILES)
-	@${ECHO_MSG} "===> Installing scripts in ${SCRIPTFILESDIR}."
-.  for file in ${SCRIPTFILES}
+do-subst-paths:
+. for file in ${SCRIPTFILES}
 	@${CP} ${WRKSRC}/pear-${file} ${WRKSRC}/${file}
 	@${REINPLACE_CMD} -e "s|@php_bin@|${SCRIPTFILESDIR}/php|g" ${WRKSRC}/${file}
 	@${REINPLACE_CMD} -e "s|@php_dir@|${PREFIX}/lib/php|g" ${WRKSRC}/${file}
 	@${REINPLACE_CMD} -e "s|@include_path@|${PREFIX}/${LPEARDIR}|g" ${WRKSRC}/${file}
-	@${INSTALL_SCRIPT} ${WRKSRC}/${file} ${SCRIPTFILESDIR}/${file}
-.  endfor
-. endif
+. endfor
 
-do-install-examples: do-install-examples-msg
-. if !defined(NOPORTDOCS) && !empty(EXAMPLES)
-	@${ECHO_MSG} "===> Installing examples in ${EXAMPLESDIR}."
-	@${MKDIR} ${EXAMPLESDIR}
-.  for dir in ${EXAMPLESDIRS}
-	@${MKDIR} ${EXAMPLESDIR}/${dir}
-.  endfor
-.  for file in ${EXAMPLES}
-	@${INSTALL_DATA} ${WRKSRC}/${_EXAMPLESDIR}/${file} ${EXAMPLESDIR}/${file}
-.  endfor
-. endif
+. for t in files docs tests sqls examples
+_INSTALL_${t:U}=	${INSTALL_DATA}
+. endfor
+_INSTALL_SCRIPTFILES=	${INSTALL_SCRIPT}
+
+IFILESDIR=	${INSTDIR}
+IDATADIR=	${DATADIR}
+IDOCSDIR=	${DOCSDIR}
+IEXAMPLESDIR=	${EXAMPLESDIR}
+ISQLSDIR=	${SQLSDIR}
+ISCRIPTFILESDIR=${SCRIPTFILESDIR}
+ITESTSDIR=	${TESTSDIR}
+
+. for t in ${INSTALLTGTS}
+.  if !target(do-install-${t}-msg)
+do-install-${t}-msg: .USE
+.  endif
+do-install-${t}: do-install-${t}-msg
+.  if !empty(${t:U})
+	@${ECHO_MSG} "===> Installing ${t} in ${I${t:U}DIR}."
+	@${MKDIR} ${I${t:U}DIR}
+.   for dir in ${${t:U}DIRS}
+	@${MKDIR} ${I${t:U}DIR}/${dir}
+.   endfor
+.   for file in ${${t:U}}
+	@${_INSTALL_${t:U}} ${WRKSRC}/${_${t:U}DIR}/${file} ${I${t:U}DIR}/${file}
+.   endfor
+.  endif
+. endfor
 .endif
 
 post-install:
--- devel::pear-PEAR::Makefile.common-do-install-foo,1.patch ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: thierry 
State-Changed-When: Sun Oct 9 08:40:15 GMT 2005 
State-Changed-Why:  

Waiting for maintainer's approval. 



Responsible-Changed-From-To: freebsd-ports-bugs->thierry 
Responsible-Changed-By: thierry 
Responsible-Changed-When: Sun Oct 9 08:40:15 GMT 2005 
Responsible-Changed-Why:  

Take it. 


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

From: Thierry Thomas <thierry@FreeBSD.org>
To: =?iso-8859-1?Q?Ant=F4nio_Carlos_Ven=E2ncio_J=FAnior?= <antonio@php.net>
Cc: Roman Neuhauser <neuhauser@sigpipe.cz>,
	FreeBSD-gnats-submit@FreeBSD.org
Subject: Fwd: Re: ports/86684: [PATCH] pear-PEAR/Makefile.common trimming
Date: Sun, 9 Oct 2005 10:50:35 +0200

 Hello Antnio,
 
 Roman Neuhauser has submitted the following PR against devel/pear-PEAR,
 that you maintain.
 
 Could you please check it?
 
 ----- Forwarded message from Thierry Thomas <thierry@FreeBSD.org> -----
 
 > From: Thierry Thomas <thierry@FreeBSD.org>
 > Date: Sun, 9 Oct 2005 08:41:15 GMT
 > Subject: Re: ports/86684: [PATCH] pear-PEAR/Makefile.common trimming
 > To: neuhauser@sigpipe.cz, thierry@FreeBSD.org,
 > 	freebsd-ports-bugs@FreeBSD.org, thierry@FreeBSD.org
 > 
 > Synopsis: [PATCH] pear-PEAR/Makefile.common trimming
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: thierry
 > State-Changed-When: Sun Oct 9 08:40:15 GMT 2005
 > State-Changed-Why: 
 > 
 > Waiting for maintainer's approval.
 > 
 > 
 > 
 > Responsible-Changed-From-To: freebsd-ports-bugs->thierry
 > Responsible-Changed-By: thierry
 > Responsible-Changed-When: Sun Oct 9 08:40:15 GMT 2005
 > Responsible-Changed-Why: 
 > 
 > Take it.
 > 
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=86684
 
 ----- End forwarded message -----
 
 Regards,
 -- 
 Th. Thomas.

From: Antonio Carlos Venancio Junior <antonio@php.net>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: Roman Neuhauser <neuhauser@sigpipe.cz>, 
 Thierry Thomas <thierry@FreeBSD.org>
Subject: Re: Fwd: Re: ports/86684: [PATCH] pear-PEAR/Makefile.common trimming
Date: Mon, 10 Oct 2005 17:53:44 -0300

 Roman,
 
 	Approved. Thank you!
 
 Thierry Thomas wrote:
 > Hello Antnio,
 > 
 > Roman Neuhauser has submitted the following PR against devel/pear-PEAR,
 > that you maintain.
 > 
 > Could you please check it?
 > 
 > ----- Forwarded message from Thierry Thomas <thierry@FreeBSD.org> -----
 > 
 > 
 >>From: Thierry Thomas <thierry@FreeBSD.org>
 >>Date: Sun, 9 Oct 2005 08:41:15 GMT
 >>Subject: Re: ports/86684: [PATCH] pear-PEAR/Makefile.common trimming
 >>To: neuhauser@sigpipe.cz, thierry@FreeBSD.org,
 >>	freebsd-ports-bugs@FreeBSD.org, thierry@FreeBSD.org
 >>
 >>Synopsis: [PATCH] pear-PEAR/Makefile.common trimming
 >>
 >>State-Changed-From-To: open->feedback
 >>State-Changed-By: thierry
 >>State-Changed-When: Sun Oct 9 08:40:15 GMT 2005
 >>State-Changed-Why: 
 >>
 >>Waiting for maintainer's approval.
 >>
 >>
 >>
 >>Responsible-Changed-From-To: freebsd-ports-bugs->thierry
 >>Responsible-Changed-By: thierry
 >>Responsible-Changed-When: Sun Oct 9 08:40:15 GMT 2005
 >>Responsible-Changed-Why: 
 >>
 >>Take it.
 >>
 >>
 >>http://www.freebsd.org/cgi/query-pr.cgi?pr=86684
 > 
 > 
 > ----- End forwarded message -----
 > 
 > Regards,
 
 
 -- 
 Cya
 
 Antonio
 echo antonio php net | sed 's/ /@/;s/ /./g'
 FreeBSD/OpenBSD | PHP/MySQL | PGP Key ID 0x5BBEB073
 "Can't buy what I want because its FREE!" - Pearl Jam
 

From: Thierry Thomas <thierry@FreeBSD.org>
To: Antonio Carlos Venancio Junior <antonio@php.net>,
	Roman Neuhauser <neuhauser@sigpipe.cz>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: Fwd: Re: ports/86684: [PATCH] pear-PEAR/Makefile.common trimming
Date: Tue, 11 Oct 2005 19:26:26 +0200

 On Mon 10 oct 05 at 22:53:44 +0200, Antonio Carlos Venancio Junior <antonio@php.net>
  wrote:
 > Roman,
 > 
 > 	Approved. Thank you!
 
 Thanks Antonio!
 
 But there is a problem: I have tested it successfully with several pear-
 ports, but it fails to rebuild itself:
 
 cd /usr/ports/devel/pear-PEAR
 
 make -V SCRIPTFILES
 pear2
 
 make patch
 ===>  Extracting for pear-PEAR-1.3.5_1
 => Checksum OK for PEAR/PEAR-1.3.5.tgz.
 ===>  Patching for pear-PEAR-1.3.5_1
 ===>  Applying FreeBSD patches for pear-PEAR-1.3.5_1
 cp: /space/portstrees/6-CURRENT/ports/devel/pear-PEAR/work/PEAR-1.3.5/pear-pear2: No such file or directory
 *** Error code 1
 
 Stop in /space/portstrees/6-CURRENT/ports/devel/pear-PEAR.
 
 Roman, could you please check it?
 
 Regards,
 -- 
 Th. Thomas.

From: Roman Neuhauser <neuhauser@sigpipe.cz>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: Antonio Carlos Venancio Junior <antonio@php.net>
Subject: Re: Fwd: Re: ports/86684: [PATCH] pear-PEAR/Makefile.common trimming
Date: Tue, 11 Oct 2005 19:42:38 +0200

 # thierry@FreeBSD.org / 2005-10-11 19:26:26 +0200:
 > But there is a problem: I have tested it successfully with several pear-
 > ports, but it fails to rebuild itself:
 > 
 > cd /usr/ports/devel/pear-PEAR
 > 
 > make -V SCRIPTFILES
 > pear2
 > 
 > make patch
 > ===>  Extracting for pear-PEAR-1.3.5_1
 > => Checksum OK for PEAR/PEAR-1.3.5.tgz.
 > ===>  Patching for pear-PEAR-1.3.5_1
 > ===>  Applying FreeBSD patches for pear-PEAR-1.3.5_1
 > cp: /space/portstrees/6-CURRENT/ports/devel/pear-PEAR/work/PEAR-1.3.5/pear-pear2: No such file or directory
 > *** Error code 1
 > 
 > Stop in /space/portstrees/6-CURRENT/ports/devel/pear-PEAR.
 > 
 > Roman, could you please check it?
 
     Sure, thanks for pointing this out (and sorry for the hassle, I
     should've tested it better).
 
 -- 
 How many Vietnam vets does it take to screw in a light bulb?
 You don't know, man.  You don't KNOW.
 Cause you weren't THERE.             http://bash.org/?255991
State-Changed-From-To: feedback->closed 
State-Changed-By: thierry 
State-Changed-When: Sat Dec 10 20:41:20 UTC 2005 
State-Changed-Why:  

This port has been removed. 


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