From owner-freebsd-ports@FreeBSD.ORG Fri Oct 3 02:39:07 2003 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 96E9916A4B3 for ; Fri, 3 Oct 2003 02:39:07 -0700 (PDT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 63D1943FCB for ; Fri, 3 Oct 2003 02:39:05 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 28944 invoked from network); 3 Oct 2003 09:38:59 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 3 Oct 2003 09:38:58 -0000 Received: (qmail 31461 invoked by uid 1000); 3 Oct 2003 09:39:02 -0000 Date: Fri, 3 Oct 2003 12:39:02 +0300 From: Peter Pentchev To: Will Kessler Message-ID: <20031003093902.GH546@straylight.oblivion.bg> Mail-Followup-To: Will Kessler , ports@freebsd.org References: <200310022226100827.0307CB95@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QXO0/MSS4VvK6f+D" Content-Disposition: inline In-Reply-To: <200310022226100827.0307CB95@localhost> User-Agent: Mutt/1.5.4i cc: ports@freebsd.org Subject: Re: install mozilla without root permission 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: Fri, 03 Oct 2003 09:39:07 -0000 X-List-Received-Date: Fri, 03 Oct 2003 09:39:07 -0000 --QXO0/MSS4VvK6f+D Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 02, 2003 at 10:26:10PM -0700, Will Kessler wrote: > Hello, >=20 > I am a poor unpriv'd user on a shared freebsd system which has no > installed browser. >=20 > I'd like to install mozilla but cannot secure root or even pseudo > privs to do it using a package. Is there any way to just install it in > my local home dir? I've also tried biulding from source, after > building gtk and glib, but this fails due to other dependencies. You cannot really install an already-built package into another location: most often, the binaries, libraries, and other files in the package will have hardwired (at compile time) references to paths to its 'usual' location (the one it was built for) - it may be hard and time-consuming (and even impossible for the binaries and libraries) to track down and change all those references, and make sure it's done correctly. The most you can do is build the port - starting with all its dependencies - instructing it to install into your home dir. Although I've never done this for Mozilla itself, I have indeed succeeded in doing this for other ports, including their dependencies. It is not a very easy task, though :( The way to go about it is to set several environment variables. - the PREFIX variable specifies where a port is to be installed; point it at your home directory, and the ports system will create the ~/bin, ~/lib, ~/share, etc, directories needed; - the LOCALBASE variable specifies where a port should look for the libraries and commands installed by its dependencies; if you want to build Mozilla's dependencies, too (if they are not installed on the system in the default /usr/local hierarchy), you may want to also point LOCALBASE to your home directory; - the INSTALL_AS_USER variable instructs the ports collection to not attempt to perform the actual installation as root; set it to any value, 'yes' works fine :) - the NO_PKG_REGISTER variable instructs the ports collection to not attempt to actually register the package in the package database used by the pkg_add/pkg_delete/pkg_info tools; set it to any value, 'yes' works fine :) - the DISTDIR variable contains the location for the directory where the ports system downloads the source files for the installed packages; since you may not have permission to write to the default download directory, /usr/ports/distfiles/, you may want to set DISTDIR to, say, $HOME/tmp/dist/; - the WRKDIRPREFIX variable contains the location for a directory where the ports are actually extracted and compiled; since you may not have permission to write to the default directories - they are created in the ports tree itself, e.g. /usr/ports/www/mozilla/work/ and /usr/ports/devel/gmake/work/, you may want to set WRKDIRPREFIX to, say, $HOME/tmp/work/; - the DEPENDS_TARGET variable controls the way a port's dependencies are built when needed; since Mozilla has a lot of big dependencies, and you may not want to keep all of their extracted/compiled sources around after they were successfully installed, you may want to change the default 'install' setting to 'install clean', so that the ports are cleaned up immediately after a successful installation; - the LD_LIBRARY_PATH, while not specifically a ports variable, will have some bearing on your trying to build applications which link with libraries in non-standard locations. You may want to set LD_LIBRARY_PATH to $LOCALBASE/lib (if using the settings proposed above, this will be the same as $HOME/lib). Well, I warned you that it might not be simple and easy :) Something like the following usually works for me: - for Bourne-family shells (sh, ksh, bash, zsh): export PREFIX=3D$HOME LOCALBASE=3D$HOME INSTALL_AS_USER=3Dyes NO_PKG_REGI= STER=3Dyes export DISTDIR=3D$HOME/tmp/dist/ WRKDIRPREFIX=3D$HOME/tmp/work/ export DEPENDS_TARGET=3D'install clean' LD_LIBRARY_PATH=3D$LOCALBASE/lib - for C-family shells (csh, tcsh): setenv PREFIX $HOME setenv LOCALBASE $HOME setenv INSTALL_AS_USER yes setenv NO_PKG_REGISTER yes setenv DISTDIR $HOME/tmp/dist setenv WRKDIRPREFIX $HOME/tmp/work setenv DEPENDS_TARGET 'install clean' setenv LD_LIBRARY_PATH $LOCALBASE/lib Then either use the system's ports tree in /usr/ports, or extract your own copy in, say, $HOME/ports/ and set the PORTSDIR variable to point at it (export PORTSDIR=3D$HOME/ports or setenv PORTSDIR $HOME/ports), change to the www/mozilla port's directory (cd /usr/ports/www/mozilla/), and try 'make clean all install' to see if it will work :) Someday I'll try to organize this, as well as any feedback received from people who have tried it and found it a bit lacking, and make it a part of the FreeBSD Handbook's ports section. Thus, it will be awesome if you actually tried to follow these directions and told me if it works or not, including the error messages in the latter case :) > Normally I develop under solaris and linux, for which i can get > executables that seem to run in their own dir, so i'm less familiar > with freebsd (although pkg_add sounds a bit like pkgadd under > solaris). Unfortunately, as noted above, pkg_add only installs precompiled packages, and you cannot easily do this into a different directory - not for a port as complex as Mozilla anyway :( > Any pointers/help appreciated! Opera just doesn't cut the mustard, I > really don't want to use any MSFT products, and googling revealed few > clues. Well, pretty much your only chance is to build the beast yourself... and be warned, it *is* a beast, it is enormous, it has a *lot* of big dependencies, it will take both much time and much disk space to do this. Still, it might be worth a try :) By the way, there are a couple of other browsers in the ports/www category: Arena and Mosaic come to mind, although they might be a bit simplistic, but there might be others that I just don't know about :) If Mozilla turns out to be really hard to build this way, you might want to try some of the simpler ones. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 When you are not looking at it, this sentence is in Spanish. --QXO0/MSS4VvK6f+D Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/fUO27Ri2jRYZRVMRAkWzAJ91ciWePsrCuaxKZ5VDyy8zmwzAigCdG/Wj WumgFz+XAQnnhhZF0/ucEUc= =Ps/Z -----END PGP SIGNATURE----- --QXO0/MSS4VvK6f+D--