commit d0d0c98c2142c804e1075068d8d73ba3a327b369
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Tue Sep 25 09:21:57 2018 +0100
Add upstream commit to switch to python2-gpg (rfbz#5032)
nautilus-dropbox.spec | 9 ++-
switch_to_python-gpg.patch | 139 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 146 insertions(+), 2 deletions(-)
---
diff --git a/nautilus-dropbox.spec b/nautilus-dropbox.spec
index ba817d1..a4e6546 100644
--- a/nautilus-dropbox.spec
+++ b/nautilus-dropbox.spec
@@ -1,7 +1,7 @@
Name: nautilus-dropbox
Epoch: 1
Version: 2015.10.28
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: Dropbox extension for Nautilus
License: GPLv3+
URL:
https://www.dropbox.com
@@ -10,6 +10,8 @@ Source:
https://linux.dropbox.com/packages/%{name}-%{version}.tar.bz2
# add 10 second delay to autostart to ensure it loads on session startup
Patch0: add_startup_delay.patch
Patch1: use_python2.patch
+# Based on
https://github.com/dropbox/nautilus-dropbox/commit/e9367206f9b723103362e8...
+Patch2: switch_to_python-gpg.patch
ExclusiveArch: i686 x86_64
@@ -29,7 +31,7 @@ Dropbox extension for nautilus file manager
Summary: Client for Linux
BuildArch: noarch
Requires: pygtk2
-Requires: python2-pygpgme
+Requires: python2-gpg
Requires: hicolor-icon-theme
%description -n dropbox
@@ -67,6 +69,9 @@ desktop-file-validate
%{buildroot}%{_datadir}/applications/dropbox.desktop
%{_libdir}/nautilus/extensions-3.0/libnautilus-dropbox.so
%changelog
+* Tue Sep 25 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 1:2015.10.28-9
+- Add upstream commit to switch to python2-gpg (rfbz#5032)
+
* Sun Aug 19 2018 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1:2015.10.28-8
- Rebuilt for Fedora 29 Mass Rebuild binutils issue
diff --git a/switch_to_python-gpg.patch b/switch_to_python-gpg.patch
new file mode 100644
index 0000000..5f287c2
--- /dev/null
+++ b/switch_to_python-gpg.patch
@@ -0,0 +1,139 @@
+From e9367206f9b723103362e8dd154363517e9a9841 Mon Sep 17 00:00:00 2001
+From: Samer Masterson <samer(a)dropbox.com>
+Date: Tue, 24 Jul 2018 17:46:14 -0700
+Subject: [PATCH] Use python-gpg instead of python-gpgme if it's installed
+
+I think we need to keep gpgme support because we only build a single .deb
+for all the distros we ship to.
+
+I removed python-gpgme from the "Suggests" line in the deb and replaced it
+with python-gpg because I don't think there's harm in suggesting a package
+that doesn't exist for Ubuntu 17.04 and lower.
+
+I didn't touch the rpm because I couldn't figure out if python-gpg exists
+on Fedora. It probably does, but my google-foo is failing me.
+
+Fixes #51
+---
+ dropbox.in | 44 ++++++++++++++++++++++++++++++++------------
+ generate-deb.sh | 2 +-
+ 2 files changed, 33 insertions(+), 13 deletions(-)
+
+diff --git a/dropbox.in b/dropbox.in
+index 30061f3..53e309c 100755
+--- a/dropbox.in
++++ b/dropbox.in
+@@ -40,9 +40,15 @@ import traceback
+ import urllib2
+
+ try:
+- import gpgme
+-except ImportError:
++ import gpg
+ gpgme = None
++except ImportError:
++ gpg = None
++ # Still support gpgme for now. Remove this once we only support 17.10+.
++ try:
++ import gpgme
++ except ImportError:
++ gpgme = None
+
+ from contextlib import closing, contextmanager
+ from posixpath import curdir, sep, pardir, join, abspath, commonprefix
+@@ -50,7 +56,7 @@ from posixpath import curdir, sep, pardir, join, abspath, commonprefix
+ INFO = u"Dropbox is the easiest way to share and store your files online. Want to
learn more? Head to"
+ LINK =
u"https://www.dropbox.com/"
+ WARNING = u"In order to use Dropbox, you must download the proprietary
daemon."
+-GPG_WARNING = u"Note: python-gpgme is not installed, we will not be able to verify
binary signatures."
++GPG_WARNING = u"Note: python-gpg (python-gpgme for Ubuntu 17.04 and lower) is not
installed, we will not be able to verify binary signatures."
+ ERROR_CONNECTING = u"Trouble connecting to Dropbox servers. Maybe your internet
connection is down, or you need to set your http_proxy environment variable."
+ ERROR_SIGNATURE = u"Downloaded binary does not match Dropbox signature, aborting
install."
+
+@@ -67,7 +73,7 @@ DESKTOP_FILE = u"@DESKTOP_FILE_DIR(a)/dropbox.desktop"
+ enc = locale.getpreferredencoding()
+
+ # Available from
https://linux.dropbox.com/fedora/rpm-public-key.asc
+-DROPBOX_PUBLIC_KEY = """
++DROPBOX_PUBLIC_KEY = b"""
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
+ Version: SKS 1.1.0
+
+@@ -179,7 +185,7 @@ def unicode_abspath(path):
+ return
os.path.abspath(path.encode(sys.getfilesystemencoding())).decode(sys.getfilesystemencoding())
+
+ @contextmanager
+-def gpgme_context(keys):
++def gpg_context(keys):
+ gpg_conf_contents = ''
+ _gpghome = tempfile.mkdtemp(prefix='tmp.gpghome')
+
+@@ -188,12 +194,20 @@ def gpgme_context(keys):
+ fp = open(os.path.join(_gpghome, 'gpg.conf'), 'wb')
+ fp.write(gpg_conf_contents)
+ fp.close()
+- ctx = gpgme.Context()
++ if gpg:
++ ctx = gpg.Context()
++ else:
++ ctx = gpgme.Context()
+
+ loaded = []
+ for key_file in keys:
+- result = ctx.import_(key_file)
+- key = ctx.get_key(result.imports[0][0])
++ if gpg:
++ ctx.op_import(key_file.read())
++ result = ctx.op_import_result()
++ key = ctx.get_key(result.imports[0].fpr)
++ else:
++ result = ctx.import_(key_file)
++ key = ctx.get_key(result.imports[0][0])
+ loaded.append(key)
+
+ ctx.signers = loaded
+@@ -207,10 +221,16 @@ class SignatureVerifyError(Exception):
+ pass
+
+ def verify_signature(key_file, sig_file, plain_file):
+- with gpgme_context([key_file]) as ctx:
++ with gpg_context([key_file]) as ctx:
++ if gpg:
++ ctx.op_verify(sig_file.read(), plain_file.read(), None)
++ result = ctx.op_verify_result()
++ return result.signatures[0].status == 0
++ # gpgme exists
+ sigs = ctx.verify(sig_file, plain_file, None)
+ return sigs[0].status == None
+
++
+ def download_file_chunk(url, buf):
+ opener = urllib2.build_opener()
+ opener.addheaders = [('User-Agent',
"DropboxLinuxDownloader/@PACKAGE_VERSION@")]
+@@ -252,7 +272,7 @@ class DownloadState(object):
+ signature.seek(0)
+ self.local_file.seek(0)
+
+- if gpgme:
++ if gpg or gpgme:
+ if not verify_signature(StringIO.StringIO(DROPBOX_PUBLIC_KEY), signature,
self.local_file):
+ raise SignatureVerifyError()
+
+@@ -454,7 +474,7 @@ if GUI_AVAILABLE:
+ self.progress.set_property('width-request', 300)
+
+ self.label = gtk.Label()
+- GPG_WARNING_MSG = (u"\n\n" + GPG_WARNING) if not gpgme else
u""
++ GPG_WARNING_MSG = (u"\n\n" + GPG_WARNING) if not gpg and not
gpgme else u""
+ self.label.set_markup('%s <span foreground="#000099"
underline="single" weight="bold">%s</span>\n\n%s%s' %
(INFO, LINK, WARNING, GPG_WARNING_MSG))
+ self.label.set_line_wrap(True)
+ self.label.set_property('width-request', 300)
+@@ -543,7 +563,7 @@ else:
+ write(save)
+ flush()
+ console_print(u"%s %s\n" % (INFO, LINK))
+- GPG_WARNING_MSG = (u"\n%s" % GPG_WARNING) if not gpgme else
u""
++ GPG_WARNING_MSG = (u"\n%s" % GPG_WARNING) if not gpg and not gpgme
else u""
+
+ if not yes_no_question("%s%s" % (WARNING, GPG_WARNING_MSG)):
+ return