Date: Fri, 17 Apr 2009 17:29:34 +0200 (CEST) From: Bapt <baptiste.daroussin@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/133815: [PATCH] implements fakeroot for the ports Message-ID: <20090417152934.E8669F1920@wicklow.lan> Resent-Message-ID: <200904171530.n3HFU19m029296@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 133815 >Category: ports >Synopsis: [PATCH] implements fakeroot for the ports >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Fri Apr 17 15:30:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Bapt >Release: FreeBSD 8.0-CURRENT i386 >Organization: >Environment: System: FreeBSD wicklow.lan 8.0-CURRENT FreeBSD 8.0-CURRENT #9: Thu Mar 26 08:18:05 CET 2009 root@wicklow.lan:/usr/obj/usr/src/sys/WICKLOW i386 >Description: I imported and modified a bit the fakeroot implementation from MidnightBSD mports for now, it works with DESTDIR, with most of the ports out of box, the only one I found that require a modification is lang/php5 which need DESTDIRNAME= INSTALL_ROOT in the Makefile it first create a package with the content of the fakeroot following the pkg-plist (using pkg_create) and than install the package. It needs some more cleanup and it needs some reviewing from people that have a better understanding of the whole Mk files and process than I do. >How-To-Repeat: >Fix: --- Mk-fake.patch begins here --- diff -Naur Mk.orig/bsd.fake.mk Mk/bsd.fake.mk --- Mk.orig/bsd.fake.mk 2009-04-17 15:03:39.000000000 +0200 +++ Mk/bsd.fake.mk 2009-04-17 17:57:29.000000000 +0200 @@ -71,7 +71,6 @@ .if !target(fake-pre-su-install) fake-pre-su-install: .if !target(pre-su-install) - @${ECHO_MSG} "===> WARNING: pre-su-install is deprecated.Use pre-install instead." @cd ${.CURDIR} && exec ${MAKE} pre-su-install ${FAKE_SETUP} .endif .endif @@ -79,7 +78,7 @@ .if !target(do-fake) do-fake: -.if !target(do-install) +.if target(do-install) @cd ${.CURDIR} && exec ${MAKE} do-install ${FAKE_SETUP} .else @cd ${.CURDIR} && exec ${MAKE} run-fake @@ -94,13 +93,14 @@ .endif -run-fake: - @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\ - ${MAKE} -f ${MAKEFILE} ${FAKE_MAKEARGS} ${FAKE_TARGET}; -.if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) - @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\ - ${MAKE} -f ${MAKEFILE} ${FAKE_MAKEARGS} install.man -.endif +#run-fake: +# @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\ +# ${MAKE} -f ${MAKEFILE} ${FAKE_MAKEARGS} ${FAKE_TARGET}; +#.if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) +# @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\ +# ${MAKE} -f ${MAKEFILE} ${FAKE_MAKEARGS} install.man +#.endif + .if !target(fix-fake-symlinks) diff -Naur Mk.orig/bsd.gecko.mk Mk/bsd.gecko.mk --- Mk.orig/bsd.gecko.mk 2009-04-13 03:38:03.000000000 +0200 +++ Mk/bsd.gecko.mk 2009-04-17 17:56:34.000000000 +0200 @@ -565,7 +565,7 @@ .if !defined(NOGECKO_PLIST) @${RM} -rf ${FAKEDIR} ${PLIST} ${PLISTD} ${PLISTF} @${TOUCH} -f ${PLIST} ${PLISTD} ${PLISTF} - @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} \ + @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP} ${GMAKE} ${FAKE_MAKEARGS} \ ${MAKEFILE} ${MAKE_ARGS} prefix=${FAKEDIR} ${INSTALL_TARGET} .if defined(MOZILLA_SUFX) && ${MOZILLA_SUFX}!="none" ${MV} ${FAKEDIR}/bin/${MOZILLA:S/${MOZILLA_SUFX}//} ${FAKEDIR}/bin/${MOZILLA} diff -Naur Mk.orig/bsd.gnustep.mk Mk/bsd.gnustep.mk --- Mk.orig/bsd.gnustep.mk 2009-03-20 10:14:26.000000000 +0100 +++ Mk/bsd.gnustep.mk 2009-04-17 17:56:34.000000000 +0200 @@ -531,11 +531,11 @@ .if defined(USE_GNUSTEP_MAKE_DIRS) .for i in ${USE_GNUSTEP_MAKE_DIRS} @(cd ${INSTALL_WRKSRC}/${i}; . ${GNUSTEP_MAKEFILES}/GNUstep.sh; \ - ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET}) + ${SETENV} ${MAKE_ENV} ${GMAKE} ${FAKE_MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET}) .endfor .else @(cd ${INSTALL_WRKSRC}; . ${GNUSTEP_MAKEFILES}/GNUstep.sh; \ - ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET}) + ${SETENV} ${MAKE_ENV} ${FAKE_SETUP} ${GMAKE} ${FAKE_MAKEARGS} ${MAKEFILE} ${INSTALL_TARGET}) .endif .if defined(PACKAGE_BUILDING) || defined(BATCH) || defined(CLEAN_ROOT) rm -rf /root/GNUstep diff -Naur Mk.orig/bsd.perl.mk Mk/bsd.perl.mk --- Mk.orig/bsd.perl.mk 2009-03-28 21:45:06.000000000 +0100 +++ Mk/bsd.perl.mk 2009-04-17 17:56:34.000000000 +0200 @@ -263,7 +263,7 @@ .if !defined(USE_GMAKE) .if !target(do-install) do-install: - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${FAKE_SETUP} ${PERL5} ${PL_BUILD} ${FAKE_MAKEARGS} ${INSTALL_TARGET}) .endif # !target(do-install) .endif # !defined(USE_GMAKE) .endif # defined(PERL_MODBUILD) diff -Naur Mk.orig/bsd.php.mk Mk/bsd.php.mk --- Mk.orig/bsd.php.mk 2009-03-06 11:08:32.000000000 +0100 +++ Mk/bsd.php.mk 2009-04-17 17:56:34.000000000 +0200 @@ -34,7 +34,6 @@ .if !defined(_PHPMKINCLUDED) PHP_Include_MAINTAINER= ale@FreeBSD.org - _PHPMKINCLUDED= yes PHPBASE?= ${LOCALBASE} @@ -191,10 +190,10 @@ >> ${TMPPLIST} @${ECHO_CMD} "@unexec rmdir %D/lib/php/${PHP_EXT_DIR} 2> /dev/null || true" \ >> ${TMPPLIST} - @${FIND} -P ${PREFIX}/include/php/ext/${PHP_MODNAME} ! -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST} - @${FIND} -P -d ${PREFIX}/include/php/ext/${PHP_MODNAME} -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} + @${FIND} -P ${FAKE_DESTDIR}${PREFIX}/include/php/ext/${PHP_MODNAME} ! -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,,p' >> ${TMPPLIST} + @${FIND} -P -d ${FAKE_DESTDIR}${PREFIX}/include/php/ext/${PHP_MODNAME} -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@exec echo \#include \\\"ext/${PHP_MODNAME}/config.h\\\" >> %D/include/php/ext/php_config.h" \ >> ${TMPPLIST} @${ECHO_CMD} "@unexec cp %D/include/php/ext/php_config.h %D/include/php/ext/php_config.h.orig" \ diff -Naur Mk.orig/bsd.port.mk Mk/bsd.port.mk --- Mk.orig/bsd.port.mk 2009-04-10 00:40:20.000000000 +0200 +++ Mk/bsd.port.mk 2009-04-17 17:56:34.000000000 +0200 @@ -1423,6 +1423,10 @@ LDCONFIG_PLIST_UNEXEC_CMD?= ${LDCONFIG} -R .endif +# Fake targets override this when they submake. +TRUE_PREFIX?= ${PREFIX} + + PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg # XXX to remain undefined until all ports that require Perl are fixed @@ -1565,6 +1569,9 @@ .include "${PORTSDIR}/Mk/bsd.kde4.mk" .endif +# include bsd.fake.mk +.include "${PORTSDIR}/Mk/bsd.fake.mk" + # You can force skipping these test by defining IGNORE_PATH_CHECKS .if !defined(IGNORE_PATH_CHECKS) .if (${PREFIX:C,(^.).*,\1,} != "/") @@ -2145,6 +2152,9 @@ BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g} PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g} PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g} +FAKE_COOKIE?= ${WRKDIR}/.fake_done.${PORTNAME}.${PREFIX:S/\//_/g} + + # How to do nothing. Override if you, for some strange reason, would rather # do something. @@ -2346,6 +2356,8 @@ ${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' -- .endif +#TODO Check the import the bsd.mport.mlk line 1057 +#TODO Check the removal of the following # The user can override the NO_PACKAGE by specifying this from # the make command line .if defined(FORCE_PACKAGE) @@ -2384,7 +2396,8 @@ .endif .if !defined(PKG_ARGS) -PKG_ARGS= -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} actual-package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u -t : -k 2`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS} +PKG_ARGS= -v -S ${FAKE_DESTDIR} -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} actual-package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u -t : -k 2`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS} + .if !defined(NO_MTREE) PKG_ARGS+= -m ${MTREE_FILE} .endif @@ -2976,6 +2989,10 @@ .endif .endfor +.for ___link in ${_MLINKS} +_FAKE_MLINKS += ${FAKE_DESTDIR}${___link} +.endfor + # XXX 20040119 This next line should read: # .for manlang in ${MANLANG:S%^%man/%:S%^man/""$%man%} # but there is currently a bug in make(1) that prevents the double-quote @@ -3027,6 +3044,10 @@ .endif +.for m in ${_MANPAGES} +_FAKEMAN += ${FAKE_DESTDIR}${m} +.endfor + .if ${PREFIX} == /usr INFO_PATH?= share/info .else @@ -3172,7 +3193,7 @@ IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}.;exit 1 .endif -.for target in check-sanity fetch checksum extract patch configure all build install reinstall package +.for target in check-sanity fetch checksum extract patch configure all build fake install reinstall package .if !target(${target}) ${target}: @${IGNORECMD} @@ -3292,7 +3313,7 @@ # Disable install .if defined(NO_INSTALL) && !target(install) -install: build +fake: build @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE} .endif @@ -3734,17 +3755,17 @@ # Install -.if !target(do-install) -do-install: +.if !target(run-fake) +run-fake: .if defined(USE_GMAKE) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_SETUP} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${FAKE_MAKEARGS} ${FAKE_TARGET}) .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_SETUP}${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${FAKE_MAKEARGS} install.man) .endif .else # !defined(USE_GMAKE) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_SETUP} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${FAKE_MAKEARGS} ${FAKE_TARGET}) .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_SETUP} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${FAKE_MAKEARGS} install.man) .endif .endif .endif @@ -3839,6 +3860,15 @@ @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})" .endif +# +# This is the real install. +# +.if !target(install-package) +install-package: + @${PKG_ADD} ${PKGFILE} +.endif + + # Utility targets follow .if !target(check-already-installed) @@ -4174,20 +4204,34 @@ _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 -_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 \ - add-plist-docs add-plist-examples add-plist-data \ - add-plist-post install-rc-script compress-man \ - install-ldconfig-file fake-pkg security-check -_PACKAGE_DEP= install +_FAKE_DEP= build +_FAKE_SEQ= fake-message fake-dir apply-slist fake-pre-install \ + generate-plist fake-pre-su-install do-fake fake-post-install \ + post-fake compress-man install-rc-script install-ldconfig-file install-desktop-entries \ + fix-fake-symlinks add-plist-info add-plist-docs add-plist-examples \ + add-plist-data add-plist-post + +_PACKAGE_DEP= fake _PACKAGE_SEQ= package-message pre-package pre-package-script \ - do-package post-package-script + do-package post-package post-package-script + +_INSTALL_DEP= package +_INSTALL_SEQ= install-message run-depends lib-depends install-package done-message +#_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 +#_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 \ +# add-plist-docs add-plist-examples add-plist-data \ +# add-plist-post install-rc-script compress-man \ +# install-ldconfig-file fake-pkg security-check +#_PACKAGE_DEP= install +#_PACKAGE_SEQ= package-message pre-package pre-package-script \ +# do-package post-package-script +#ENDTODO .if !target(post-chroot) post-chroot: @${DO_NADA} @@ -4205,7 +4249,7 @@ # Main logic. The loop generates 6 main targets and using cookies # ensures that those already completed are skipped. -.for target in extract patch configure build install package +.for target in extract patch configure build fake package install .if !target(${target}) && defined(_OPTIONS_OK) ${target}: ${${target:U}_COOKIE} @@ -4258,8 +4302,10 @@ .ORDER: ${_PATCH_DEP} ${_PATCH_SEQ} .ORDER: ${_CONFIGURE_DEP} ${_CONFIGURE_SEQ} .ORDER: ${_BUILD_DEP} ${_BUILD_SEQ} -.ORDER: ${_INSTALL_DEP} ${_INSTALL_SEQ} +.ORDER: ${_FAKE_DEP} ${_FAKE_SEQ} .ORDER: ${_PACKAGE_DEP} ${_PACKAGE_SEQ} +.ORDER: ${_INSTALL_DEP} ${_INSTALL_SEQ} +.ORDER: ${_UPDATE_DEP} ${_UPDATE_SEQ} extract-message: @${ECHO_MSG} "===> Extracting for ${PKGNAME}" @@ -4269,15 +4315,19 @@ @${ECHO_MSG} "===> Configuring for ${PKGNAME}" build-message: @${ECHO_MSG} "===> Building for ${PKGNAME}" +fake-message: + @${ECHO_MSG} "===> Faking install for ${PKGNAME}" install-message: @${ECHO_MSG} "===> Installing for ${PKGNAME}" package-message: @${ECHO_MSG} "===> Building package for ${PKGNAME}" +done-message: + @${ECHO_MSG} "===> Done." # Empty pre-* and post-* targets .for stage in pre post -.for name in check-sanity fetch extract patch configure build install package +.for name in check-sanity fetch extract patch configure build fake install package .if !target(${stage}-${name}) ${stage}-${name}: @@ -4340,6 +4390,13 @@ @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} install .endif +.if !target(refake) +refake: + ${RM} -rf ${FAKE_DESTDIR} ${FAKE_COOKIE} ${PACKAGE_COOKIE} + @cd ${.CURDIR} && ${MAKE} fake +.endif + + # Deinstall # # Special target to remove installation @@ -5649,14 +5706,14 @@ fi .for x in ${PORTDOCS} @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \ - if [ ! -e ${DOCSDIR}/${x} ]; then \ + if [ ! -e ${FAKE_DESTDIR}${DOCSDIR}/${x} ]; then \ ${ECHO_CMD} ${DOCSDIR_REL}/${x} >> ${TMPPLIST}; \ fi;fi .endfor - @${FIND} -P ${PORTDOCS:S/^/${DOCSDIR}\//} ! -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST} - @${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} + @${FIND} -P ${FAKE_DESTDIR}${PORTDOCS:S/^/${DOCSDIR}\//} ! -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,,p' >> ${TMPPLIST} + @${FIND} -P -d ${FAKE_DESTDIR}${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@dirrm ${DOCSDIR_REL}" >> ${TMPPLIST} .else @${DO_NADA} @@ -5672,15 +5729,15 @@ fi .for x in ${PORTEXAMPLES} @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \ - if [ ! -e ${EXAMPLESDIR}/${x} ]; then \ + if [ ! -e ${FAKE_DESTDIR}${EXAMPLESDIR}/${x} ]; then \ ${ECHO_CMD} ${EXAMPLESDIR}/${x} | \ - ${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \ + ${SED} -e 's,^${FAKE_DESTDIR}${PREFIX}/,,' >> ${TMPPLIST}; \ fi;fi .endfor - @${FIND} -P ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} ! -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST} - @${FIND} -P -d ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} + @${FIND} -P ${FAKE_DESTDIR}${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} ! -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,,p' >> ${TMPPLIST} + @${FIND} -P -d ${FAKE_DESTDIR}${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@dirrm ${EXAMPLESDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST} .else @${DO_NADA} @@ -5696,15 +5753,15 @@ fi .for x in ${PORTDATA} @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \ - if [ ! -e ${DATADIR}/${x} ]; then \ + if [ ! -e ${FAKE_DESTDIR}${DATADIR}/${x} ]; then \ ${ECHO_CMD} ${DATADIR}/${x} | \ - ${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \ + ${SED} -e 's,^${FAKE_DESTDIR}${PREFIX}/,,' >> ${TMPPLIST}; \ fi;fi .endfor - @${FIND} -P ${PORTDATA:S/^/${DATADIR}\//} ! -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST} - @${FIND} -P -d ${PORTDATA:S/^/${DATADIR}\//} -type d 2>/dev/null | \ - ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} + @${FIND} -P ${FAKE_DESTDIR}${PORTDATA:S/^/${DATADIR}\//} ! -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,,p' >> ${TMPPLIST} + @${FIND} -P -d ${FAKE_DESTDIR}${PORTDATA:S/^/${DATADIR}\//} -type d 2>/dev/null | \ + ${SED} -ne 's,^${FAKE_DESTDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@dirrm ${DATADIR:S,^${PREFIX}/,,}" >> ${TMPPLIST} .else @${DO_NADA} @@ -5716,10 +5773,11 @@ # Process GNU INFO files at package install/deinstall time .if defined(INFO) .for i in ${INFO} - install-info --quiet ${PREFIX}/${INFO_PATH}/$i.info ${PREFIX}/${INFO_PATH}/dir +#Unneeded as the real installation is done by pkg_add +#install-info --quiet ${PREFIX}/${INFO_PATH}/$i.info ${PREFIX}/${INFO_PATH}/dir @${ECHO_CMD} "@unexec install-info --quiet --delete %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \ >> ${TMPPLIST} - @${LS} ${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${PREFIX}/::g >> ${TMPPLIST} + @${LS} ${FAKE_DESTDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${FAKE_DESTDIR}${PREFIX}/::g >> ${TMPPLIST} @${ECHO_CMD} "@exec install-info --quiet %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \ >> ${TMPPLIST} .endfor @@ -5752,8 +5810,9 @@ .if defined(USE_RCORDER) @${ECHO_MSG} "===> Installing early rc.d startup script(s)" @${ECHO_CMD} "@cwd /" >> ${TMPPLIST} + ${INSTALL} -d ${FAKE_DESTDIR}/etc/rc.d @for i in ${USE_RCORDER}; do \ - ${INSTALL_SCRIPT} ${WRKDIR}/$${i} /etc/rc.d/$${i%.sh}; \ + ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${FAKE_DESTDIR}/etc/rc.d/$${i%.sh}; \ ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \ done @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST} @@ -5762,7 +5821,7 @@ @${ECHO_MSG} "===> Installing rc.d startup script(s)" @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST} @for i in ${USE_RC_SUBR}; do \ - ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}${RC_SUBR_SUFFIX}; \ + ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${FAKE_DESTDIR}${PREFIX}/etc/rc.d/$${i%.sh}${RC_SUBR_SUFFIX}; \ ${ECHO_CMD} "etc/rc.d/$${i%.sh}${RC_SUBR_SUFFIX}" >> ${TMPPLIST}; \ done .endif @@ -5774,16 +5833,16 @@ # Compress (or uncompress) and symlink manpages. .if !target(compress-man) compress-man: -.if defined(_MANPAGES) || defined(_MLINKS) +.if defined(_FAKEMAN) || defined(_MLINKS) .if ${MANCOMPRESSED} == yes && defined(NOMANCOMPRESS) @${ECHO_MSG} "===> Uncompressing manual pages for ${PKGNAME}" - @_manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GUNZIP_CMD} $${_manpages} ) || ${TRUE} + @_manpages='${_FAKEMAN:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GUNZIP_CMD} $${_manpages} ) || ${TRUE} .elif ${MANCOMPRESSED} == no && !defined(NOMANCOMPRESS) @${ECHO_MSG} "===> Compressing manual pages for ${PKGNAME}" - @_manpages='${_MANPAGES:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GZIP_CMD} $${_manpages} ) || ${TRUE} + @_manpages='${_FAKEMAN:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GZIP_CMD} $${_manpages} ) || ${TRUE} .endif .if defined(_MLINKS) - @set -- ${_MLINKS}; \ + @set -- ${_FAKE_MLINKS}; \ while :; do \ [ $$# -eq 0 ] && break || ${TRUE}; \ ${RM} -f $${2%.gz}; ${RM} -f $$2.gz; \ @@ -5803,7 +5862,6 @@ # Fake installation of package so that user can pkg_delete it later. # Also, make sure that an installed port is recognized correctly in # accordance to the @pkgdep directive in the packing lists - .if !target(fake-pkg) fake-pkg: .if !defined(NO_PKG_REGISTER) @@ -6214,15 +6272,15 @@ .if !target(install-desktop-entries) install-desktop-entries: .if defined(DESKTOP_ENTRIES) - @(${MKDIR} "${DESKTOPDIR}" 2> /dev/null) || \ - (${ECHO_MSG} "===> Cannot create ${DESKTOPDIR}, check permissions"; exit 1) + @(${MKDIR} "${FAKE_DESTDIR}${DESKTOPDIR}" 2> /dev/null) || \ + (${ECHO_MSG} "===> Cannot create ${FAKE_DESTDIR}${DESKTOPDIR}, check permissions"; exit 1) @set -- ${DESKTOP_ENTRIES} XXX; \ if [ -z "${_DESKTOPDIR_REL}" ]; then \ ${ECHO_CMD} "@cwd ${DESKTOPDIR}" >> ${TMPPLIST}; \ fi; \ while [ $$# -gt 6 ]; do \ filename="$$4.desktop"; \ - pathname="${DESKTOPDIR}/$$filename"; \ + pathname="${FAKE_DESTDIR}${DESKTOPDIR}/$$filename"; \ categories="$$5"; \ if [ -z "$$categories" ]; then \ categories="`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} desktop-categories`"; \ diff -Naur Mk.orig/bsd.python.mk Mk/bsd.python.mk --- Mk.orig/bsd.python.mk 2009-03-24 10:30:21.000000000 +0100 +++ Mk/bsd.python.mk 2009-04-17 17:56:34.000000000 +0200 @@ -503,7 +503,8 @@ PYSETUP?= setup.py PYDISTUTILS_CONFIGUREARGS?= PYDISTUTILS_BUILDARGS?= -PYDISTUTILS_INSTALLARGS?= -c -O1 --prefix=${PREFIX} +#PYDISTUTILS_INSTALLARGS?= -c -O1 --prefix=${PREFIX} +PYDISTUTILS_INSTALLARGS?= -c -O1 --prefix=${TRUE_PREFIX} --root=${FAKE_DESTDIR} PYDISTUTILS_PKGNAME?= ${PORTNAME} PYDISTUTILS_PKGVERSION?=${PORTVERSION} PYDISTUTILS_EGGINFO?= ${PYDISTUTILS_PKGNAME:C/[^A-Za-z0-9.]+/_/g}-${PYDISTUTILS_PKGVERSION:C/[^A-Za-z0-9.]+/_/g}-${PYTHON_VERSION:S/thon//}.egg-info @@ -715,8 +716,8 @@ @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP} ${PYDISTUTILS_BUILD_TARGET} ${PYDISTUTILS_BUILDARGS}) .endif -.if !target(do-install) -do-install: +.if !target(run-fake) +run-fake: @(cd ${INSTALL_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP} ${PYDISTUTILS_INSTALL_TARGET} ${PYDISTUTILS_INSTALLARGS}) .endif --- Mk-fake.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?20090417152934.E8669F1920>