3 %bcond_without doc # Sphinx documentation
4 %bcond_with tests # test target [broken with \--build-base]
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 Source0: https://pypi.python.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
17 # Source0-md5: 7b88030ba5936e95b71c04a069ba111c
18 URL: https://pypi.python.org/pypi/keyring
19 BuildRequires: rpmbuild(macros) >= 1.710
21 BuildRequires: python-devel >= 1:2.7
22 BuildRequires: python-setuptools
23 BuildRequires: python-setuptools_scm >= 1.9
25 BuildRequires: python-pytest >= 2.8
26 BuildRequires: python-pytest-runner
30 BuildRequires: python3-devel >= 1:3.2
31 BuildRequires: python3-setuptools
32 BuildRequires: python3-setuptools_scm >= 1.9
34 BuildRequires: python3-pytest >= 2.8
35 BuildRequires: python3-pytest-runner
39 BuildRequires: python3-Sphinx
40 BuildRequires: python3-rst.linker
42 Requires: python-modules >= 1:2.7
43 # kwalletd5 through dbus
46 Suggests: python-secretstorage
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 Suggests: python-secretstorage
72 %description -n python3-%{module}
73 The Python keyring lib provides a easy way to access the system
74 keyring service from Python. It can be used in any application that
75 needs safe password storage.
77 %description -n python3-%{module} -l pl.UTF-8
78 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
79 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
80 aplikacji wymagającej bezpiecznego przechowywania haseł.
83 Summary: API documentation for Python keyring library
84 Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring
88 API documentation for Python keyring library.
90 %description apidocs -l pl.UTF-8
91 Dokumentacja API biblioteki Pythona keyring.
94 %setup -q -n %{module}-%{version}
98 %py_build %{?with_tests:test}
102 %py3_build %{?with_tests:test} %{?with_doc:build_sphinx}
106 rm -rf $RPM_BUILD_ROOT
111 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
112 # "keyring" name is too generic, add -py[version] suffix
113 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3}
120 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
121 # "keyring" name is too generic, add -py[version] suffix
122 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py2}
123 ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
127 rm -rf $RPM_BUILD_ROOT
131 %defattr(644,root,root,755)
132 %doc CHANGES.rst README.rst
133 %attr(755,root,root) %{_bindir}/keyring-py
134 %attr(755,root,root) %{_bindir}/keyring-py2
135 %{py_sitescriptdir}/keyring
136 %{py_sitescriptdir}/keyring-%{version}-py*.egg-info
140 %files -n python3-%{module}
141 %defattr(644,root,root,755)
142 %doc CHANGES.rst README.rst
143 %attr(755,root,root) %{_bindir}/keyring-py3
144 %{py3_sitescriptdir}/keyring
145 %{py3_sitescriptdir}/keyring-%{version}-py*.egg-info
148 %if %{with python3} && %{with doc}
150 %defattr(644,root,root,755)
151 %doc build-3/sphinx/html/{_static,*.html,*.js}