From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jul 28 18:30:06 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0685106568A for ; Sat, 28 Jul 2012 18:30:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7EBCC8FC17 for ; Sat, 28 Jul 2012 18:30:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6SIU6UN091624 for ; Sat, 28 Jul 2012 18:30:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6SIU6jf091621; Sat, 28 Jul 2012 18:30:06 GMT (envelope-from gnats) Resent-Date: Sat, 28 Jul 2012 18:30:06 GMT Resent-Message-Id: <201207281830.q6SIU6jf091621@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alberto Villa Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65CA1065673 for ; Sat, 28 Jul 2012 18:25:58 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D0FCF8FC15 for ; Sat, 28 Jul 2012 18:25:58 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6SIPwtk092671 for ; Sat, 28 Jul 2012 18:25:58 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q6SIPwtI092649; Sat, 28 Jul 2012 18:25:58 GMT (envelope-from nobody) Message-Id: <201207281825.q6SIPwtI092649@red.freebsd.org> Date: Sat, 28 Jul 2012 18:25:58 GMT From: Alberto Villa To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/170236: [patch] www/firefox: add support for PREFIX != LOCALBASE to Makefile.webplugins X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 18:30:06 -0000 >Number: 170236 >Category: ports >Synopsis: [patch] www/firefox: add support for PREFIX != LOCALBASE to Makefile.webplugins >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jul 28 18:30:05 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Alberto Villa >Release: >Organization: >Environment: >Description: Web plug-ins (ports using www/firefox/Makefile.webplugins) are symlinked to browser-specific directories. Those symlinks are installed in PREFIX, while they should be installed in LOCALBASE (browsers are patched to search them in LOCALBASE). >How-To-Repeat: This became apparent while working on a KDE port (which has PREFIX != LOCALBASE): Firefox is not going to check into /usr/local/kde4/lib/browser_plugins/*. >Fix: The attached patch changes WEBPLUGINS_LIBDIR to be in LOCALBASE. WEBPLUGINS_DIR - the directory where the plug-in file is actually installed - was left in PREFIX (with WEBPLUGINS_LIBDIR:S,^${LOCALBASE}/,${PREFIX}/), as the real location of the file is not important, and it really belongs to PREFIX. As a consequence, WEBPLUGINS_LIBDIR (with %D instead of LOCALBASE) is now removed (@dirrmtry) twice when PREFIX != LOCALBASE (before and after the @cwd %%LOCALBASE%%), otherwise there's going to be a leftover. This might cause the directory to be removed uselessly when WEBPLUGINS_DIR is defined to something independent from it, but this cannot be a problem as either it has files inside, or it doesn't exist (and, remember, it's @dirrmtry). I've tested some dependent ports and they work fine with both default and custom PREFIX. The question is: do they need a PORTREVISION bump? If people have them installed in custom PREFIX (!= LOCALBASE) - quite unlikely - the symlinks need to be regenerated. Patch attached with submission follows: Index: /usr/ports/www/firefox/Makefile.webplugins =================================================================== --- /usr/ports/www/firefox/Makefile.webplugins (revision 301630) +++ /usr/ports/www/firefox/Makefile.webplugins (working copy) @@ -14,10 +14,10 @@ # Documentation and examples: # # Makefile.webplugins will create symlinks automatically for each supported -# applications that supports the webplugins framework. Also, it will remove +# application that supports the webplugins framework. Also, it will remove # these symlinks when the plug-in port is uninstalled. # -# USE_WEBPLUGINS - Specify a list of application(s) that this plug-in +# USE_WEBPLUGINS - Specify a list of applications that this plug-in # port supports. For each of these applications, a # symlink will be created in # lib/browser_plugins/symlinks. See @@ -26,13 +26,13 @@ # Default: USE_WEBPLUGINS=${WEBPLUGINS_APPS_ALL} (all # applications) # -# WEBPLUGINS_NAME - If your port installs file(s) in ${WEBPLUGINS_DIR}, +# WEBPLUGINS_NAME - If your port installs files in ${WEBPLUGINS_DIR}, # then you can tweak WEBPLUGINS_NAME to change the # name of the directory # (lib/browser_plugins/symlinks/WEBPLUGINS_NAME). # Default: WEBPLUGINS_NAME=${PKGBASE} # -# WEBPLUGINS_FILES - The plug-in file(s) that are going to be linked +# WEBPLUGINS_FILES - The plug-in files that are going to be linked # in lib/browser_plugins/symlinks/*/. It cannot # be empty or the port will set IGNORE. # @@ -40,9 +40,9 @@ # found. Each plug-in file in WEBPLUGINS_FILES # must be found in WEBPLUGINS_DIR. If your port # does not install in WEBPLUGINS_DIR, but in its own -# path. You will need to specify that here or +# path, you will need to specify that here or # symlinks will be created to non-existent files. -# Default: WEBPLUGINS_DIR?=${WEBPLUGINS_LIBDIR}/${WEBPLUGINS_NAME} +# Default: WEBPLUGINS_DIR=${WEBPLUGINS_LIBDIR:S,^${LOCALBASE}/,${PREFIX}/,}/${WEBPLUGINS_NAME} # # # The USE_WEBPLUGINS supports wildcards, native, and linux; so you can do any @@ -53,8 +53,8 @@ # USE_WEBPLUGINS=linux (Supports linux-*) # USE_WEBPLUGINS=opera webkit-gtk2 # -# Example to add in Makefile and pkg-plist if the plug-in file(s) install in -# WEBPLUGINS_DIR, and if your port does this manually: +# Example to add in Makefile and pkg-plist if the plug-in files are installled +# to WEBPLUGINS_DIR, and if your port does this manually: # # Makefile: # ------------------------------------------------------ @@ -104,7 +104,7 @@ # ------------------------------------------------------ # [...] # USE_WEBPLUGINS=gecko* -# WEBPLUGINS_DIR=#{PREFIX}/lib/application +# WEBPLUGINS_DIR=${PREFIX}/lib/application # WEBPLUGINS_FILES=fooplugin.so fooplugin.xpi # # .include @@ -155,7 +155,7 @@ .if !defined(WEBPLUGINS_FILES) || ${WEBPLUGINS_FILES} == "empty" || \ ${WEBPLUGINS_FILES} == "" -IGNORE= cannot install: the WEBPLUGINS_FILES is empty, please add plugins file in it and see in www/firefox/Makefile.webplugins for document +IGNORE= can't be installed: WEBPLUGINS_FILES is empty. Please, add plug-in files to it and check www/firefox/Makefile.webplugins for documentation .endif .for _TEMP_APP__ in ${WEBPLUGINS_APPS_ALL} @@ -178,28 +178,28 @@ WEBPLUGINS_SLDIRS= ${USE_WEBPLUGINS_EXP:S.^.${WEBPLUGINS_SLDIR}/.} WEBPLUGINS_LINKFARMS= ${WEBPLUGINS_APPS} ${WEBPLUGINS_SLDIRS} -WEBPLUGINS_LIBDIR= ${PREFIX}/lib/browser_plugins +WEBPLUGINS_LIBDIR= ${LOCALBASE}/lib/browser_plugins WEBPLUGINS_SLDIR= ${WEBPLUGINS_LIBDIR}/symlinks -WEBPLUGINS_DIR?= ${WEBPLUGINS_LIBDIR}/${WEBPLUGINS_NAME} +WEBPLUGINS_DIR?= ${WEBPLUGINS_LIBDIR:S,^${LOCALBASE}/,${PREFIX}/,}/${WEBPLUGINS_NAME} PLIST_SUB+= WEBPLUGINS_DIR="${WEBPLUGINS_DIR:S,^${PREFIX}/,,}" _LNWF= ${WEBPLUGINS_FILES:S,^,${WEBPLUGINS_DIR}/,} _Q= 2>/dev/null || true -_WLD= ${WEBPLUGINS_LIBDIR:S,^${PREFIX},%D,} -_WLF= ${WEBPLUGINS_LINKFARMS:S,${PREFIX},%D,} -_WSD= ${WEBPLUGINS_SLDIR:S,^${PREFIX},%D,} +_WLD= ${WEBPLUGINS_LIBDIR:S,^${LOCALBASE},%D,} +_WLF= ${WEBPLUGINS_LINKFARMS:S,${LOCALBASE},%D,} +_WSD= ${WEBPLUGINS_SLDIR:S,^${LOCALBASE},%D,} webplugins-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)."; \ + ${ECHO_CMD} "ERROR: \"${WEBPLUGINS_DIR}\" in WEBPLUGINS_DIR is either a typo or no longer exists. Please, file a bug report to ${MAINTAINER} (maintainer)."; \ ${ECHO_CMD}; \ else \ for _f in ${WEBPLUGINS_FILES}; do \ if [ ! -f ${WEBPLUGINS_DIR}/$${_f} ]; then \ ${ECHO_CMD}; \ - ${ECHO_CMD} "ERROR: The \"$${_f}\" in WEBPLUGINS_FILES is either a typo or no longer exists. Please make a bug report to ${MAINTAINER} (maintainer)."; \ + ${ECHO_CMD} "ERROR: \"$${_f}\" in WEBPLUGINS_FILES is either a typo or no longer exists. Please, file a bug report to ${MAINTAINER} (maintainer)."; \ ${ECHO_CMD}; \ fi; \ done; \ @@ -210,6 +210,10 @@ ${LN} -sf $${_l} $${_d}/ ${_Q}; \ done; \ done; \ + if [ "${PREFIX}" != "${LOCALBASE}" ]; then \ + ${ECHO_CMD} "@unexec rmdir ${_WLD} ${_Q}" >> ${TMPPLIST}; \ + fi; \ + ${ECHO_CMD} "@cwd ${LOCALBASE}" >> ${TMPPLIST}; \ for _d in ${_WLF}; do \ ${ECHO_CMD} "@exec ${INSTALL} -d $$_d" >> ${TMPPLIST}; \ for _l in ${_LNWF}; do \ >Release-Note: >Audit-Trail: >Unformatted: