Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 2004 19:54:44 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-ports@freebsd.org
Cc:        freebsd-ports@varju.ca
Subject:   Re: Recording multiple package installs...
Message-ID:  <20040907185444.GA2487@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20040907175516.GA79688@it.ca>
References:  <20040907175516.GA79688@it.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Sep 07, 2004 at 01:55:16PM -0400, Paul Chvostek wrote:
>=20
> 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.
>=20
> 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.
>=20
> 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
> =20
>         GALLERYDIR=3D${GALLERYDIR:C/^[^\/]/$PREFIX\/&/}
> =20
> 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=3D/, 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).

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQFBPgP0iD657aJF7eIRAlQPAKCUY4WbW/hN+HbE7geO/M+WCKTmZwCfbl3v
iTZ5fihH2MpMwC14gqg5NxY=
=jejI
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040907185444.GA2487>