From bb8b60e2991c21adcd478df75cc0778439b55c68 Mon Sep 17 00:00:00 2001 From: Ratnadeep Debnath Date: Nov 02 2013 10:55:18 +0000 Subject: Update python-keyring to version 3.1 for python2 as well as python3. --- diff --git a/.gitignore b/.gitignore index 5312244..1a5dffb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /keyring-0.4.tar.gz /keyring-0.5.1.tar.gz /keyring-0.7.zip +/keyring-3.1.zip diff --git a/keyring-0.7.patch b/keyring-0.7.patch deleted file mode 100644 index 1f79b5c..0000000 --- a/keyring-0.7.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -uNr keyring-0.7/keyring/backends/osx_keychain.py keyring-0.7_p/keyring/backends/osx_keychain.py ---- keyring-0.7/keyring/backends/osx_keychain.py 2011-10-19 09:23:30.000000000 +0530 -+++ keyring-0.7_p/keyring/backends/osx_keychain.py 2012-01-14 23:11:39.976633258 +0530 -@@ -1,5 +1,3 @@ --#!/usr/bin/python -- - import sys - if sys.platform != 'darwin': - raise ImportError('Mac OS X only module') -diff -uNr keyring-0.7/keyring/backends/win32_crypto.py keyring-0.7_p/keyring/backends/win32_crypto.py ---- keyring-0.7/keyring/backends/win32_crypto.py 2011-10-19 09:23:30.000000000 +0530 -+++ keyring-0.7_p/keyring/backends/win32_crypto.py 2012-01-14 23:12:01.503478652 +0530 -@@ -1,5 +1,3 @@ --#!/usr/bin/python -- - import sys - if sys.platform != 'win32': - raise ImportError('Windows-only module') -diff -uNr keyring-0.7/keyring/cli.py keyring-0.7_p/keyring/cli.py ---- keyring-0.7/keyring/cli.py 2011-11-04 11:09:28.000000000 +0530 -+++ keyring-0.7_p/keyring/cli.py 2012-01-14 23:23:25.817162691 +0530 -@@ -1,4 +1,3 @@ --#!/usr/bin/env python - """Simple command line interface to get/set password from a keyring""" - - import getpass diff --git a/keyring-3.1-fix-cli.patch b/keyring-3.1-fix-cli.patch new file mode 100644 index 0000000..a0df7ff --- /dev/null +++ b/keyring-3.1-fix-cli.patch @@ -0,0 +1,8 @@ +diff -uNr keyring-3.1/keyring/cli.py keyring-3.1p/keyring/cli.py +--- keyring-3.1/keyring/cli.py 2013-11-02 14:07:15.346203614 +0530 ++++ keyring-3.1p/keyring/cli.py 2013-11-02 14:07:43.905181182 +0530 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + """Simple command line interface to get/set password from a keyring""" + + from __future__ import print_function diff --git a/python-keyring.spec b/python-keyring.spec index 4bd1335..ec03231 100644 --- a/python-keyring.spec +++ b/python-keyring.spec @@ -1,17 +1,25 @@ -%global upstream_name keyring +%if 0%{?fedora} > 12 +%global with_python3 1 +%endif + +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: python-keyring -Version: 0.7 +Version: 3.1 Release: 1%{?dist} Summary: Python library to access the system keyring service -Source0: http://pypi.python.org/packages/source/k/keyring/%{upstream_name}-%{version}.zip -Patch0: keyring-%{version}.patch +Source0: http://pypi.python.org/packages/source/k/keyring/keyring-%{version}.zip +Patch0: keyring-3.1-fix-cli.patch License: Python Group: Development/Libraries URL: http://pypi.python.org/pypi/keyring BuildArch: noarch BuildRequires: python-devel +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%endif Obsoletes: %{name}-kwallet < %{version} Obsoletes: %{name}-gnome < %{version} Obsoletes: %{name} < %{version} @@ -21,19 +29,47 @@ The Python keyring lib provides a easy way to access the system keyring service from python. It can be used in any application that needs safe password storage. -This package only provides file-based pseudo-keyrings. To interface with -gnome-keyring or KWallet, please install one of python-keyring-gnome or -python-keyring-kwallet. +%if 0%{?with_python3} +%package -n python3-keyring +Summary: Python library to access the system keyring service for Python 3 +Group: Development/Libraries + +%description -n python3-keyring +The Python keyring lib provides a easy way to access the system keyring +service from python. It can be used in any application that needs safe +password storage. +%endif %prep -%setup -q -n %{upstream_name}-%{version} +%setup -q -n keyring-%{version} %patch0 -p1 +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + + %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +CFLAGS="${RPM_OPT_FLAGS}" %{__python3} setup.py build +popd +%endif + + %install -%{__rm} -rf $RPM_BUILD_ROOT -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +cp %{buildroot}/%{_bindir}/keyring %{buildroot}/%{_bindir}/python3-keyring +popd +%endif + +%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT + %clean %{__rm} -rf $RPM_BUILD_ROOT @@ -41,11 +77,30 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build %files %defattr(-,root,root,-) -%doc README demo -%{python_sitelib}/%{upstream_name} -%{python_sitelib}/%{upstream_name}-*.egg-info +%doc README.rst CHANGES.rst CONTRIBUTORS.txt demo +%{_bindir}/keyring +%{python_sitelib}/keyring +%{python_sitelib}/keyring-*.egg-info + +%if 0%{?with_python3} +%files -n python3-keyring +%defattr(-,root,root,-) +%{_bindir}/python3-keyring +%doc README.rst CHANGES.rst CONTRIBUTORS.txt demo +%{python3_sitelib}/* +%endif + %changelog +* Tue Oct 22 2013 rtnpro - 3.1-1 +- Bump to version 3.1 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Jul 21 2012 Fedora Release Engineering - 0.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Sat Jan 14 2012 rtnpro 0.7-1 - Python 3 is now supported. All tests now pass under Python 3.2 on Windows and Linux (although Linux backend support is limited). Fixes #28. diff --git a/sources b/sources index 6cdb13e..f235d30 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -084f0c7aba79dbf072599cc14d91c59a keyring-0.7.zip +3c82a11101a61d0e51624b41e09888b3 keyring-3.1.zip