From alane@geeksrus.net  Sat Mar 16 06:06:13 2002
Return-Path: <alane@geeksrus.net>
Received: from wwweasel.geeksrus.net (wwweasel.geeksrus.net [64.8.210.226])
	by hub.freebsd.org (Postfix) with ESMTP
	id 04B3937B400; Sat, 16 Mar 2002 06:06:10 -0800 (PST)
Received: (from alane@localhost)
	by wwweasel.geeksrus.net (8.11.6/8.11.6) id g2GE5hU15481;
	Sat, 16 Mar 2002 09:05:43 -0500 (EST)
	(envelope-from alane)
Message-Id: <200203161405.g2GE5hU15481@wwweasel.geeksrus.net>
Date: Sat, 16 Mar 2002 09:05:43 -0500 (EST)
From: Alan Eldridge <ports@geeksrus.net>
Reply-To: Alan Eldridge <ports@geeksrus.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc: sobomax@freebsd.org
Subject: www/mozilla{,-headers}: installs incorrectly if *built* as non-root
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35980
>Category:       ports
>Synopsis:       www/mozilla{,-headers}: installs incorrectly if *built* as non-root
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 16 06:10:01 PST 2002
>Closed-Date:    Sat Apr 13 10:07:22 PDT 2002
>Last-Modified:  Sat Apr 13 10:07:22 PDT 2002
>Originator:     Alan Eldridge
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Geeksrus.NET
>Environment:
System: FreeBSD wwweasel.geeksrus.net 4.5-STABLE FreeBSD 4.5-STABLE #0: Mon Mar 11 00:59:22 EST 2002 root@wwweasel.geeksrus.net:/usr/obj/usr/src/sys/WWWEASEL i386

>Description:

I do ports builds as myself, then use sudo to do the 'make
install'. The mozilla and mozilla-headers ports do not install
correctly when the 'build' step is executed as non-root: the installed
files have the build owner and group.

This is not a new bug. I just happened to notice it this morning.

[alane ~/FreeBSD/ports/www/mozilla]$ ls -l /usr/X11R6/lib/mozilla/
total 5554
-rwxr-xr-x   1 alane  alane     4272 Mar 16 01:58 DocStream
-rwxr-xr-x   1 alane  alane     4272 Mar 16 01:58 HelloWorld
-rw-r--r--   1 alane  alane     3078 Mar 21  2000 INSTALL.xmlterm
-rwxr-xr-x   1 alane  alane    20368 Mar 16 02:15 TestGtkEmbed
-rwxr-xr-x   1 alane  alane     7216 Mar 16 02:15 TestGtkEmbedChild
-rwxr-xr-x   1 alane  alane     5096 Mar 16 02:15 TestGtkEmbedNotebook
-rwxr-xr-x   1 alane  alane     5636 Mar 16 02:15 TestGtkEmbedSocket
-rw-r--r--   1 alane  alane      217 Feb  5 02:16 bloaturls.txt
drwxr-xr-x   3 alane  alane     1024 Mar 16 02:16 chrome
[...]
[alane ~/FreeBSD/ports/www/mozilla-headers]$ ls -l /usr/X11R6/include/mozilla/
total 290
drwxr-xr-x  2 alane  alane   512 Mar 16 08:43 absyncsvc
drwxr-xr-x  2 alane  alane   512 Mar 16 08:43 accessibility
drwxr-xr-x  2 alane  alane  2048 Mar 16 08:43 addrbook
drwxr-xr-x  2 alane  alane  1024 Mar 16 08:43 appcomps
drwxr-xr-x  2 alane  alane   512 Mar 16 08:43 appshell
drwxr-xr-x  2 alane  alane   512 Mar 16 08:43 autoconfig
[...]

Note: Very few ports, if any, truly need to have the build step
executed as root; these two certainly do not.

>How-To-Repeat:

See above.

>Fix:

Use find|cpio instead of tar|tar to install. These installs were verified
to have the same effect as the original tar|tar installations.

Notes: 

1. The mozilla install uses GNU tar's -h option to dereference symlinks. This
behavior is maintained by using the -L option to cpio.
2. The mozilla-headers install also uses the --unlink option to tar. Since
there is no equivalent option to cpio, and since no other port writes to this
installation directory (${PREFIX}/include/mozilla), the installation step now
removes the existing directory first.

