From nobody@FreeBSD.org  Tue Jan 18 17:49:45 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D764B16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 18 Jan 2005 17:49:45 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C234743D49
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 18 Jan 2005 17:49:45 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0IHnjBs030644
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 18 Jan 2005 17:49:45 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j0IHnjmh030638;
	Tue, 18 Jan 2005 17:49:45 GMT
	(envelope-from nobody)
Message-Id: <200501181749.j0IHnjmh030638@www.freebsd.org>
Date: Tue, 18 Jan 2005 17:49:45 GMT
From: John Baldwin <jhb@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: devel/automake ports fail to install when built as non-root
X-Send-Pr-Version: www-2.3

>Number:         76422
>Category:       ports
>Synopsis:       devel/automake ports fail to install when built as non-root
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 18 17:50:32 GMT 2005
>Closed-Date:    Thu Mar 17 16:21:57 GMT 2005
>Last-Modified:  Thu Mar 17 16:21:57 GMT 2005
>Originator:     John Baldwin
>Release:        5.3-STABLE and 6.0-CURRENT
>Organization:
>Environment:
N/A      
>Description:
The pre-install and post-install targets are not run with elevated privileges, so the mkdir commands in the pre-install target fail when trying to install as non-root (in other words, su seems to only be applied for do-install)
>How-To-Repeat:
Run 'make install' for one of the devel/automake* ports
>Fix:
Change the automake ports to use the pre-su-install and post-su-install targets rather than pre-install and post-install.  Example change for automake19:

Index: Makefile
===================================================================
RCS file: /usr/cvs/ports/devel/automake19/Makefile,v
retrieving revision 1.57
diff -u -r1.57 Makefile
--- Makefile    28 Dec 2004 06:43:00 -0000      1.57
+++ Makefile    18 Jan 2005 17:49:27 -0000
@@ -38,13 +38,13 @@
        )
        @${REINPLACE_CMD} -e 's,%%X11BASE%%,${X11BASE},g' ${WRKSRC}/aclocal.in

-pre-install:
+pre-su-install:
        @${RM} -fr ${PREFIX}/share/automake${BUILD_VERSION}
        @${MKDIR} ${PREFIX}/share/automake${BUILD_VERSION}
        @${MKDIR} ${PREFIX}/share/aclocal${BUILD_VERSION}
        @${MKDIR} ${PREFIX}/libexec/automake${BUILD_VERSION}

-post-install:
+post-su-install:
 .for i in aclocal automake
        @${LN} -sf ${PREFIX}/bin/${i}${BUILD_VERSION} \
                ${PREFIX}/libexec/automake${BUILD_VERSION}/${i}

Note that all automake ports seem affected however.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ade 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jan 19 05:05:09 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76422 
Responsible-Changed-From-To: ade->freebsd-ports-bugs 
Responsible-Changed-By: ade 
Responsible-Changed-When: Mon Mar 7 17:47:28 GMT 2005 
Responsible-Changed-Why:  
Return to the fold after releasing autotools back into the wild. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76422 
State-Changed-From-To: open->closed 
State-Changed-By: glewis 
State-Changed-When: Thu Mar 17 16:20:31 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

Note that we only need pre-su-install.  There is no post-su-install as 
once we've su'ed the privilege is retained for the rest of the install 
step (and do-install always causes this to happen at least at that point). 

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