3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # py.test tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_with python3 # CPython 3.x module
9 Summary: Python 2 library to access the system keyring service
10 Summary(pl.UTF-8): Biblioteka Pythona 2 do dostępu do systemowego pęku kluczy
11 Name: python-%{module}
12 # keep 18.x here for python2 support
16 Group: Libraries/Python
17 #Source0Download: https://pypi.python.org/simple/keyring
18 Source0: https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
19 # Source0-md5: 00cdec34da9c15ad804441979b70830b
20 URL: https://pypi.python.org/pypi/keyring
22 BuildRequires: python-devel >= 1:2.7
23 BuildRequires: python-setuptools
24 BuildRequires: python-setuptools_scm >= 1.15.0
26 BuildRequires: python-entrypoints
27 BuildRequires: python-pytest >= 2.8
28 BuildRequires: python-pytest-flake8
29 BuildRequires: python-secretstorage
33 BuildRequires: python3-devel >= 1:3.3
34 BuildRequires: python3-setuptools
35 BuildRequires: python3-setuptools_scm >= 1.15.0
37 BuildRequires: python3-entrypoints
38 BuildRequires: python3-pytest >= 2.8
39 BuildRequires: python3-pytest-flake8
40 BuildRequires: python3-secretstorage
44 BuildRequires: python-Sphinx
45 BuildRequires: python-jaraco.packaging >= 3.2
46 BuildRequires: python-rst.linker >= 1.9
48 BuildRequires: rpm-pythonprov
49 BuildRequires: rpmbuild(macros) >= 1.714
50 Requires: python-modules >= 1:2.7
51 # kwalletd5 through dbus
53 Obsoletes: python-keyring-gnome < 0.5.1
54 Obsoletes: python-keyring-kwallet < 0.5.1
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 The Python keyring library provides a easy way to access the system
60 keyring service from Python. It can be used in any application that
61 needs safe password storage.
63 %description -l pl.UTF-8
64 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
65 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
66 aplikacji wymagającej bezpiecznego przechowywania haseł.
68 %package -n python3-%{module}
69 Summary: Python 3 library to access the system keyring service
70 Summary(pl.UTF-8): Biblioteka Pythona 3 do dostępu do systemowego pęku kluczy
71 Group: Libraries/Python
72 Requires: python3-modules >= 1:3.3
73 # kwalletd5 through dbus
76 %description -n python3-%{module}
77 The Python keyring lib provides a easy way to access the system
78 keyring service from Python. It can be used in any application that
79 needs safe password storage.
81 %description -n python3-%{module} -l pl.UTF-8
82 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
83 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
84 aplikacji wymagającej bezpiecznego przechowywania haseł.
87 Summary: API documentation for Python keyring library
88 Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring
92 API documentation for Python keyring library.
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API biblioteki Pythona keyring.
98 %setup -q -n %{module}-%{version}
102 %py_build %{?with_doc:build_sphinx}
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTEST_PLUGINS="pytest_flake8" \
107 PYTHONPATH=$(pwd)/build-2/lib \
108 %{__python} -m pytest tests keyring/tests
116 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117 PYTEST_PLUGINS="pytest_flake8" \
118 PYTHONPATH=$(pwd)/build-3/lib \
119 %{__python3} -m pytest tests keyring/tests
124 rm -rf $RPM_BUILD_ROOT
129 # keep base tests classes (for e.g. python-keyrings.alt tests), remove just backends unit tests
130 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/keyring/tests/backends
131 # "keyring" name is too generic, add -py[version] suffix
132 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3}
140 # keep base tests classes (for e.g. python-keyrings.alt tests), remove just backends unit tests
141 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/keyring/tests/backends
142 # "keyring" name is too generic, add -py[version] suffix
143 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py2}
144 ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
148 rm -rf $RPM_BUILD_ROOT
152 %defattr(644,root,root,755)
153 %doc CHANGES.rst README.rst
154 %attr(755,root,root) %{_bindir}/keyring-py
155 %attr(755,root,root) %{_bindir}/keyring-py2
156 %{py_sitescriptdir}/keyring
157 %{py_sitescriptdir}/keyring-%{version}-py*.egg-info
161 %files -n python3-%{module}
162 %defattr(644,root,root,755)
163 %doc CHANGES.rst README.rst
164 %attr(755,root,root) %{_bindir}/keyring-py3
165 %{py3_sitescriptdir}/keyring
166 %{py3_sitescriptdir}/keyring-%{version}-py*.egg-info
169 %if %{with python2} && %{with doc}
171 %defattr(644,root,root,755)
172 %doc build-2/sphinx/html/{_static,*.html,*.js}