diff --git a/.gitignore b/.gitignore index e69de29..20cb476 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/python-gnupg-0.3.5.tar.gz diff --git a/python-gnupg-0.3.5-export.patch b/python-gnupg-0.3.5-export.patch new file mode 100644 index 0000000..411a947 --- /dev/null +++ b/python-gnupg-0.3.5-export.patch @@ -0,0 +1,38 @@ +--- python-gnupg-0.3.5-orig/gnupg.py 2013-08-30 13:10:36.000000000 -0400 ++++ python-gnupg-0.3.5/gnupg.py 2013-12-31 16:31:11.044804846 -0500 +@@ -994,16 +994,22 @@ + self._collect_output(p, result, stdin=p.stdin) + return result + +- def export_keys(self, keyids, secret=False): +- "export the indicated keys. 'keyid' is anything gpg accepts" ++ def export_keys(self, keyids, secret=False, minimal=False, armor=True): ++ "export the indicated keys. 'keyid' is anything gpg accepts. armor=, secret= and minimal= bools can be passed" + which='' ++ eoptions='' ++ earmor='' + if secret: + which='-secret-key' ++ if minimal: ++ eoptions = "--export-options export-minimal" ++ if armor: ++ earmor='--armor' + if _is_sequence(keyids): + keyids = ' '.join([shell_quote(k) for k in keyids]) + else: + keyids = shell_quote(keyids) +- args = ['--armor --export%s %s' % (which, keyids)] ++ args = ['%s --export%s %s %s' % (earmor, which, eoptions, keyids)] + p = self._open_subprocess(args) + # gpg --export produces no status-fd output; stdout will be + # empty in case of failure +@@ -1011,7 +1017,8 @@ + result = self.result_map['delete'](self) # any result will do + self._collect_output(p, result, stdin=p.stdin) + logger.debug('export_keys result: %r', result.data) +- return result.data.decode(self.encoding, self.decode_errors) ++ #return result.data.decode(self.encoding, self.decode_errors) ++ return result.data + + def list_keys(self, secret=False): + """ list the keys currently in the keyring diff --git a/python-gnupg.spec b/python-gnupg.spec new file mode 100644 index 0000000..71dcdbb --- /dev/null +++ b/python-gnupg.spec @@ -0,0 +1,51 @@ +Name: python-gnupg +Version: 0.3.5 +Release: 4%{?dist} +Summary: Python module for GnuPG +Group: Development/Languages +License: BSD +URL: http://pythonhosted.org/python-gnupg/ +Source0: http://python-gnupg.googlecode.com/files/%{name}-%{version}.tar.gz +BuildArch: noarch +BuildRequires: python2-devel +Requires: gnupg +# Patch required for raw (non-ascii) key exports - required for hash-slinger's use +# submitted to upstream: http://code.google.com/p/python-gnupg/issues/detail?id=94 +Patch1: python-gnupg-0.3.5-export.patch + +%description +GnuPG bindings for python. This uses the gpg command. + +%prep +%setup -q +%patch1 -p1 + +%build +%{__python2} setup.py build +mv README README.org +tr -d '\r' < README.org > README + +%install +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} + +%files +%doc PKG-INFO LICENSE README +%{python_sitelib}/gnupg*.py* +%{python_sitelib}/python_gnupg-%{version}-py*.egg-info + +%changelog +* Mon Jan 06 2014 Paul Wouters - 0.3.5-4 +- Require gnupg (duh) +- Remove cleaning in install target +- Fix license to BSD +- Link to upstream bug tracker for included patch + +* Sat Jan 04 2014 Paul Wouters - 0.3.5-3 +- Remove unused global, fix python macro, buildroot macro +- Converted README from DOS to unix (and reported upstream) + +* Tue Dec 31 2013 Paul Wouters - 0.3.5-2 +- Added minimal= and armor= options to export_keys() + +* Sun Dec 22 2013 Paul Wouters - 0.3.5-1 +- Initial package diff --git a/sources b/sources index e69de29..9aa0b17 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +f9325f1aa54af17d9f98e6fb2d36ae63 python-gnupg-0.3.5.tar.gz