From 2470049d182f7a103ca538d68c434744489e410c Mon Sep 17 00:00:00 2001 From: Martin Väth Date: Sat, 28 Jan 2017 09:56:28 +0100 Subject: www-plugins/noscript: Fix palemoon dependency. Create palemoon26 slot --- eclass/ChangeLog | 5 +- eclass/mv_mozextension-r1.eclass | 79 +++++++++++++++++---------- www-plugins/noscript/Manifest | 1 - www-plugins/noscript/noscript-2.9.0.14.ebuild | 23 ++++++++ www-plugins/noscript/noscript-2.9.5.3.ebuild | 7 +++ 5 files changed, 84 insertions(+), 31 deletions(-) create mode 100644 www-plugins/noscript/noscript-2.9.0.14.ebuild diff --git a/eclass/ChangeLog b/eclass/ChangeLog index db783c5f..146e44b5 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,5 +1,5 @@ # ChangeLog for eclass directory -# Copyright 2016 Gentoo Foundation; Distributed under the GPL v2 +# Copyright 2017 Gentoo Foundation; Distributed under the GPL v2 12 May 2012; Martin Väth : Created ChangeLog @@ -52,3 +52,6 @@ 02 Dec 2016; Martin Väth : stardict.eclass: Remove again since it stays in main gentoo repository + + 28 Jan 2017; Martin Väth : + mv_mozextension-r1.eclass: Support override by moz_atom() diff --git a/eclass/mv_mozextension-r1.eclass b/eclass/mv_mozextension-r1.eclass index fe7efdc3..05020849 100644 --- a/eclass/mv_mozextension-r1.eclass +++ b/eclass/mv_mozextension-r1.eclass @@ -1,4 +1,4 @@ -# Copyright 2016 Gentoo Foundation +# Copyright 2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: moz.eclass @@ -99,46 +99,67 @@ moz_install${o} # This is an eclass-generated depend expression needed for moz_unpack to work MOZ_DEPEND='app-arch/unzip' +# @FUNCTION: moz_atom +# @DEFAULTUNSET +# @USAGE: +# Prints the atom/subexpression used in RDEPEND for the corresponding browser, +# e.g. www-client/firefox-bin +# browser is one of (firefox|palemoon|seamonkey)(-source|-bin) +# If nothing is printed, the output of "moz_atom_default " is used. +# moz_atom is meant to be defined by the ebuild if non-defaults are used. + +# @FUNCTION: moz_atom_default +# @USAGE: +# Prints the atom/subexpression used in RDEPEND for the corresponding browser, +# when moz_atom is not defined or prints nothing. +# brower is one of (firefox|palemoon|seamonkey)(-source|-bin) +moz_atom_default() { + echo "www-client/${1%-source}" +} + # @FUNCTION: moz_rdepend # @USAGE: [] [] [...] # @DESCRIPTION: # Outputs RDEPEND expression appropriate for browsers. -# browser is [firefox|palemoon|seamonkey][-source|-bin] (no specified = all) +# browser is (firefox|palemoon|seamonkey)[-source|-bin] (no specified = all) +# Note that moz_rdepend_atom (if defined by the ebuild) is used to calculate +# the expression. moz_rdepend() { - local rdep i c mode - [ ${#} -ne 0 ] || set -- "firefox palemoon seamonkey" - c= + local rdep browser count modes mode atom useflag + [ ${#} -ne 0 ] || set -- firefox palemoon seamonkey + count= rdep= - for i in firefox palemoon seamonkey - do mode= + for browser in firefox palemoon seamonkey + do modes= case ${*} in - *"${i}"?source*) - mode=s;; - *"${i}"?bin*) - mode=b;; - *"${i}"*) - mode=sb;; - esac - case ${mode} in - *s*) - rdep=${rdep}${rdep:+\ }"browser_${i}? ( www-client/${i} )" - c=${c}a;; - esac - case ${mode} in - *b*) - rdep=${rdep}${rdep:+\ }"browser_${i}-bin? ( www-client/${i}-bin )" - c=${c}a;; + *"${browser}"?source*) + modes=source;; + *"${browser}"?bin*) + modes=bin;; + *"${browser}"*) + modes="source bin";; esac + for mode in $modes + do atom= + [ "$(type -t moz_atom)" != "function" ] || \ + atom=`moz_atom "${browser}-${mode}"` + [ -n "$atom" ] || \ + atom=`moz_atom_default "${browser}-${mode}"` + useflag=browser_${browser} + [ "$mode" = "source" ] || useflag=${useflag}-${mode} + rdep=${rdep}${rdep:+\ }"${useflag}? ( ${atom} )" + count=${count}a + done done - [ -n "${c}" ] || die "args must be [firefox|palemoon|seamonkey][-source|-bin]" - [ "${c}" = a ] && echo "${rdep}" || echo "|| ( ${rdep} )" + [ -n "${count}" ] || die "args must be (firefox|palemoon|seamonkey)[-source|-bin]" + [ "${count}" = a ] && echo "${rdep}" || echo "|| ( ${rdep} )" } # @FUNCTION: moz_iuse # @USAGE: [-c|-C|-n] [--] [] [] [...] # @DESCRIPTION: # Outputs IUSE expression appropriate for browsers. -# browser is [firefox|palemoon|seamonkey][-source|-bin] (no specified = all). +# browser is (firefox|palemoon|seamonkey)[-source|-bin] (no specified = all). # If option -C or -n is specified, IUSE=compressed is not default/added. moz_iuse() { local iuse i opt @@ -152,7 +173,7 @@ moz_iuse() { esac done shift $(( ${OPTIND} - 1 )) - [ ${#} -ne 0 ] || set -- "firefox palemoon seamonkey" + [ ${#} -ne 0 ] || set -- firefox palemoon seamonkey for i in firefox palemoon seamonkey do case "${*}" in *"${i}"?source*) @@ -163,7 +184,7 @@ moz_iuse() { iuse=${iuse}${iuse:+\ }"browser_${i} browser_${i}-bin";; esac done - [ -n "${iuse}" ] || die "args must be [firefox|palemoon|seamonkey][-source|-bin]" + [ -n "${iuse}" ] || die "args must be (firefox|palemoon|seamonkey)[-source|-bin]" echo "${iuse}" } @@ -171,7 +192,7 @@ moz_iuse() { # @USAGE: [] [] [...] # @DESCRIPTION: # Outputs REQUIRED_USE expression appropriate for browsers. -# browser is [firefox|palemoon|seamonkey][-source|-bin] (no specified means all) +# browser is (firefox|palemoon|seamonkey)[-source|-bin] (no specified means all) moz_required_use() { set -- $(moz_iuse -n "${@}") [ ${#} -lt 2 ] && echo "${*}" || echo "|| ( ${*} )" diff --git a/www-plugins/noscript/Manifest b/www-plugins/noscript/Manifest index 7c057f6b..4092ae67 100644 --- a/www-plugins/noscript/Manifest +++ b/www-plugins/noscript/Manifest @@ -1,3 +1,2 @@ DIST noscript-2.9.0.14.xpi 564604 SHA256 39bc71be20c318578239ea791c0341dbfcd13b33559af080cea386eeec08b337 -DIST noscript-2.9.5.2.xpi 555628 SHA256 ed71ca922790e81bc5e8c6a87bb81f394a38676ac37d1fba518a6a428d128dd5 DIST noscript-2.9.5.3.xpi 555119 SHA256 ce9779a3a5a2574b958f8e4d079a99d43a8f84193bef52c587c704ed81c2fbbd diff --git a/www-plugins/noscript/noscript-2.9.0.14.ebuild b/www-plugins/noscript/noscript-2.9.0.14.ebuild new file mode 100644 index 00000000..0762e6ef --- /dev/null +++ b/www-plugins/noscript/noscript-2.9.0.14.ebuild @@ -0,0 +1,23 @@ +# Copyright 2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit mv_mozextension-r1 +RESTRICT="mirror" + +DESCRIPTION="Mozilla plugin: Restrict active contents like java/javascript/flash" +HOMEPAGE="http://noscript.net/" +SRC_URI="https://secure.informaction.com/download/releases/${P}.xpi +https://addons.cdn.mozilla.net/user-media/addons/722/noscript_security_suite-${PV}-fx+fn+sm.xpi -> ${P}.xpi" + +LICENSE="GPL-2" +SLOT="palemoon26" +KEYWORDS="~amd64 ~x86" +IUSE="" + +moz_defaults palemoon + +DEPEND="${DEPEND} + browser_palemoon? ( !${CATEGORY}/${PN}:0[browser_palemoon] ) + browser_palemoon-bin? ( !${CATEGORY}/${PN}:0[browser_palemoon-bin] ) +" diff --git a/www-plugins/noscript/noscript-2.9.5.3.ebuild b/www-plugins/noscript/noscript-2.9.5.3.ebuild index 78989104..d8fd685d 100644 --- a/www-plugins/noscript/noscript-2.9.5.3.ebuild +++ b/www-plugins/noscript/noscript-2.9.5.3.ebuild @@ -15,4 +15,11 @@ SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" +moz_atom() { + case $1 in + palemoon*) + echo ">=$(moz_atom_default "$1")-27";; + esac +} + moz_defaults -- cgit v1.2.3-65-gdbad