From baptiste.daroussin@gmail.com Fri Apr 17 15:44:01 2009 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01EC81065679 for ; Fri, 17 Apr 2009 15:44:01 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-fx0-f167.google.com (mail-fx0-f167.google.com [209.85.220.167]) by mx1.freebsd.org (Postfix) with ESMTP id 02AA58FC18 for ; Fri, 17 Apr 2009 15:43:59 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by fxm11 with SMTP id 11so971885fxm.43 for ; Fri, 17 Apr 2009 08:43:58 -0700 (PDT) Received: by 10.204.76.129 with SMTP id c1mr2439972bkk.9.1239983038702; Fri, 17 Apr 2009 08:43:58 -0700 (PDT) Received: from wicklow.lan (stc92-3-82-245-249-89.fbx.proxad.net [82.245.249.89]) by mx.google.com with ESMTPS id h2sm3548850fkh.9.2009.04.17.08.43.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Apr 2009 08:43:58 -0700 (PDT) Received: by wicklow.lan (Postfix, from userid 1002) id 5AD32F1920; Fri, 17 Apr 2009 17:43:56 +0200 (CEST) Message-Id: <20090417154355.GH79989@wicklow.lan> Date: Fri, 17 Apr 2009 17:43:56 +0200 From: Baptiste Daroussin To: bug-followup@FreeBSD.org Subject: Re: [PATCH] implements fakeroot for the ports >Number: 133816 >Category: ports >Synopsis: Re: [PATCH] implements fakeroot for the ports >Confidential: no >Severity: serious >Priority: medium >Responsible: portmgr >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 17 15:50:01 UTC 2009 >Closed-Date: Fri Apr 17 23:22:46 UTC 2009 >Last-Modified: Fri Apr 17 23:22:46 UTC 2009 >Originator: >Release: >Organization: >Environment: >Description: Sorry for the noise, here is the good patch: --- Mk-fake.patch begins here --- diff -Naur Mk.orig/bsd.fake.mk Mk/bsd.fake.mk --- Mk.orig/bsd.fake.mk 1970-01-01 01:00:00.000000000 +0100 +++ Mk/bsd.fake.mk 2009-04-17 17:57:29.000000000 +0200 @@ -0,0 +1,138 @@ +# +# $MidnightBSD: mports/Mk/components/fake.mk,v 1.5 2009/03/30 14:27:11 laffer1 Exp $ +# +# fake.mk -- This file contains all the code for the 'fake' target. +# + +################ +# +# Fake Setup +# +# Tmp dir used for building a package. +FAKE_INSTALLDIR?= fakeroot +FAKE_TARGET?= ${INSTALL_TARGET} +DESTDIRNAME?= DESTDIR +FAKE_DESTDIR?= ${WRKDIR}/${FAKE_INSTALLDIR} +FAKE_MAKEARGS?= ${MAKE_ARGS} ${DESTDIRNAME}=${FAKE_DESTDIR} + +FAKE_SETUP= TRUE_PREFIX=${TRUE_PREFIX} PREFIX=${FAKE_DESTDIR}${TRUE_PREFIX} \ + MANPREFIX=${FAKE_DESTDIR}${MANPREFIX:S/^${FAKE_DESTDIR}//} \ + LINUXBASE=${FAKE_DESTDIR}${LINUXBASE:S/^${FAKE_DESTDIR}//} \ + HOME=/${PKGBASE}_installs_to_home \ + KMODDIR=${FAKE_DESTDIR}${KMODDIR:S/^${FAKE_DESTDIR}//} + + +.if defined(FAKE_OPTS) +.if ${FAKE_OPTS:Mtrueprefix}x != "x" +# do this to FAKE_MAKEARGS so that post-install,pre-install still get a twiddled ${PREFIX} +FAKE_MAKEARGS+= PREFIX=${TRUE_PREFIX} MANPREFIX=${MANPREFIX} DOCSDIR=${DOCSDIR} KMODDIR=${KMODDIR} +.endif +.if ${FAKE_OPTS:Mlibs}x != "x" +FAKE_SETUP+= LD_LIBRARY_PATH=${FAKE_DESTDIR}${PREFIX}/lib +.endif +.if ${FAKE_OPTS:Mbin}x != "x" +FAKE_SETUP+= PATH=${PATH}:${FAKE_DESTDIR}${PREFIX}/bin:${FAKE_DESTDIR}${PREFIX}/sbin +.endif +.if ${FAKE_OPTS:Mprefixhack}x != "x" +FAKE_MAKEARGS+= prefix=${FAKE_DESTDIR}${TRUE_PREFIX} infodir=${FAKE_DESTDIR}${TRUE_PREFIX}/${INFO_PATH} +FAKE_MAKEARGS+= mandir=${FAKE_DESTDIR}${MANPREFIX}/man MANDIR=${FAKE_DESTDIR}${MANPREFIX}/man +.endif +.endif + +FAKE_MAKEARGS+= ${EXTRA_FAKE_MAKEARGS} + +.if !target(fake-dir) +fake-dir: + @${INSTALL} -d -m 755 -o root -g wheel ${FAKE_DESTDIR}${PREFIX} +.if !defined(NO_MTREE) + @${MTREE_CMD} ${MTREE_ARGS} ${FAKE_DESTDIR}${PREFIX} >/dev/null +#TODO don't whey make consider this as malformed +#.if ${MTREE_FILE} == "/etc/mtree/BSD.local.dist" +# @cd ${FAKE_DESTDIR}${PREFIX}/share/nls; \ +# ${LN} -shf C POSIX; \ +# ${LN} -shf C en_US.US-ASCII; +#.endif +.if defined(USE_LINUX) && ${PREFIX} != ${LINUXBASE_REL} + @${INSTALL} -d -m 755 -o root -g wheel ${FAKE_DESTDIR}${LINUXBASE_REL} + @${MTREE_CMD} ${MTREE_LINUX_ARGS} ${FAKE_DESTDIR}${LINUXBASE_REL} > /dev/null +.endif +.endif +.endif + + +.if !target(fake-pre-install) +fake-pre-install: +.if !target(pre-install) + @cd ${.CURDIR} && exec ${MAKE} pre-install ${FAKE_SETUP} +.endif +.endif + + +.if !target(fake-pre-su-install) +fake-pre-su-install: +.if !target(pre-su-install) + @cd ${.CURDIR} && exec ${MAKE} pre-su-install ${FAKE_SETUP} +.endif +.endif + + +.if !target(do-fake) +do-fake: +.if target(do-install) + @cd ${.CURDIR} && exec ${MAKE} do-install ${FAKE_SETUP} +.else + @cd ${.CURDIR} && exec ${MAKE} run-fake +.endif +.endif + +.if !target(fake-post-install) +fake-post-install: +.if !target(post-install) + @cd ${.CURDIR} && exec ${MAKE} post-install ${FAKE_SETUP} +.endif +.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) +fix-fake-symlinks: + -@cd ${FAKE_DESTDIR}${PREFIX}; \ + links=`${FIND} . -type l | ${GREP} -v -e 'share/nls/POSIX\|share/nls/en_US.US-ASCII'`; \ + for link in $$links; do \ + if ! readlink $$link | grep ${FAKE_DESTDIR} >/dev/null; then \ + continue; \ + fi; \ + source=`readlink $$link | ${SED} -e 's|${FAKE_DESTDIR}||'`; \ + ${RM} $$link; \ + ${LN} -s $$source $$link; \ + done +.if defined(USE_LINUX) && ${PREFIX} != ${LINUXBASE_REL} + @cd ${.CURDIR} && ${MAKE} PREFIX=${LINUXBASE_REL} ${.TARGET} +.endif +.endif + + + + +# +# check-fake +# +_CHKFAKE_ARGS= -f ${TMPPLIST} -d ${FAKE_DESTDIR} -p ${PREFIX} +.if defined(SKIP_FAKE_CHECK) +_CHKFAKE_ARGS+= -s "${SKIP_FAKE_CHECK}" +.endif + +.if !target(check-fake) +check-fake: +# /usr/mports/Tools/scripts/chkfake.pl ${_CHKFAKE_ARGS} + @${MPORT_CHECK_FAKE} ${_CHKFAKE_ARGS} +.endif 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 --- >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Fri Apr 17 23:22:11 UTC 2009 State-Changed-Why: Misfiled followup to ports/133815; content migrated. Responsible-Changed-From-To: gnats-admin->portmgr Responsible-Changed-By: linimon Responsible-Changed-When: Fri Apr 17 23:22:11 UTC 2009 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=133816 >Unformatted: