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/d2/2f/b70bf3068b5964e4c45507e03652da0743c72460ff929e70aef201ed5ffb/%{module}-%{version}.tar.gz
17 # Source0-md5: 8a6a4617a70c8776da24a02fb63b3ecd
18 URL: https://pypi.python.org/pypi/keyring
20 BuildRequires: python-devel >= 1:2.7
21 BuildRequires: python-setuptools
22 BuildRequires: python-setuptools_scm >= 1.15.0
24 BuildRequires: python-pytest >= 2.8
25 BuildRequires: python-secretstorage
29 BuildRequires: python3-devel >= 1:3.3
30 BuildRequires: python3-setuptools
31 BuildRequires: python3-setuptools_scm >= 1.15.0
33 BuildRequires: python3-pytest >= 2.8
34 BuildRequires: python3-secretstorage
38 BuildRequires: python3-Sphinx
39 BuildRequires: python3-rst.linker
41 BuildRequires: rpm-pythonprov
42 BuildRequires: rpmbuild(macros) >= 1.714
43 Requires: python-modules >= 1:2.7
44 # kwalletd5 through dbus
46 Obsoletes: python-keyring-gnome < 0.5.1
47 Obsoletes: python-keyring-kwallet < 0.5.1
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 The Python keyring library provides a easy way to access the system
53 keyring service from Python. It can be used in any application that
54 needs safe password storage.
56 %description -l pl.UTF-8
57 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
58 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
59 aplikacji wymagającej bezpiecznego przechowywania haseł.
61 %package -n python3-%{module}
62 Summary: Python 3 library to access the system keyring service
63 Summary(pl.UTF-8): Biblioteka Pythona 3 do dostępu do systemowego pęku kluczy
64 Group: Libraries/Python
65 Requires: python3-modules >= 1:3.3
66 # kwalletd5 through dbus
69 %description -n python3-%{module}
70 The Python keyring lib provides a easy way to access the system
71 keyring service from Python. It can be used in any application that
72 needs safe password storage.
74 %description -n python3-%{module} -l pl.UTF-8
75 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
76 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
77 aplikacji wymagającej bezpiecznego przechowywania haseł.
80 Summary: API documentation for Python keyring library
81 Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring
85 API documentation for Python keyring library.
87 %description apidocs -l pl.UTF-8
88 Dokumentacja API biblioteki Pythona keyring.
91 %setup -q -n %{module}-%{version}
97 %{?with_tests:%{__python} -m pytest}
101 %py3_build %{?with_doc:build_sphinx}
103 %{?with_tests:%{__python3} -m pytest}
107 rm -rf $RPM_BUILD_ROOT
112 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
113 # "keyring" name is too generic, add -py[version] suffix
114 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3}
121 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
122 # "keyring" name is too generic, add -py[version] suffix
123 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py2}
124 ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
128 rm -rf $RPM_BUILD_ROOT
132 %defattr(644,root,root,755)
133 %doc CHANGES.rst README.rst
134 %attr(755,root,root) %{_bindir}/keyring-py
135 %attr(755,root,root) %{_bindir}/keyring-py2
136 %{py_sitescriptdir}/keyring
137 %{py_sitescriptdir}/keyring-%{version}-py*.egg-info
141 %files -n python3-%{module}
142 %defattr(644,root,root,755)
143 %doc CHANGES.rst README.rst
144 %attr(755,root,root) %{_bindir}/keyring-py3
145 %{py3_sitescriptdir}/keyring
146 %{py3_sitescriptdir}/keyring-%{version}-py*.egg-info
149 %if %{with python3} && %{with doc}
151 %defattr(644,root,root,755)
152 %doc build-3/sphinx/html/{_static,*.html,*.js}