14
0

Accepting request 492692 from home:TheBlackCat:branches:devel:languages:python

- Implement single-spec version.
- Fix source URL.
- Update to version 10.3.2

OBS-URL: https://build.opensuse.org/request/show/492692
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-keyring?expand=0&rev=57
This commit is contained in:
Todd R
2017-05-03 16:04:18 +00:00
committed by Git OBS Bridge
parent 7de08d7b11
commit b9525e7583
4 changed files with 50 additions and 39 deletions

View File

@@ -16,31 +16,34 @@
#
%bcond_without tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-keyring
Version: 10.2
Version: 10.3.2
Release: 0
Url: https://github.com/jaraco/keyring
Summary: Store and access your passwords safely
License: Python-2.0 and MIT
Group: Development/Languages/Python
Source: https://pypi.io/packages/source/k/keyring/keyring-%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/k/keyring/keyring-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel >= 2.7
BuildRequires: python-setuptools
BuildRequires: python-setuptools_scm >= 1.15.0
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module setuptools_scm >= 1.15.0}
%if %{with tests}
# Test requirements:
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module SecretStorage}
# Python 2 test requirements:
BuildRequires: python-mock
BuildRequires: python-pytest
BuildRequires: python-tox
BuildRequires: python-SecretStorage
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
BuildRequires: python-unittest2
%endif
Requires: python-SecretStorage
Requires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
The Python keyring lib provides a easy way to access the system keyring service
@@ -52,36 +55,26 @@ from python. It can be used in any application that needs safe password storage.
sed -i '/^#!/d' keyring/cli.py
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# update-alternatives
mv %{buildroot}%{_bindir}/keyring %{buildroot}%{_bindir}/keyring-%{py_ver}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
touch %{buildroot}%{_sysconfdir}/alternatives/keyring
ln -sf %{_sysconfdir}/alternatives/keyring %{buildroot}%{_bindir}/keyring
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with tests}
%check
export PYTHONPATH="%{buildroot}%{python_sitelib}:$PYTHONPATH"
py.test
pushd docs
%{python_expand export PYTHONPATH="%{buildroot}%{$python_sitelib}"
py.test-%{$python_bin_suffix} --pyargs keyring.tests
}
popd
%endif
%post
update-alternatives \
--install %{_bindir}/keyring keyring %{_bindir}/keyring-%{py_ver} 20
%postun
if [ $1 -eq 0 ] ; then
update-alternatives --remove keyring %{_bindir}/keyring-%{py_ver}
fi
%files
%files %{python_files}
%defattr(-,root,root)
%doc README.rst CHANGES.rst
%ghost %{_sysconfdir}/alternatives/keyring
%{_bindir}/keyring
%{_bindir}/keyring-%{py_ver}
%{python_sitelib}/*
%python3_only %{_bindir}/keyring
%{python_sitelib}/keyring-%{version}-py*.egg-info
%{python_sitelib}/keyring/
%changelog