3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # py.test tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without 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}
15 Group: Libraries/Python
16 #Source0Download: https://pypi.python.org/simple/keyring
17 Source0: https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
18 # Source0-md5: 20a2b23488b9da0c248b6c21a5d1154f
19 URL: https://pypi.python.org/pypi/keyring
21 BuildRequires: python-devel >= 1:2.7
22 BuildRequires: python-setuptools
23 BuildRequires: python-setuptools_scm >= 1.15.0
25 BuildRequires: python-pytest >= 2.8
26 BuildRequires: python-secretstorage
30 BuildRequires: python3-devel >= 1:3.3
31 BuildRequires: python3-setuptools
32 BuildRequires: python3-setuptools_scm >= 1.15.0
34 BuildRequires: python3-pytest >= 2.8
35 BuildRequires: python3-secretstorage
39 BuildRequires: python3-Sphinx
40 BuildRequires: python3-rst.linker
42 BuildRequires: rpm-pythonprov
43 BuildRequires: rpmbuild(macros) >= 1.714
44 Requires: python-modules >= 1:2.7
45 # kwalletd5 through dbus
47 Obsoletes: python-keyring-gnome < 0.5.1
48 Obsoletes: python-keyring-kwallet < 0.5.1
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 The Python keyring library provides a easy way to access the system
54 keyring service from Python. It can be used in any application that
55 needs safe password storage.
57 %description -l pl.UTF-8
58 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
59 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
60 aplikacji wymagającej bezpiecznego przechowywania haseł.
62 %package -n python3-%{module}
63 Summary: Python 3 library to access the system keyring service
64 Summary(pl.UTF-8): Biblioteka Pythona 3 do dostępu do systemowego pęku kluczy
65 Group: Libraries/Python
66 Requires: python3-modules >= 1:3.3
67 # kwalletd5 through dbus
70 %description -n python3-%{module}
71 The Python keyring lib provides a easy way to access the system
72 keyring service from Python. It can be used in any application that
73 needs safe password storage.
75 %description -n python3-%{module} -l pl.UTF-8
76 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
77 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
78 aplikacji wymagającej bezpiecznego przechowywania haseł.
81 Summary: API documentation for Python keyring library
82 Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring
86 API documentation for Python keyring library.
88 %description apidocs -l pl.UTF-8
89 Dokumentacja API biblioteki Pythona keyring.
92 %setup -q -n %{module}-%{version}
98 %{?with_tests:PYTHON_PATH=$(pwd)/build-2/lib %{__python} -m pytest tests keyring/tests}
102 %py3_build %{?with_doc:build_sphinx}
104 %{?with_tests:PYTHON_PATH=$(pwd)/build-3/lib %{__python3} -m pytest tests keyring/tests}
108 rm -rf $RPM_BUILD_ROOT
113 # keep base tests classes (for e.g. python-keyrings.alt tests), remove just backends unit tests
114 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/keyring/tests/backends
115 # "keyring" name is too generic, add -py[version] suffix
116 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3}
124 # keep base tests classes (for e.g. python-keyrings.alt tests), remove just backends unit tests
125 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/keyring/tests/backends
126 # "keyring" name is too generic, add -py[version] suffix
127 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py2}
128 ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
132 rm -rf $RPM_BUILD_ROOT
136 %defattr(644,root,root,755)
137 %doc CHANGES.rst README.rst
138 %attr(755,root,root) %{_bindir}/keyring-py
139 %attr(755,root,root) %{_bindir}/keyring-py2
140 %{py_sitescriptdir}/keyring
141 %{py_sitescriptdir}/keyring-%{version}-py*.egg-info
145 %files -n python3-%{module}
146 %defattr(644,root,root,755)
147 %doc CHANGES.rst README.rst
148 %attr(755,root,root) %{_bindir}/keyring-py3
149 %{py3_sitescriptdir}/keyring
150 %{py3_sitescriptdir}/keyring-%{version}-py*.egg-info
153 %if %{with python3} && %{with doc}
155 %defattr(644,root,root,755)
156 %doc build-3/sphinx/html/{_static,*.html,*.js}