From amdmi3@amdmi3.ru  Wed Feb 17 17:01:11 2010
Return-Path: <amdmi3@amdmi3.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90C00106566B;
	Wed, 17 Feb 2010 17:01:11 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D0B78FC17;
	Wed, 17 Feb 2010 17:01:10 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.69)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1NhnGX-0006iu-VJ; Wed, 17 Feb 2010 20:00:46 +0300
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 71D7DB860;
	Wed, 17 Feb 2010 20:01:08 +0300 (MSK)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 6CA32B84B; Wed, 17 Feb 2010 20:01:08 +0300 (MSK)
Message-Id: <20100217170108.6CA32B84B@hades.panopticon>
Date: Wed, 17 Feb 2010 20:01:08 +0300 (MSK)
From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: gecko@FreeBSD.org
Subject: [PATCH] www/firefox: Makefile.webplugins target order bug
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         144044
>Category:       ports
>Synopsis:       [PATCH] www/firefox: Makefile.webplugins target order bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gecko
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 17 17:10:02 UTC 2010
>Closed-Date:    
>Last-Modified:  Mon Mar 22 19:00:12 UTC 2010
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Tue Nov 24 22:31:59 MSK 2009
>Description:
I've got a report that my port graphics/gnash doesn't install with the following error:

> ERROR: The "/usr/local/lib/browser_plugins/gnash" in WEBPLUGINS_DIR is
> either a typo or no longer exists. Please make a bug report to
> amdmi3@FreeBSD.org (maintainer).

The problem is likely in Makefile.webplugins, as it has the following dependency line:

post-install: webplugins-post-install

however gnash installs plugins in post-install, thus the order is
broken - webplugins-post-install is ran before the plugins are
installed. The installation is reported to be fixed after making
gnash port install plugins in pre-install instead.

I really wonder why this hadn't shown itself in a tinderbox and why
I can't reproduce it locally, however Makefile.webplugins logic should
be fixed to run webplugins-post-install after any installation tasks
that may be run by a port.

Port maintainer (gecko@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gecko 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Feb 17 17:10:11 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: Beat Gaetzi <beat@FreeBSD.org>
To: bug-followup@FreeBSD.org, amdmi3@amdmi3.ru
Cc:  
Subject: Re: ports/144044: [PATCH] www/firefox: Makefile.webplugins target
 order bug
Date: Sun, 21 Mar 2010 10:35:42 +0100

 Hi,
 
 Thanks for tracking down this issue. I've previously never seen such a
 problem with a webplugin.
 IIRC post-install target is designed to run after any installation task.
 So I think running webplugins-post-install on post-install is correct.
 Or in which target do you think is the right place to call
 webplugins-post-install?
 
 Thanks,
 Beat

From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: Beat Gaetzi <beat@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/144044: [PATCH] www/firefox: Makefile.webplugins target
 order bug
Date: Mon, 22 Mar 2010 21:52:02 +0300

 --cWoXeonUoKmBZSoM
 Content-Type: text/plain; charset=utf-8
 Content-Disposition: inline
 
 * Beat Gaetzi (beat@FreeBSD.org) wrote:
 
 > Thanks for tracking down this issue. I've previously never seen such a
 > problem with a webplugin.
 > IIRC post-install target is designed to run after any installation task.
 
 No, post-install is installation task itself and is designed to make it
 possible to perform more installation tasks in addition to standart ones
 without code duplication.
 
 > So I think running webplugins-post-install on post-install is correct.
 
 Yes, but in our case it's running before post-install. If essential
 files needed for webplugins-post-install are installed on post-install,
 everything breaks - and this is our case.
 
 > Or in which target do you think is the right place to call
 > webplugins-post-install?
 
 I think the correct way is to append your tasks to post-install:,
 so they are run after tasks defined in the port. I think it's
 possible by adding targets to post-install in bsd.port.post.mk, and
 I think that bsd.xorg.mk does exactly that, though I'm not sure if
 it really respects order, as it doesn't really need to.
 
 For Makefile.webplugins, I think it may be done as following:
 - Makefile.webplugins should be modified as attached
 - Ports that use it should be checked for that they define
   USE_WEBPLUGINS before including Makefile.webplugins
 - gnash ports should be changed to include Makefile.webplugins after
   post-patch (but USE_WEBPLUGINS is still set unconditionally)
 
 This way, the correct bahaviour should be achieved with minimal
 changes. Would be even better to move .include Makefile.webplugins to
 the end of Makefile in all ports to use it, to avoid copypaste
 problems in future.
 
 The best thing, however, would be to move Makefile.webplugins to
 Mk/ as bsd.webplugins.mk and integrate it into bsd.port.mk properly with
 respect to port/pre.mk. I think it pretty much deserves a place under
 Mk/.
 
 -- 
 Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
 amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru
 
 --cWoXeonUoKmBZSoM
 Content-Type: text/x-diff; charset=utf-8
 Content-Disposition: attachment; filename="webplugins.patch"
 
 Index: Makefile.webplugins
 ===================================================================
 RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/www/firefox/Makefile.webplugins,v
 retrieving revision 1.1
 diff -u -r1.1 Makefile.webplugins
 --- Makefile.webplugins	10 Jan 2009 02:45:41 -0000	1.1
 +++ Makefile.webplugins	22 Mar 2010 18:04:40 -0000
 @@ -137,6 +137,7 @@
  #	/usr/local/lib/browser_plugins/symlinks/gecko19/fooplugin.xpi -> /usr/local/lib/application/fooplugin.xpi
  #	------------------------------------------------------
  
 +.if defined(USE_WEBPLUGINS)
  WEBPLUGINS_NAME?=			${PKGBASE}
  WEBPLUGINS_FILES?=			empty
  WEBPLUGINS_APPS_ALL_LINUX=	linux-firefox linux-firefox-devel linux-flock \
 @@ -190,7 +191,7 @@
  _WLF=		${WEBPLUGINS_LINKFARMS:S,${PREFIX},%D,}
  _WSD=		${WEBPLUGINS_SLDIR:S,^${PREFIX},%D,}
  
 -webplugins-post-install:
 +post-install:
  	@if [ ! -d ${WEBPLUGINS_DIR} ]; then \
  		${ECHO_CMD}; \
  		${ECHO_CMD} "ERROR: The \"${WEBPLUGINS_DIR}\" in WEBPLUGINS_DIR is either a typo or no longer exists. Please make a bug report to ${MAINTAINER} (maintainer)."; \
 @@ -223,4 +224,4 @@
  	@${ECHO_CMD} "@unexec rmdir ${_WSD} ${_Q}" >> ${TMPPLIST}
  	@${ECHO_CMD} "@unexec rmdir ${_WLD} ${_Q}" >> ${TMPPLIST}
  
 -post-install: webplugins-post-install
 +.endif
 
 --cWoXeonUoKmBZSoM--
>Unformatted:
