]>
Commit | Line | Data |
---|---|---|
9377d2b6 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
264e352d | 4 | %bcond_without tests # py.test tests |
9377d2b6 | 5 | %bcond_without python2 # CPython 2.x module |
247be001 | 6 | %bcond_with python3 # CPython 3.x module |
9377d2b6 | 7 | |
5f9ca321 | 8 | %define module keyring |
9377d2b6 JB |
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 | |
5f9ca321 | 11 | Name: python-%{module} |
bc84d0b6 JB |
12 | # keep 18.x here for python2 support |
13 | Version: 18.0.1 | |
91abb1fc | 14 | Release: 4 |
9377d2b6 JB |
15 | License: MIT, PSF |
16 | Group: Libraries/Python | |
264e352d JB |
17 | #Source0Download: https://pypi.python.org/simple/keyring |
18 | Source0: https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz | |
bc84d0b6 | 19 | # Source0-md5: 00cdec34da9c15ad804441979b70830b |
9377d2b6 | 20 | URL: https://pypi.python.org/pypi/keyring |
9377d2b6 JB |
21 | %if %{with python2} |
22 | BuildRequires: python-devel >= 1:2.7 | |
23 | BuildRequires: python-setuptools | |
81bd6d7f | 24 | BuildRequires: python-setuptools_scm >= 1.15.0 |
9377d2b6 | 25 | %if %{with tests} |
bc84d0b6 | 26 | BuildRequires: python-entrypoints |
9377d2b6 | 27 | BuildRequires: python-pytest >= 2.8 |
bc84d0b6 | 28 | BuildRequires: python-pytest-flake8 |
81bd6d7f | 29 | BuildRequires: python-secretstorage |
9377d2b6 JB |
30 | %endif |
31 | %endif | |
32 | %if %{with python3} | |
81bd6d7f | 33 | BuildRequires: python3-devel >= 1:3.3 |
9377d2b6 | 34 | BuildRequires: python3-setuptools |
81bd6d7f | 35 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
9377d2b6 | 36 | %if %{with tests} |
bc84d0b6 | 37 | BuildRequires: python3-entrypoints |
9377d2b6 | 38 | BuildRequires: python3-pytest >= 2.8 |
bc84d0b6 | 39 | BuildRequires: python3-pytest-flake8 |
81bd6d7f | 40 | BuildRequires: python3-secretstorage |
9377d2b6 JB |
41 | %endif |
42 | %endif | |
43 | %if %{with doc} | |
bc84d0b6 JB |
44 | BuildRequires: python-Sphinx |
45 | BuildRequires: python-jaraco.packaging >= 3.2 | |
46 | BuildRequires: python-rst.linker >= 1.9 | |
9377d2b6 | 47 | %endif |
81bd6d7f JB |
48 | BuildRequires: rpm-pythonprov |
49 | BuildRequires: rpmbuild(macros) >= 1.714 | |
9377d2b6 JB |
50 | Requires: python-modules >= 1:2.7 |
51 | # kwalletd5 through dbus | |
52 | Suggests: python-dbus | |
5f9ca321 ER |
53 | Obsoletes: python-keyring-gnome < 0.5.1 |
54 | Obsoletes: python-keyring-kwallet < 0.5.1 | |
55 | BuildArch: noarch | |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
57 | ||
58 | %description | |
9377d2b6 JB |
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. | |
62 | ||
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ł. | |
67 | ||
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 | |
74 | Suggests: python-dbus | |
9377d2b6 JB |
75 | |
76 | %description -n python3-%{module} | |
5f9ca321 | 77 | The Python keyring lib provides a easy way to access the system |
9377d2b6 | 78 | keyring service from Python. It can be used in any application that |
5f9ca321 ER |
79 | needs safe password storage. |
80 | ||
9377d2b6 JB |
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ł. | |
85 | ||
86 | %package apidocs | |
87 | Summary: API documentation for Python keyring library | |
88 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring | |
89 | Group: Documentation | |
90 | ||
91 | %description apidocs | |
92 | API documentation for Python keyring library. | |
93 | ||
94 | %description apidocs -l pl.UTF-8 | |
95 | Dokumentacja API biblioteki Pythona keyring. | |
5f9ca321 ER |
96 | |
97 | %prep | |
98 | %setup -q -n %{module}-%{version} | |
99 | ||
100 | %build | |
9377d2b6 | 101 | %if %{with python2} |
bc84d0b6 | 102 | %py_build %{?with_doc:build_sphinx} |
81bd6d7f | 103 | |
bc84d0b6 JB |
104 | %if %{with tests} |
105 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
106 | PYTEST_PLUGINS="pytest_flake8" \ | |
107 | PYTHONPATH=$(pwd)/build-2/lib \ | |
108 | %{__python} -m pytest tests keyring/tests | |
109 | %endif | |
9377d2b6 JB |
110 | %endif |
111 | ||
112 | %if %{with python3} | |
bc84d0b6 | 113 | %py3_build |
81bd6d7f | 114 | |
bc84d0b6 JB |
115 | %if %{with 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 | |
120 | %endif | |
9377d2b6 | 121 | %endif |
5f9ca321 ER |
122 | |
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
5f9ca321 | 125 | |
9377d2b6 JB |
126 | %if %{with python3} |
127 | %py3_install | |
5f9ca321 | 128 | |
aa5ca449 JB |
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 | |
9377d2b6 JB |
131 | # "keyring" name is too generic, add -py[version] suffix |
132 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3} | |
133 | %endif | |
134 | ||
135 | %if %{with python2} | |
136 | %py_install | |
5f9ca321 ER |
137 | |
138 | %py_postclean | |
aa5ca449 JB |
139 | |
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 | |
9377d2b6 JB |
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 | |
145 | %endif | |
5f9ca321 ER |
146 | |
147 | %clean | |
148 | rm -rf $RPM_BUILD_ROOT | |
149 | ||
9377d2b6 | 150 | %if %{with python2} |
5f9ca321 ER |
151 | %files |
152 | %defattr(644,root,root,755) | |
9377d2b6 JB |
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 | |
158 | %endif | |
159 | ||
160 | %if %{with python3} | |
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 | |
167 | %endif | |
168 | ||
bc84d0b6 | 169 | %if %{with python2} && %{with doc} |
9377d2b6 JB |
170 | %files apidocs |
171 | %defattr(644,root,root,755) | |
bc84d0b6 | 172 | %doc build-2/sphinx/html/{_static,*.html,*.js} |
9377d2b6 | 173 | %endif |