Date: Wed, 28 Sep 2005 19:45:53 +0200 (CEST) From: Roman Neuhauser <neuhauser@sigpipe.cz> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/86684: [PATCH] pear-PEAR/Makefile.common trimming Message-ID: <20050928174553.5D0081F87BED@isis.sigpipe.cz> Resent-Message-ID: <200509281750.j8SHoI4c077873@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 86684 >Category: ports >Synopsis: [PATCH] pear-PEAR/Makefile.common trimming >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: Wed Sep 28 17:50:18 GMT 2005 >Closed-Date: >Last-Modified: >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: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050928174553.5D0081F87BED>