From owner-freebsd-questions Wed Feb 7 18:21:47 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id A5E3A37B401 for ; Wed, 7 Feb 2001 18:21:29 -0800 (PST) Received: (qmail 37959 invoked by uid 100); 8 Feb 2001 02:21:29 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14978.681.125028.573454@guru.mired.org> Date: Wed, 7 Feb 2001 20:21:29 -0600 (CST) To: Trevin Chow Cc: questions@freebsd.org Subject: Re: Changing location for install of port? In-Reply-To: <7827180@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Trevin Chow types: > I prefer to install everything via ports, but I'm running into problems > where I want to customize the instal location but I'm not sure how to do > this. > > For example, the default install locaiton for the Apache 1.3.17 port is > /usr/local, butt I would like to make it install to /usr/local/apache (as > well as configure some other directories, like the log directory). > I don't see any documentation on the `make` and `make install` takin any > parameters, nor is there any type of "./configure" possible as there is > when you install the source. > > Upon examining the Makefile, I notice that the presence of a "$PREFIX" > variable to determine the install path, but that variable isn't defined > anywhere that I can see. > > Should I be editin the Makefile and hardcode an install path? Will this > hamper my ability to use "make deinstall" at a later time? Any help would > be great because I'm running into this problem with mySQL as well where I > wnat the install directory to be /usr/local/mysql. No, don't edit the Makefile. You can set PREFIX just like you set KERNEL (or KERNCONF) when building a kernel: make install PREFIX=/usr/local/apache Two caveats: 1) Not all ports are PREFIX clean. After you do the "make install", do a "make deinstall" and see if it complains about missing files. If so, it won't work. If it doesn't complain - you may still have problems. 2) This breaks dependencies. If you later install a port that depends on apache having been installed with PREFIX=/usr/local, it won't find the things it's looking for. You can get around that by setting LOCALBASE instead of PREFIX (PREFIX is set to LOCALBASE unless you override PREFIX). Of course, if you're installing a port that depends on two ports that were installed with different values of PREFIX, you may well be FUBAR. So, unless you've got a really good reason for doing things that way, you should install all ports with the same LOCALBASE setting (which defaults to /usr/local). In this case, you can change the log file location in the apache httpd.conf file after the install. If you really want to put it all in a separate directory, you might be better off installing from the original sources instead of ports. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message