Recording multiple package installs...

Matthew Seaman m.seaman at
Tue Sep 7 11:54:51 PDT 2004

On Tue, Sep 07, 2004 at 01:55:16PM -0400, Paul Chvostek wrote:
> I'm building a port for a PHP-based application that (like www/gallery
> and so many others) could potentially be installed in multiple locations
> on one server.  I'll aim this email at users familiar with that port.
> I never use the www/gallery port, because in its current incarnation, a
> second tries to record the package install to the same place as the
> first.  I'm either forced to FORCE_PKG_INSTALL, b0rking my package db,
> or skip the package altogether.  It just ain't right.
> It would seem that ports like www/gallery (and databases/phpmyadmin and
> others) could do with some way to idenfify the different installs that
> might occur on the same host.  So ... where to record that?

I don't think anyone has yet considered modifying the ports system to
handle multiple installations of the same package -- possibly because
the original thought was that ports would install binaries into a set
of directories that everyone could share.  Adding the machinery to be
able to cope with multiple instances of web content or other ports
that could conceivably act the same way is going to require some
serious re-working of the ports infrastructure.

However, I'm asking myself in what circumstances you'ld want to do
this?  Certainly with www/gallery that would perhaps be in order to
support individual local users?  In which case, you can let each user
have their own private package database.  Setting the following
environment variables will enable individual users to install most
packages and ports without needing super-user privileges and without
interfering with other users' locally installed ports/packages:

    setenv WRKDIRPREFIX     ${HOME}/ports
    setenv PKG_DBDIR        ${HOME}/db/pkgs
    setenv PORT_DBDIR       ${HOME}/db/ports
    setenv PREFIX           ${HOME}
    setenv INSTALL_AS_USER  yes
    setenv PACKAGES         ${HOME}/packages

and you probably want to adjust user's $PATH settings, as well as
setting up apache to use ${HOME}/www/foo as the <Directory> to resolve
/~user/foo URLs.  A similar trick can be used for installing software
into multiple jail(8)s, although simply logging into each jail and
installing from there is often easier.

Note: using those environment settings all required dependencies
should be pre-installed with the standard $PREFIX or the ports system
won't find them.  There are some other variables you could conceivably
tweak to change that restriction (i.e. LOCALBASE) but that's probably
a step too far.

> And while we're on the subject of www/gallery, what about using
>         GALLERYDIR=${GALLERYDIR:C/^[^\/]/$PREFIX\/&/}
> to allow for fully-qualified install paths, instead of forcing PREFIX on
> the front of everything?  It would require some rewrite of the gallery
> port, but would it necessarily break things?  One could always set
> PREFIX=/, but does gallery resist installing outside $PREFIX for any
> particular reason?

Other than the whole ports system being designed to enforce hier(7)
and install everything relative to $(PREFIX)?  I believe it is
possible to override that, but not without effort.  In particular
you're going to have to edit pkg-plist to insert absolute paths.
Which is not too bad if you're installing from ports, but any package
created from such a port would end up installing to a compiled-in
fixed location, rather than one relative to $(PREFIX).



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP:         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list