Date: Tue, 23 Sep 2014 13:47:53 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r369057 - head/Mk/Uses Message-ID: <201409231347.s8NDlr0d094927@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Tue Sep 23 13:47:53 2014 New Revision: 369057 URL: http://svnweb.freebsd.org/changeset/ports/369057 QAT: https://qat.redports.org/buildarchive/r369057/ Log: Introduce USES=pear Added: head/Mk/Uses/pear.mk - copied, changed from r369049, head/devel/pear/bsd.pear.mk Copied and modified: head/Mk/Uses/pear.mk (from r369049, head/devel/pear/bsd.pear.mk) ============================================================================== --- head/devel/pear/bsd.pear.mk Tue Sep 23 12:18:06 2014 (r369049, copy source) +++ head/Mk/Uses/pear.mk Tue Sep 23 13:47:53 2014 (r369057) @@ -1,25 +1,31 @@ # $FreeBSD$ +# +# Use the PHP Extension and Application Repository +# +# Feature: pear +# Usage: USES=pear +# Valid ARGS: none +# +# MAINTAINER= portmgr@FreeBSD.org + +.if !defined(_INCLUDE_USES_PEAR_MK) +_INCLUDE_USES_PEAR_MK= yes +_USES_POST+= pear -# Common code for pear- ports. +.if defined(pear_ARGS) +IGNORE+= USES=pear takes not arguments +.endif MASTER_SITES?= http://pear.php.net/get/ \ http://us.pear.php.net/get/ \ http://de.pear.php.net/get/ -.if defined(PEAR_DIST_SUFX) -EXTRACT_SUFX= ${PEAR_DIST_SUFX} -.else -EXTRACT_SUFX= .tgz -.endif + +EXTRACT_SUFX?= .tgz DIST_SUBDIR?= PEAR +BUILD_DEPENDS+= pear:${PORTSDIR}/devel/pear RUN_DEPENDS+= pear:${PORTSDIR}/devel/pear -.if defined(PEAR_CATSRC) -PEARWRKSRC?= ${WRKSRC}/${CATEGORY} -.else -PEARWRKSRC?= ${WRKSRC} -.endif - .if !defined(USE_PHPIZE) NO_BUILD= yes .endif @@ -73,37 +79,9 @@ PLIST_SUB+= PEARDIR=${LPEARDIR} PKGREGDI PKGINSTALL?= ${PORTSDIR}/devel/pear/pear-install PKGDEINSTALL?= ${WRKDIR}/pear-deinstall -FILES?= -DATA?= -DOCS?= -EXAMPLES?= -SQLS?= -SCRIPTFILES?= -TESTS?= -_DATADIR?= data -_DOCSDIR?= docs -_EXAMPLESDIR?= examples -_SQLSDIR?= sql -_TESTSDIR?= tests - -# this is an easy way to eliminate duplicate entries in a variable :) -# if someone knows how to achieve the result without this terrible -# hack, please tell me! -.for v in FILES DOCS TESTS EXAMPLES SQLS SCRIPTFILES DATA -X${v}DIRS= ${${v}:M*/*:C;/[^/]+$;;} -. for XD in ${X${v}DIRS} -ALREADYTHERE= 0 -. for D in ${${v}DIRS} -DD= ${D} -. if ${DD} == ${XD} -ALREADYTHERE= 1 -. endif -. endfor -. if ${ALREADYTHERE} == 0 -${v}DIRS+= ${XD} -. endif -. endfor -.endfor +.endif +.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_PEAR_POST_MK) +_INCLUDE_USES_PEAR_POST_MK= yes pear-pre-install: .if exists(${LOCALBASE}/lib/php.DIST_PHP) \ @@ -132,51 +110,6 @@ DIRFILTER= ${SED} -En '\:^.*/[^/]*$$:s:^ ) | ${SORT} -ur .if !defined(USE_PHPIZE) -do-generate-plist: -. if !exists(${.CURDIR}/pkg-plist) - @${ECHO_MSG} "===> Generating packing list"; \ - (for file in ${FILES}; do echo "${LINSTDIR}/$${file}"; done; \ - for file in ${TESTS}; do echo "${LTESTSDIR}/$${file}"; done; \ - for file in ${DATA}; do echo "${LDATADIR}/$${file}"; done; \ - for file in ${SQLS}; do echo "${LSQLSDIR}/$${file}"; done; \ - for file in ${SCRIPTFILES}; do echo "${LSCRIPTSDIR}/$${file}"; done; \ - for file in ${DOCS}; do echo "%%PORTDOCS%%${LDOCSDIR}/$${file}"; done; \ - for file in ${EXAMPLES}; do echo "%%PORTDOCS%%${LEXAMPLESDIR}/$${file}"; done; \ - echo "${LPKGREGDIR}/package.xml"; \ - for d in ${FILES} ${FILES:H}; do echo $${d}; done | ${DIRFILTER} | \ - while read dir; do echo "@dirrmtry ${LINSTDIR}/$${dir}"; done; \ - for d in ${TESTS}; do echo $${d}; done | ${DIRFILTER} | \ - while read dir; do echo "@dirrm ${LTESTSDIR}/$${dir}"; done; \ - for d in ${DATA}; do echo $${d}; done | ${DIRFILTER} | \ - while read dir; do echo "@dirrm ${LDATADIR}/$${dir}"; done; \ - for d in ${SQLS}; do echo $${d}; done | ${DIRFILTER} | \ - while read dir; do echo "@dirrm ${LSQLSDIR}/$${dir}"; done; \ - for d in ${DOCS}; do echo $${d}; done | ${DIRFILTER} | \ - while read dir; do echo "%%PORTDOCS%%@dirrm ${LDOCSDIR}/$${dir}"; done; \ - for d in ${EXAMPLES}; do echo $${d}; done | ${DIRFILTER} | \ - while read dir; do echo "%%PORTDOCS%%@dirrm ${LEXAMPLESDIR}/$${dir}"; done; \ - if [ -n "${TESTS}" ]; then echo "@dirrm ${LTESTSDIR}"; fi; \ - if [ -n "${DATA}" ]; then echo "@dirrm ${LDATADIR}"; fi; \ - if [ -n "${SQLS}" ]; then echo "@dirrm ${LSQLSDIR}"; fi; \ - if [ -n "${DOCS}" ]; then echo "%%PORTDOCS%%@dirrm ${LDOCSDIR}"; fi; \ - if [ -n "${EXAMPLES}" ]; then echo "%%PORTDOCS%%@dirrm ${LEXAMPLESDIR}"; fi; \ - echo "@dirrm ${LPKGREGDIR}"; \ - if [ -n "${CATEGORY}" ]; then echo "@dirrmtry ${LINSTDIR}"; fi; \ - if [ -n "${CATEGORY:M*/*}" ]; then echo "@dirrmtry ${LINSTDIR:H}"; fi; \ - echo "@dirrmtry ${LPKGREGDIR:H}"; \ - echo "@dirrmtry ${LDOCSDIR:H}"; \ - echo "@dirrmtry ${LEXAMPLESDIR:H}"; \ - echo "@dirrmtry ${LTESTSDIR:H}"; \ - echo "@dirrmtry ${LDATADIR:H}"; \ - echo "@dirrmtry ${LSQLSDIR:H}") > ${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 - do-autogenerate-plist: patch @${ECHO_MSG} "===> Generating packing list with pear" @${LN} -sf ${WRKDIR}/package.xml ${WRKSRC}/package.xml @@ -193,115 +126,16 @@ do-autogenerate-plist: patch # pkg_install needs to escape $ in directory name while pkg does not @cd ${WRKDIR}/inst/${PREFIX} && ${FIND} . -type f | ${SORT} \ | ${CUT} -c 3- >> ${PLIST} - @cd ${WRKDIR}/inst/${PREFIX} && ${FIND} . -type d | ${SORT} -r | \ - ${CUT} -c 3- | \ - while read d ; do \ - if [ ! -d "${LOCALBASE}/$${d}" ]; then \ - ${ECHO_CMD} "@dirrmtry $${d}" >> ${PLIST}; \ - fi; \ - done - @${ECHO_CMD} "@dirrm ${LPKGREGDIR}" >> ${PLIST} - @${ECHO_CMD} "@dirrmtry ${LPKGREGDIR:H}" >> ${PLIST} -. if defined(PEAR_AUTOINSTALL) pre-install: pear-pre-install do-autogenerate-plist do-generate-deinstall-script do-install: do-auto-install pear-post-install -. else -pre-install: pear-pre-install do-generate-plist do-generate-deinstall-script -do-install: do-install-files do-install-docs do-install-tests do-install-sqls \ - do-install-scriptfiles do-install-examples do-install-data \ - pear-post-install -. endif - do-auto-install: - @${ECHO_MSG} "===> Installing package with pear" @cd ${WRKSRC} && ${PEAR} install -n -f -P ${STAGEDIR} package.xml # Clean up orphans re-generated by pear-install .for R in .channels .depdb .depdblock .filemap .lock .registry @${RM} -rf ${STAGEDIR}${PREFIX}/${LPEARDIR}/${R} .endfor - -do-install-files: do-install-files-msg - @${MKDIR} ${STAGEDIR}${INSTDIR} -. for dir in ${FILESDIRS} - @${MKDIR} ${STAGEDIR}${INSTDIR}/${dir} -. endfor -. for file in ${FILES} - @${INSTALL_DATA} ${PEARWRKSRC}/${file} ${STAGEDIR}${INSTDIR}/${file} -. endfor - -do-install-docs: do-install-docs-msg -. if !defined(NOPORTDOCS) && !empty(DOCS) - @${ECHO_MSG} "===> Installing documentation in ${DOCSDIR}." - @${MKDIR} ${STAGEDIR}${DOCSDIR} -. for dir in ${DOCSDIRS} - @${MKDIR} ${STAGEDIR}${DOCSDIR}/${dir} -. endfor -. for file in ${DOCS} - @${INSTALL_DATA} ${WRKSRC}/${_DOCSDIR}/${file} ${STAGEDIR}${DOCSDIR}/${file} -. endfor -. endif - -do-install-tests: do-install-tests-msg -. if !empty(TESTS) - @${ECHO_MSG} "===> Installing tests in ${TESTSDIR}." - @${MKDIR} ${STAGEDIR}${TESTSDIR} -. for dir in ${TESTSDIRS} - @${MKDIR} ${STAGEDIR}${TESTSDIR}/${dir} -. endfor -. for file in ${TESTS} - @${INSTALL_DATA} ${WRKSRC}/${_TESTSDIR}/${file} ${STAGEDIR}${TESTSDIR}/${file} -. endfor -. endif - -do-install-data: do-install-data-msg -. if !empty(DATA) - @${ECHO_MSG} "===> Installing data in ${DATADIR}." - @${MKDIR} ${STAGEDIR}${DATADIR} -. for dir in ${DATADIRS} - @${MKDIR} ${STAGEDIR}${DATADIR}/${dir} -. endfor -. for file in ${DATA} - @${INSTALL_DATA} ${WRKSRC}/${_DATADIR}/${file} ${STAGEDIR}${DATADIR}/${file} -. endfor -. endif - -do-install-sqls: do-install-sqls-msg -. if !empty(SQLS) - @${ECHO_MSG} "===> Installing sqls in ${SQLSDIR}." - @${MKDIR} ${STAGEDIR}${SQLSDIR} -. for dir in ${SQLSDIRS} - @${MKDIR} ${STAGEDIR}${SQLSDIR}/${dir} -. endfor -. for file in ${SQLS} - @${INSTALL_DATA} ${WRKSRC}/${_SQLSDIR}/${file} ${STAGEDIR}${SQLSDIR}/${file} -. endfor -. endif - -do-install-scriptfiles: do-install-scriptfiles-msg -. if !empty(SCRIPTFILES) - @${ECHO_MSG} "===> Installing scripts in ${SCRIPTFILESDIR}." -. 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} ${STAGEDIR}${SCRIPTFILESDIR}/${file} -. endfor -. endif - -do-install-examples: do-install-examples-msg -. if !defined(NOPORTDOCS) && !empty(EXAMPLES) - @${ECHO_MSG} "===> Installing examples in ${EXAMPLESDIR}." - @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} -. for dir in ${EXAMPLESDIRS} - @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/${dir} -. endfor -. for file in ${EXAMPLES} - @${INSTALL_DATA} ${WRKSRC}/${_EXAMPLESDIR}/${file} ${STAGEDIR}${EXAMPLESDIR}/${file} -. endfor -. endif .endif do-generate-deinstall-script: @@ -313,3 +147,5 @@ pear-post-install: show-depends: patch @${PEAR} package-dependencies ${WRKDIR}/package.xml + +.endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409231347.s8NDlr0d094927>