]> git.pld-linux.org Git - packages/python-keyring.git/blame - python-keyring.spec
disable python3 here
[packages/python-keyring.git] / python-keyring.spec
CommitLineData
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
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
5f9ca321 11Name: python-%{module}
bc84d0b6
JB
12# keep 18.x here for python2 support
13Version: 18.0.1
91abb1fc 14Release: 4
9377d2b6
JB
15License: MIT, PSF
16Group: Libraries/Python
264e352d
JB
17#Source0Download: https://pypi.python.org/simple/keyring
18Source0: https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
bc84d0b6 19# Source0-md5: 00cdec34da9c15ad804441979b70830b
9377d2b6 20URL: https://pypi.python.org/pypi/keyring
9377d2b6
JB
21%if %{with python2}
22BuildRequires: python-devel >= 1:2.7
23BuildRequires: python-setuptools
81bd6d7f 24BuildRequires: python-setuptools_scm >= 1.15.0
9377d2b6 25%if %{with tests}
bc84d0b6 26BuildRequires: python-entrypoints
9377d2b6 27BuildRequires: python-pytest >= 2.8
bc84d0b6 28BuildRequires: python-pytest-flake8
81bd6d7f 29BuildRequires: python-secretstorage
9377d2b6
JB
30%endif
31%endif
32%if %{with python3}
81bd6d7f 33BuildRequires: python3-devel >= 1:3.3
9377d2b6 34BuildRequires: python3-setuptools
81bd6d7f 35BuildRequires: python3-setuptools_scm >= 1.15.0
9377d2b6 36%if %{with tests}
bc84d0b6 37BuildRequires: python3-entrypoints
9377d2b6 38BuildRequires: python3-pytest >= 2.8
bc84d0b6 39BuildRequires: python3-pytest-flake8
81bd6d7f 40BuildRequires: python3-secretstorage
9377d2b6
JB
41%endif
42%endif
43%if %{with doc}
bc84d0b6
JB
44BuildRequires: python-Sphinx
45BuildRequires: python-jaraco.packaging >= 3.2
46BuildRequires: python-rst.linker >= 1.9
9377d2b6 47%endif
81bd6d7f
JB
48BuildRequires: rpm-pythonprov
49BuildRequires: rpmbuild(macros) >= 1.714
9377d2b6
JB
50Requires: python-modules >= 1:2.7
51# kwalletd5 through dbus
52Suggests: python-dbus
5f9ca321
ER
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
9377d2b6
JB
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
9377d2b6
JB
75
76%description -n python3-%{module}
5f9ca321 77The Python keyring lib provides a easy way to access the system
9377d2b6 78keyring service from Python. It can be used in any application that
5f9ca321
ER
79needs safe password storage.
80
9377d2b6
JB
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.
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}
105PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106PYTEST_PLUGINS="pytest_flake8" \
107PYTHONPATH=$(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}
116PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117PYTEST_PLUGINS="pytest_flake8" \
118PYTHONPATH=$(pwd)/build-3/lib \
119%{__python3} -m pytest tests keyring/tests
120%endif
9377d2b6 121%endif
5f9ca321
ER
122
123%install
124rm -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}
144ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
145%endif
5f9ca321
ER
146
147%clean
148rm -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
This page took 0.105292 seconds and 4 git commands to generate.