]>
Commit | Line | Data |
---|---|---|
9377d2b6 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
264e352d | 4 | %bcond_without tests # py.test tests |
9377d2b6 JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
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} |
264e352d | 12 | Version: 10.3.2 |
aa5ca449 | 13 | Release: 2 |
9377d2b6 JB |
14 | License: MIT, PSF |
15 | Group: Libraries/Python | |
264e352d JB |
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 | |
9377d2b6 | 19 | URL: https://pypi.python.org/pypi/keyring |
9377d2b6 JB |
20 | %if %{with python2} |
21 | BuildRequires: python-devel >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
81bd6d7f | 23 | BuildRequires: python-setuptools_scm >= 1.15.0 |
9377d2b6 JB |
24 | %if %{with tests} |
25 | BuildRequires: python-pytest >= 2.8 | |
81bd6d7f | 26 | BuildRequires: python-secretstorage |
9377d2b6 JB |
27 | %endif |
28 | %endif | |
29 | %if %{with python3} | |
81bd6d7f | 30 | BuildRequires: python3-devel >= 1:3.3 |
9377d2b6 | 31 | BuildRequires: python3-setuptools |
81bd6d7f | 32 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
9377d2b6 JB |
33 | %if %{with tests} |
34 | BuildRequires: python3-pytest >= 2.8 | |
81bd6d7f | 35 | BuildRequires: python3-secretstorage |
9377d2b6 JB |
36 | %endif |
37 | %endif | |
38 | %if %{with doc} | |
39 | BuildRequires: python3-Sphinx | |
40 | BuildRequires: python3-rst.linker | |
41 | %endif | |
81bd6d7f JB |
42 | BuildRequires: rpm-pythonprov |
43 | BuildRequires: rpmbuild(macros) >= 1.714 | |
9377d2b6 JB |
44 | Requires: python-modules >= 1:2.7 |
45 | # kwalletd5 through dbus | |
46 | Suggests: python-dbus | |
5f9ca321 ER |
47 | Obsoletes: python-keyring-gnome < 0.5.1 |
48 | Obsoletes: python-keyring-kwallet < 0.5.1 | |
49 | BuildArch: noarch | |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
51 | ||
52 | %description | |
9377d2b6 JB |
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. | |
56 | ||
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ł. | |
61 | ||
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 | |
68 | Suggests: python-dbus | |
9377d2b6 JB |
69 | |
70 | %description -n python3-%{module} | |
5f9ca321 | 71 | The Python keyring lib provides a easy way to access the system |
9377d2b6 | 72 | keyring service from Python. It can be used in any application that |
5f9ca321 ER |
73 | needs safe password storage. |
74 | ||
9377d2b6 JB |
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ł. | |
79 | ||
80 | %package apidocs | |
81 | Summary: API documentation for Python keyring library | |
82 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring | |
83 | Group: Documentation | |
84 | ||
85 | %description apidocs | |
86 | API documentation for Python keyring library. | |
87 | ||
88 | %description apidocs -l pl.UTF-8 | |
89 | Dokumentacja API biblioteki Pythona keyring. | |
5f9ca321 ER |
90 | |
91 | %prep | |
92 | %setup -q -n %{module}-%{version} | |
93 | ||
94 | %build | |
9377d2b6 | 95 | %if %{with python2} |
81bd6d7f JB |
96 | %py_build |
97 | ||
264e352d | 98 | %{?with_tests:PYTHON_PATH=$(pwd)/build-2/lib %{__python} -m pytest tests keyring/tests} |
9377d2b6 JB |
99 | %endif |
100 | ||
101 | %if %{with python3} | |
81bd6d7f JB |
102 | %py3_build %{?with_doc:build_sphinx} |
103 | ||
264e352d | 104 | %{?with_tests:PYTHON_PATH=$(pwd)/build-3/lib %{__python3} -m pytest tests keyring/tests} |
9377d2b6 | 105 | %endif |
5f9ca321 ER |
106 | |
107 | %install | |
108 | rm -rf $RPM_BUILD_ROOT | |
5f9ca321 | 109 | |
9377d2b6 JB |
110 | %if %{with python3} |
111 | %py3_install | |
5f9ca321 | 112 | |
aa5ca449 JB |
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 | |
9377d2b6 JB |
115 | # "keyring" name is too generic, add -py[version] suffix |
116 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3} | |
117 | %endif | |
118 | ||
119 | %if %{with python2} | |
120 | %py_install | |
5f9ca321 ER |
121 | |
122 | %py_postclean | |
aa5ca449 JB |
123 | |
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 | |
9377d2b6 JB |
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 | |
129 | %endif | |
5f9ca321 ER |
130 | |
131 | %clean | |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
9377d2b6 | 134 | %if %{with python2} |
5f9ca321 ER |
135 | %files |
136 | %defattr(644,root,root,755) | |
9377d2b6 JB |
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 | |
142 | %endif | |
143 | ||
144 | %if %{with python3} | |
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 | |
151 | %endif | |
152 | ||
153 | %if %{with python3} && %{with doc} | |
154 | %files apidocs | |
155 | %defattr(644,root,root,755) | |
156 | %doc build-3/sphinx/html/{_static,*.html,*.js} | |
157 | %endif |