From mwm@mired.org  Sun Dec 10 14:52:51 2000
Return-Path: <mwm@mired.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 2AD2237B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 Dec 2000 14:52:50 -0800 (PST)
Received: (qmail 4401 invoked by uid 100); 10 Dec 2000 22:52:48 -0000
Message-Id: <20001210225248.4400.qmail@guru.mired.org>
Date: 10 Dec 2000 22:52:48 -0000
From: mwm@mired.org
Reply-To: mwm@mired.org
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: The Porter's handbook doesn't say how to test for PREFIX-clean
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         23450
>Category:       docs
>Synopsis:       The Porter's handbook doesn't say how to test for PREFIX-clean
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 10 15:00:01 PST 2000
>Closed-Date:    Mon Dec 11 11:54:55 PST 2000
>Last-Modified:  Mon Dec 11 11:55:06 PST 2000
>Originator:     Mike Meyer
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Meyer Consulting
>Environment:
System: FreeBSD guru.mired.org 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Sun Dec 10 11:48:38 CST 2000 mwm@guru.mired.org:/usr/obj/sharetmp/src/sys/GURU i386

>Description:

Ports are showing up that aren't PREFIX-clean, even though the Porters
Handbook recommends against that. I suspect that telling people *how*
to test a port to see if it's PREFIX clean will help with that.

>How-To-Repeat:

Try running a system with LOCALBASE set to something other than /usr/local for a year or so, and note how much stuff winds up installed in /usr/local.

>Fix:

Here are patches to the Porter's Handbook.

--- /usr/doc/en_US.ISO_8859-1/books/porters-handbook/book.sgml	Sat Nov 25 12:34:48 2000
+++ book.sgml	Sun Dec 10 16:49:00 2000
@@ -3277,6 +3277,22 @@
           <makevar>PREFIX</makevar>, as this variable is automatically passed
           down to every stage of the build and install processes.</para>
 
+	<para>Make sure your application isn't installing things in 
+	<filename>/usr/local</filename> instead of <makevar>PREFIX</makevar>.
+	A quick test for this is to do this is:</para>
+
+	<screen>&prompt.root; <userinput>make clean; make package PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
+	
+	<para>If anything is installed outside of <makevar>PREFIX</makevar>, 
+	making the package creation process will complain that it
+	can't find the files.</para>
+
+	<para>This does not test for the existence of internal references,
+	or correct use of <makevar>LOCALBASE</makevar> for references to
+	files from other ports. Testing the installation in
+	<filename>/var/tmp/<replaceable>port-name</replaceable></filename>
+	to do that that while you have it installed would do that.</para>
+
         <para>Do not set <makevar>USE_X_PREFIX</makevar> unless your port
           truly requires it (i.e., it links against X libs or it needs to
           reference files in <makevar>X11BASE</makevar>).</para>


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: nik 
State-Changed-When: Mon Dec 11 11:54:55 PST 2000 
State-Changed-Why:  
Committed, thanks. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=23450 
>Unformatted:
