commit:     573341008f21c6d1d406e91b70d541a451fac9cb
Author:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 23 19:33:13 2017 +0000
Commit:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
CommitDate: Thu Nov 23 19:33:23 2017 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=57334100

enigmail: make extension installation fully standalone

This change in the installation method allows thunderbird and seamonkey
to load enigmail without the need for any compile-time (and therefore
use-flag) dependency.

 ...l-1.9.8.3.ebuild => enigmail-1.9.8.3-r1.ebuild} | 24 +++++++++++++++++++---
 x11-plugins/enigmail/enigmail-9999.ebuild          | 19 +++++++++++++++--
 2 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/x11-plugins/enigmail/enigmail-1.9.8.3.ebuild 
b/x11-plugins/enigmail/enigmail-1.9.8.3-r1.ebuild
similarity index 61%
rename from x11-plugins/enigmail/enigmail-1.9.8.3.ebuild
rename to x11-plugins/enigmail/enigmail-1.9.8.3-r1.ebuild
index ff5e7f5..ac2762a 100644
--- a/x11-plugins/enigmail/enigmail-1.9.8.3.ebuild
+++ b/x11-plugins/enigmail/enigmail-1.9.8.3-r1.ebuild
@@ -24,7 +24,10 @@ RDEPEND="|| (
                        )
                )
                =app-crypt/gnupg-1.4*
-       )"
+       )
+       !<=mail-client/thunderbird-52.5.0
+       !<=mail-client/thunderbird-2.49.5.0_p0
+       "
 DEPEND="${RDEPEND}
        ${PYTHON_DEPS}
        app-arch/zip
@@ -40,8 +43,18 @@ src_compile() {
 }
 
 src_install() {
-       insinto /usr/share/${PN}
-       doins -r 
build/dist/{chrome,components,defaults,modules,wrappers,chrome.manifest,install.rdf}
+       local emid=$(sed -n '/<em:id>/!d; s/.*\({.*}\).*/\1/; p; q' 
build/dist/install.rdf)
+       [[ -n ${emid} ]] || die "Could not scrape EM:ID from install.rdf"
+
+       mv build/enigmail*.xpi build/"${emid}.xpi" || die 'Could not rename XPI 
to match EM:ID'
+
+       # thunderbird
+       insinto 
"/usr/share/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}"
+       doins build/"${emid}.xpi"
+
+       # seamonkey
+       insinto 
"/usr/share/mozilla/extensions/{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"
+       doins build/"${emid}.xpi"
 }
 
 pkg_postinst() {
@@ -53,4 +66,9 @@ pkg_postinst() {
                ewarn "Please use 'eselect pinentry' to select either the gtk 
or qt front-end"
                ;;
        esac
+       if [[ -n ${REPLACING_VERSIONS} ]]; then
+               elog ""
+               elog "Please restart thunderbird and/or seamonkey in order for 
them to use"
+               elog "the newly installed version of enigmail."
+       fi
 }

diff --git a/x11-plugins/enigmail/enigmail-9999.ebuild 
b/x11-plugins/enigmail/enigmail-9999.ebuild
index edffcc2..ec95bc9 100644
--- a/x11-plugins/enigmail/enigmail-9999.ebuild
+++ b/x11-plugins/enigmail/enigmail-9999.ebuild
@@ -44,8 +44,18 @@ src_compile() {
 }
 
 src_install() {
-       insinto /usr/share/${PN}
-       doins -r 
build/dist/{chrome,components,defaults,modules,wrappers,chrome.manifest,install.rdf}
+       local emid=$(sed -n '/<em:id>/!d; s/.*\({.*}\).*/\1/; p; q' 
build/dist/install.rdf)
+       [[ -n ${emid} ]] || die "Could not scrape EM:ID from install.rdf"
+
+       mv build/enigmail*.xpi build/"${emid}.xpi" || die 'Could not rename XPI 
to match EM:ID'
+
+       # thunderbird
+       insinto 
"/usr/share/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}"
+       doins build/"${emid}.xpi"
+
+       # seamonkey
+       insinto 
"/usr/share/mozilla/extensions/{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"
+       doins build/"${emid}.xpi"
 }
 
 pkg_postinst() {
@@ -57,4 +67,9 @@ pkg_postinst() {
                ewarn "Please use 'eselect pinentry' to select either the gtk 
or qt front-end"
                ;;
        esac
+       if [[ -n ${REPLACING_VERSIONS} ]]; then
+               elog
+               elog "Please restart thunderbird and/or seamonkey in order for 
them to use"
+               elog "the newly installed version of enigmail."
+       fi
 }

Reply via email to