]>
Commit | Line | Data |
---|---|---|
9377d2b6 JB |
1 | # |
2 | # Conditional build: | |
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 | |
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} |
18818f06 | 12 | Version: 9.3.1 |
3a0a2f96 | 13 | Release: 2 |
9377d2b6 JB |
14 | License: MIT, PSF |
15 | Group: Libraries/Python | |
18818f06 JP |
16 | Source0: https://pypi.python.org/packages/7e/84/65816c2936cf7191bcb5b3e3dc4fb87def6f8a38be25b3a78131bbb08594/%{module}-%{version}.tar.gz |
17 | # Source0-md5: 934aad9f3cdcc860029a0122fb5f67bb | |
9377d2b6 | 18 | URL: https://pypi.python.org/pypi/keyring |
4c3e8d6c | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
9377d2b6 JB |
20 | %if %{with python2} |
21 | BuildRequires: python-devel >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
23 | BuildRequires: python-setuptools_scm >= 1.9 | |
24 | %if %{with tests} | |
25 | BuildRequires: python-pytest >= 2.8 | |
26 | BuildRequires: python-pytest-runner | |
27 | %endif | |
28 | %endif | |
29 | %if %{with python3} | |
30 | BuildRequires: python3-devel >= 1:3.2 | |
31 | BuildRequires: python3-setuptools | |
32 | BuildRequires: python3-setuptools_scm >= 1.9 | |
33 | %if %{with tests} | |
34 | BuildRequires: python3-pytest >= 2.8 | |
35 | BuildRequires: python3-pytest-runner | |
36 | %endif | |
37 | %endif | |
38 | %if %{with doc} | |
39 | BuildRequires: python3-Sphinx | |
40 | BuildRequires: python3-rst.linker | |
41 | %endif | |
42 | Requires: python-modules >= 1:2.7 | |
43 | # kwalletd5 through dbus | |
44 | Suggests: python-dbus | |
45 | # SecretService | |
46 | Suggests: python-secretstorage | |
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 | |
69 | # SecretService | |
70 | Suggests: python-secretstorage | |
71 | ||
72 | %description -n python3-%{module} | |
5f9ca321 | 73 | The Python keyring lib provides a easy way to access the system |
9377d2b6 | 74 | keyring service from Python. It can be used in any application that |
5f9ca321 ER |
75 | needs safe password storage. |
76 | ||
9377d2b6 JB |
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ł. | |
81 | ||
82 | %package apidocs | |
83 | Summary: API documentation for Python keyring library | |
84 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring | |
85 | Group: Documentation | |
86 | ||
87 | %description apidocs | |
88 | API documentation for Python keyring library. | |
89 | ||
90 | %description apidocs -l pl.UTF-8 | |
91 | Dokumentacja API biblioteki Pythona keyring. | |
5f9ca321 ER |
92 | |
93 | %prep | |
94 | %setup -q -n %{module}-%{version} | |
95 | ||
96 | %build | |
9377d2b6 JB |
97 | %if %{with python2} |
98 | %py_build %{?with_tests:test} | |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | %py3_build %{?with_tests:test} %{?with_doc:build_sphinx} | |
103 | %endif | |
5f9ca321 ER |
104 | |
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
5f9ca321 | 107 | |
9377d2b6 JB |
108 | %if %{with python3} |
109 | %py3_install | |
5f9ca321 | 110 | |
9377d2b6 JB |
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} | |
114 | %endif | |
115 | ||
116 | %if %{with python2} | |
117 | %py_install | |
5f9ca321 ER |
118 | |
119 | %py_postclean | |
9377d2b6 JB |
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 | |
124 | %endif | |
5f9ca321 ER |
125 | |
126 | %clean | |
127 | rm -rf $RPM_BUILD_ROOT | |
128 | ||
9377d2b6 | 129 | %if %{with python2} |
5f9ca321 ER |
130 | %files |
131 | %defattr(644,root,root,755) | |
9377d2b6 JB |
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 | |
137 | %endif | |
138 | ||
139 | %if %{with python3} | |
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 | |
146 | %endif | |
147 | ||
148 | %if %{with python3} && %{with doc} | |
149 | %files apidocs | |
150 | %defattr(644,root,root,755) | |
151 | %doc build-3/sphinx/html/{_static,*.html,*.js} | |
152 | %endif |