Open discution for a fakeroot support for the ports infrastructure

Peter Pentchev roam at
Tue Sep 1 08:02:43 UTC 2009

On Mon, Aug 31, 2009 at 11:26:43PM +0200, Baptiste Daroussin wrote:
> Hi,
> I've written some patches for the ports infrastructure importing the
> fakeroot implementation from midnightbsd ports.

That's actually a good idea.  I'm quite used to fakeroot already from
some work I've been doing in Debian.

> In my first implementation the fake directory was enabled by default, no
> ports had to be modified to support it.
> My second implementation added a knob to add to make.conf (USE_FAKE) to
> enable it for people wanting it and want to tested. still no ports to be
> modified (except perhaps some buggy one)
> Now the patches are quite old (they won't apply cleanly) so I'm on updating
> it again.
> Before rewriting it, I think it is a better idea to first discuss about it,
> to improve it, see if there are interests, etc.
> So basically here is what is done and how it works.
> the changes are only in the infrastructure not in ports themselves (except
> that some will be able to benefit some cleanup)
> do-fake (with post and pre) replaces do-install (pre/post) it creates a
> $WRKSRC/fakeroot where the binaries are copied by the ports (during  the
> do-install of the port)
> then do-package create a package using pkg-plist (or the generated one)
> using the binary in fakeroot.
> do-install (ie make install) now only does a pkg_add of the created pkg.

Just one comment: there are some ports, and not quite so few, either,
which override the do-install target to do some maintenance of their own.
A trivial run of

  find . -mindepth 3 -maxdepth 3 -name Makefile -type f -print0 | 
      xargs -0 fgrep do-install

...from /usr/ports gives just about 6000 results here, and most of them are,
indeed, real cases of port Makefiles doing the install thing for themselves.
This is done either for very, very simple programs where it would be
unnecessary overhead to recurse into the upstream's Makefile and run
its "install" target, or for programs where the upstream doesn't even
*have* an "install" target, or for programs where there is, quite simply,
no upstream - like devel/portilnt :)

So the fakeroot implementation should take that into account, too -
and that could be a problem, since most of the do-install targets
actually do install their files directly into ${PREFIX}.

This could actually be easier if DESTDIR were implemented first :)

> What is the interest of that :
> the installed files will now always respects the pkg-plist which simplify
> the QA work.
> the developpers will have to focus on the pkg-plist to choose which file
> will be installed according to the desired KNOBS/OPTIONS : no more ugly hack
> to respect NOPORTDOCS and NOPORTDATA for example.
> certainly a lot more that i don't see now.
> what could be seen in the future is an equivalent of the update-plist target
> of openbsd ports infrastructure.
> it will easier implementation of multipackage ports (if ever wanted :)), one
> port with multiple pkg-plist.
> the discussion is open :)
> here is the PR concerned :


Peter Pentchev	roam at    roam at    roam at
PGP key:
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This inert sentence is my body, but my soul is alive, dancing in the sparks of your brain.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list