From owner-freebsd-ports@FreeBSD.ORG Tue Sep 7 18:54:51 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAF1516A4CE; Tue, 7 Sep 2004 18:54:51 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FCE343D2D; Tue, 7 Sep 2004 18:54:50 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i87IsisA003161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Sep 2004 19:54:44 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)i87IsiWV003160; Tue, 7 Sep 2004 19:54:44 +0100 (BST) (envelope-from matthew) Date: Tue, 7 Sep 2004 19:54:44 +0100 From: Matthew Seaman To: freebsd-ports@freebsd.org Message-ID: <20040907185444.GA2487@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: freebsd-ports@freebsd.org, ports@freebsd.org, freebsd-ports@varju.ca References: <20040907175516.GA79688@it.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <20040907175516.GA79688@it.ca> User-Agent: Mutt/1.4.2.1i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (smtp.infracaninophile.co.uk [IPv6:::1]); Tue, 07 Sep 2004 19:54:44 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040904, clamav-milter version 0.75l on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: ports@freebsd.org cc: freebsd-ports@varju.ca Subject: Re: Recording multiple package installs... X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2004 18:54:51 -0000 --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 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--