--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
Index: www/mozilla/Makefile
===================================================================
RCS file: /home/alane/cvsroot/ports/www/mozilla/Makefile,v
retrieving revision 1.86
diff -u -3 -r1.86 Makefile
--- www/mozilla/Makefile	14 Mar 2002 20:21:05 -0000	1.86
+++ www/mozilla/Makefile	16 Mar 2002 13:18:27 -0000
@@ -87,8 +87,8 @@
 do-install:
 	${MKDIR} ${PREFIX}/lib/mozilla
 	${CHMOD} 755 ${PREFIX}/lib/mozilla
-	cd ${WRKSRC}/dist/bin && ${TAR} -chf - . | \
-		${TAR} -xf - -C ${PREFIX}/lib/mozilla
+	cd ${WRKSRC}/dist/bin && ${FIND} . | \
+		cpio -pdm -L -R ${LIBOWN}:${LIBGRP} ${PREFIX}/lib/mozilla
 	${INSTALL_SCRIPT} ${WRKSRC}/mozilla ${PREFIX}/bin
 	${LN} -sf ${LOCALBASE}/jdk1.3.1/jre/plugin/i386/ns600/libjavaplugin_oji.so \
 		${PREFIX}/lib/mozilla/plugins/libjavaplugin_oji.so
Index: www/mozilla-headers/Makefile
===================================================================
RCS file: /home/alane/cvsroot/ports/www/mozilla-headers/Makefile,v
retrieving revision 1.4
diff -u -3 -r1.4 Makefile
--- www/mozilla-headers/Makefile	13 Jun 2001 09:15:59 -0000	1.4
+++ www/mozilla-headers/Makefile	16 Mar 2002 13:53:16 -0000
@@ -27,9 +27,10 @@
 ALL_TARGET=	export
 
 do-install:
+	-${RM} -fr ${PREFIX}/include/mozilla
 	${MKDIR} ${PREFIX}/include/mozilla
 	${CHMOD} 755 ${PREFIX}/include/mozilla
-	${TAR} -C ${WRKSRC}/dist/include -chf - . | \
-		${TAR} -C ${PREFIX}/include/mozilla --unlink -xf -
+	cd ${WRKSRC}/dist/include && ${FIND} . | \
+		cpio -pdm -L -R ${INCOWN}:${INCGRP} ${PREFIX}/include/mozilla
 
 .include <bsd.port.mk>
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->gnome 
Responsible-Changed-By: petef 
Responsible-Changed-When: Sat Mar 16 11:28:32 PST 2002 
Responsible-Changed-Why:  
Over to maintainers 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35980 

From: Alan Eldridge <alane@geeksrus.net>
To: FreeBSD Bugs <freebsd-gnats-submit@freebsd.org>
Cc: sobomax@freebsd.org, FreeBSD Ports List <ports@freebsd.org>
Subject: Re: ports/35980: www/mozilla{,-headers}: installs incorrectly if *built* as non-root
Date: Sat, 16 Mar 2002 14:50:23 -0500

 This problem affects www/mozilla-embedded as well:
 
 Patch is:
 --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
 Index: www/mozilla-embedded/Makefile
 ===================================================================
 RCS file: /home/alane/cvsroot/ports/www/mozilla-embedded/Makefile,v
 retrieving revision 1.13
 diff -u -3 -r1.13 Makefile
 --- www/mozilla-embedded/Makefile	5 Feb 2002 17:24:00 -0000	1.13
 +++ www/mozilla-embedded/Makefile	16 Mar 2002 19:47:35 -0000
 @@ -41,7 +41,7 @@
  do-install:
  	${MKDIR} ${PREFIX}/lib/mozilla-embedded
  	${CHMOD} 755 ${PREFIX}/lib/mozilla-embedded
 -	cd ${WRKSRC}/dist/Embed && ${TAR} -chf - * | \
 -		${TAR} -xf - -C ${PREFIX}/lib/mozilla-embedded
 +	cd ${WRKSRC}/dist/Embed && ${FIND} . | \
 +	  cpio -pdm -L -R ${LIBOWN}:${LIBGRP} ${PREFIX}/lib/mozilla-embedded
  
  .include <bsd.port.mk>
 --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
 
 -- 
 AlanE
 "When the going gets tough, the weird turn pro." - HST
 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Sat Apr 13 10:07:03 PDT 2002 
State-Changed-Why:  
Committed, thanks! 

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