Bug 116080

Summary: PREFIX is documented, but not the more important LOCALBASE
Product: Documentation Reporter: mah
Component: Books & ArticlesAssignee: Chris Rees <crees>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description mah 2007-09-04 12:30:02 UTC
The Ports system features the PREFIX variable to let one install a port into a different location than /usr/local. /usr/ports/Mk/bsd.port.mk says:

  # PREFIX                - Where *this* port installs its files.

The handbook documents this feature:

<http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html>
(Section 4.5.2.1)

Missing in this section is, PREFIX isn't inheriting (or shouldn't inherit, see PR #116078) to dependencies. Using PREFIX, dependencies are put into the default location.

If one wants all build results in a different directory - which is the case in many scenarios, one has to build with LOCALBASE instead:

  make LOCALBASE=/usr install


N.B.: Currently, using PREFIX fails if dependencies are needed: PR #116078

How-To-Repeat: n.a.
Comment 1 Thomas Abthorpe freebsd_committer freebsd_triage 2009-02-06 17:54:41 UTC
Responsible Changed
From-To: freebsd-doc->tabthorpe

I'll take it.
Comment 2 Thomas Abthorpe freebsd_committer freebsd_triage 2009-02-06 20:05:45 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Markus

I will look at this PR, do you have some content you would like to contribute?


Thomas

- -- 
Thomas Abthorpe		| FreeBSD Committer
tabthorpe@FreeBSD.org	| http://people.freebsd.org/~tabthorpe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)

iEYEARECAAYFAkmMmCEACgkQ5Gm/jNBp8qBAOQCfS1i6/fPWjQRr7tyQPf+s0pvO
LagAn3aC4eAqA26CIAOi+q8jhlVekpPs
=K8WO
-----END PGP SIGNATURE-----
Comment 3 mah 2009-02-07 10:47:24 UTC
Am 06.02.2009 um 21:05 schrieb Thomas Abthorpe:

> I will look at this PR, do you have some content you would like to  
> contribute?

Hello Thomas,

it's exactly the right time you come up with this. Recently I had a  
similar issue when trying to install a port into a non-standard  
location and came to about the opposite conclusion:

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=ports/130899

The real issue probably is, there is currently no common sense about  
how to handle installation of ports in non-standard locations. Many  
FreeBSD developers consider /usr/local to be the only valid place to  
install ports to. Some ports even have this path hardcoded (using  
neither PREFIX nor LOCALBASE). Nevertheless, ports has the feature to  
install elsewhere and supports this to about 90%.

Can we move this discussion to one of the mailing lists? I'd  
subscribe there, then.

The questions unclear to me are:

- why does LOCALBASE exist if PREFIX is already there? Why isn't a  
single variable sufficient?

- is it sensible to check prerequisites by looking for files in a  
fixed location like

if [ -e ${PREFIX}/bin/apr ]; then
   echo "apr is installed"
fi

rarther than querying the ports database to find out wether and where  
a port is installed?


Markus
Comment 4 Thomas Abthorpe freebsd_committer freebsd_triage 2010-04-10 05:46:18 UTC
Responsible Changed
From-To: tabthorpe->freebsd-doc

Back to the heap, I have made no positive progress on this, maybe 
somebody else can do it justice
Comment 5 Glen Barber freebsd_committer freebsd_triage 2011-09-07 03:24:08 UTC
State Changed
From-To: open->closed

PR 159551, though a duplicate of this PR, provides a patch. 

Close this one for favor of the latter. 



Comment 6 Glen Barber freebsd_committer freebsd_triage 2011-09-07 03:24:08 UTC
Responsible Changed
From-To: freebsd-doc->gjb

Over to me, since I'm closing this.
Comment 7 Glen Barber freebsd_committer freebsd_triage 2011-09-07 03:28:03 UTC
State Changed
From-To: closed->open

Oops, time to get the reading glasses checked.  This PR is for 
the Ports chapter in the handbook, not ports(7) manual. 

Reopen, sorry for the noise. 



Comment 8 Glen Barber freebsd_committer freebsd_triage 2011-09-07 03:28:03 UTC
Responsible Changed
From-To: gjb->freebsd-doc

Oops, time to get the reading glasses checked.  This PR is for 
the Ports chapter in the handbook, not ports(7) manual. 

Reopen, sorry for the noise.
Comment 9 Chris Rees freebsd_committer freebsd_triage 2013-12-21 17:25:53 UTC
Responsible Changed
From-To: freebsd-doc->crees

Let's get this one fixed.
Comment 10 Chris Rees freebsd_committer freebsd_triage 2013-12-21 17:40:38 UTC
State Changed
From-To: open->closed

After reading the section in question, I'm certain that the difference 
is adequately explained with the following extract: "For instance, if 
your port requires a macro PAGER to have the full pathname of less, do 
not use a literal path of /usr/local/bin/less. Instead, use 
${LOCALBASE}".  If you disagree, please say so!