]>
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} |
81bd6d7f JB |
12 | Version: 10.3 |
13 | Release: 1 | |
9377d2b6 JB |
14 | License: MIT, PSF |
15 | Group: Libraries/Python | |
81bd6d7f JB |
16 | Source0: https://pypi.python.org/packages/d2/2f/b70bf3068b5964e4c45507e03652da0743c72460ff929e70aef201ed5ffb/%{module}-%{version}.tar.gz |
17 | # Source0-md5: 8a6a4617a70c8776da24a02fb63b3ecd | |
9377d2b6 | 18 | URL: https://pypi.python.org/pypi/keyring |
9377d2b6 JB |
19 | %if %{with python2} |
20 | BuildRequires: python-devel >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
81bd6d7f | 22 | BuildRequires: python-setuptools_scm >= 1.15.0 |
9377d2b6 JB |
23 | %if %{with tests} |
24 | BuildRequires: python-pytest >= 2.8 | |
81bd6d7f | 25 | BuildRequires: python-secretstorage |
9377d2b6 JB |
26 | %endif |
27 | %endif | |
28 | %if %{with python3} | |
81bd6d7f | 29 | BuildRequires: python3-devel >= 1:3.3 |
9377d2b6 | 30 | BuildRequires: python3-setuptools |
81bd6d7f | 31 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
9377d2b6 JB |
32 | %if %{with tests} |
33 | BuildRequires: python3-pytest >= 2.8 | |
81bd6d7f | 34 | BuildRequires: python3-secretstorage |
9377d2b6 JB |
35 | %endif |
36 | %endif | |
37 | %if %{with doc} | |
38 | BuildRequires: python3-Sphinx | |
39 | BuildRequires: python3-rst.linker | |
40 | %endif | |
81bd6d7f JB |
41 | BuildRequires: rpm-pythonprov |
42 | BuildRequires: rpmbuild(macros) >= 1.714 | |
9377d2b6 JB |
43 | Requires: python-modules >= 1:2.7 |
44 | # kwalletd5 through dbus | |
45 | Suggests: python-dbus | |
5f9ca321 ER |
46 | Obsoletes: python-keyring-gnome < 0.5.1 |
47 | Obsoletes: python-keyring-kwallet < 0.5.1 | |
48 | BuildArch: noarch | |
49 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
50 | ||
51 | %description | |
9377d2b6 JB |
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. | |
55 | ||
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ł. | |
60 | ||
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 | |
67 | Suggests: python-dbus | |
9377d2b6 JB |
68 | |
69 | %description -n python3-%{module} | |
5f9ca321 | 70 | The Python keyring lib provides a easy way to access the system |
9377d2b6 | 71 | keyring service from Python. It can be used in any application that |
5f9ca321 ER |
72 | needs safe password storage. |
73 | ||
9377d2b6 JB |
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ł. | |
78 | ||
79 | %package apidocs | |
80 | Summary: API documentation for Python keyring library | |
81 | Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring | |
82 | Group: Documentation | |
83 | ||
84 | %description apidocs | |
85 | API documentation for Python keyring library. | |
86 | ||
87 | %description apidocs -l pl.UTF-8 | |
88 | Dokumentacja API biblioteki Pythona keyring. | |
5f9ca321 ER |
89 | |
90 | %prep | |
91 | %setup -q -n %{module}-%{version} | |
92 | ||
93 | %build | |
9377d2b6 | 94 | %if %{with python2} |
81bd6d7f JB |
95 | %py_build |
96 | ||
97 | %{?with_tests:%{__python} -m pytest} | |
9377d2b6 JB |
98 | %endif |
99 | ||
100 | %if %{with python3} | |
81bd6d7f JB |
101 | %py3_build %{?with_doc:build_sphinx} |
102 | ||
103 | %{?with_tests:%{__python3} -m pytest} | |
9377d2b6 | 104 | %endif |
5f9ca321 ER |
105 | |
106 | %install | |
107 | rm -rf $RPM_BUILD_ROOT | |
5f9ca321 | 108 | |
9377d2b6 JB |
109 | %if %{with python3} |
110 | %py3_install | |
5f9ca321 | 111 | |
9377d2b6 JB |
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} | |
115 | %endif | |
116 | ||
117 | %if %{with python2} | |
118 | %py_install | |
5f9ca321 ER |
119 | |
120 | %py_postclean | |
9377d2b6 JB |
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 | |
125 | %endif | |
5f9ca321 ER |
126 | |
127 | %clean | |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
9377d2b6 | 130 | %if %{with python2} |
5f9ca321 ER |
131 | %files |
132 | %defattr(644,root,root,755) | |
9377d2b6 JB |
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 | |
138 | %endif | |
139 | ||
140 | %if %{with python3} | |
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 | |
147 | %endif | |
148 | ||
149 | %if %{with python3} && %{with doc} | |
150 | %files apidocs | |
151 | %defattr(644,root,root,755) | |
152 | %doc build-3/sphinx/html/{_static,*.html,*.js} | |
153 | %endif |