]> git.pld-linux.org Git - packages/python-keyring.git/blame_incremental - python-keyring.spec
disable python3 here
[packages/python-keyring.git] / python-keyring.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without doc # Sphinx documentation
4%bcond_without tests # py.test tests
5%bcond_without python2 # CPython 2.x module
6%bcond_with python3 # CPython 3.x module
7
8%define module keyring
9Summary: Python 2 library to access the system keyring service
10Summary(pl.UTF-8): Biblioteka Pythona 2 do dostępu do systemowego pęku kluczy
11Name: python-%{module}
12# keep 18.x here for python2 support
13Version: 18.0.1
14Release: 4
15License: MIT, PSF
16Group: Libraries/Python
17#Source0Download: https://pypi.python.org/simple/keyring
18Source0: https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
19# Source0-md5: 00cdec34da9c15ad804441979b70830b
20URL: https://pypi.python.org/pypi/keyring
21%if %{with python2}
22BuildRequires: python-devel >= 1:2.7
23BuildRequires: python-setuptools
24BuildRequires: python-setuptools_scm >= 1.15.0
25%if %{with tests}
26BuildRequires: python-entrypoints
27BuildRequires: python-pytest >= 2.8
28BuildRequires: python-pytest-flake8
29BuildRequires: python-secretstorage
30%endif
31%endif
32%if %{with python3}
33BuildRequires: python3-devel >= 1:3.3
34BuildRequires: python3-setuptools
35BuildRequires: python3-setuptools_scm >= 1.15.0
36%if %{with tests}
37BuildRequires: python3-entrypoints
38BuildRequires: python3-pytest >= 2.8
39BuildRequires: python3-pytest-flake8
40BuildRequires: python3-secretstorage
41%endif
42%endif
43%if %{with doc}
44BuildRequires: python-Sphinx
45BuildRequires: python-jaraco.packaging >= 3.2
46BuildRequires: python-rst.linker >= 1.9
47%endif
48BuildRequires: rpm-pythonprov
49BuildRequires: rpmbuild(macros) >= 1.714
50Requires: python-modules >= 1:2.7
51# kwalletd5 through dbus
52Suggests: python-dbus
53Obsoletes: python-keyring-gnome < 0.5.1
54Obsoletes: python-keyring-kwallet < 0.5.1
55BuildArch: noarch
56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58%description
59The Python keyring library provides a easy way to access the system
60keyring service from Python. It can be used in any application that
61needs safe password storage.
62
63%description -l pl.UTF-8
64Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
65systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
66aplikacji wymagającej bezpiecznego przechowywania haseł.
67
68%package -n python3-%{module}
69Summary: Python 3 library to access the system keyring service
70Summary(pl.UTF-8): Biblioteka Pythona 3 do dostępu do systemowego pęku kluczy
71Group: Libraries/Python
72Requires: python3-modules >= 1:3.3
73# kwalletd5 through dbus
74Suggests: python-dbus
75
76%description -n python3-%{module}
77The Python keyring lib provides a easy way to access the system
78keyring service from Python. It can be used in any application that
79needs safe password storage.
80
81%description -n python3-%{module} -l pl.UTF-8
82Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
83systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
84aplikacji wymagającej bezpiecznego przechowywania haseł.
85
86%package apidocs
87Summary: API documentation for Python keyring library
88Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring
89Group: Documentation
90
91%description apidocs
92API documentation for Python keyring library.
93
94%description apidocs -l pl.UTF-8
95Dokumentacja API biblioteki Pythona keyring.
96
97%prep
98%setup -q -n %{module}-%{version}
99
100%build
101%if %{with python2}
102%py_build %{?with_doc:build_sphinx}
103
104%if %{with tests}
105PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106PYTEST_PLUGINS="pytest_flake8" \
107PYTHONPATH=$(pwd)/build-2/lib \
108%{__python} -m pytest tests keyring/tests
109%endif
110%endif
111
112%if %{with python3}
113%py3_build
114
115%if %{with tests}
116PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117PYTEST_PLUGINS="pytest_flake8" \
118PYTHONPATH=$(pwd)/build-3/lib \
119%{__python3} -m pytest tests keyring/tests
120%endif
121%endif
122
123%install
124rm -rf $RPM_BUILD_ROOT
125
126%if %{with python3}
127%py3_install
128
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
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
137
138%py_postclean
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
142# "keyring" name is too generic, add -py[version] suffix
143%{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py2}
144ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
145%endif
146
147%clean
148rm -rf $RPM_BUILD_ROOT
149
150%if %{with python2}
151%files
152%defattr(644,root,root,755)
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
169%if %{with python2} && %{with doc}
170%files apidocs
171%defattr(644,root,root,755)
172%doc build-2/sphinx/html/{_static,*.html,*.js}
173%endif
This page took 0.319161 seconds and 4 git commands to generate.