]> git.pld-linux.org Git - packages/python-keyring.git/blame - python-keyring.spec
- package base tests infrastructure; release 2
[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
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
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}
264e352d 12Version: 10.3.2
aa5ca449 13Release: 2
9377d2b6
JB
14License: MIT, PSF
15Group: Libraries/Python
264e352d
JB
16#Source0Download: https://pypi.python.org/simple/keyring
17Source0: https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
18# Source0-md5: 20a2b23488b9da0c248b6c21a5d1154f
9377d2b6 19URL: https://pypi.python.org/pypi/keyring
9377d2b6
JB
20%if %{with python2}
21BuildRequires: python-devel >= 1:2.7
22BuildRequires: python-setuptools
81bd6d7f 23BuildRequires: python-setuptools_scm >= 1.15.0
9377d2b6
JB
24%if %{with tests}
25BuildRequires: python-pytest >= 2.8
81bd6d7f 26BuildRequires: python-secretstorage
9377d2b6
JB
27%endif
28%endif
29%if %{with python3}
81bd6d7f 30BuildRequires: python3-devel >= 1:3.3
9377d2b6 31BuildRequires: python3-setuptools
81bd6d7f 32BuildRequires: python3-setuptools_scm >= 1.15.0
9377d2b6
JB
33%if %{with tests}
34BuildRequires: python3-pytest >= 2.8
81bd6d7f 35BuildRequires: python3-secretstorage
9377d2b6
JB
36%endif
37%endif
38%if %{with doc}
39BuildRequires: python3-Sphinx
40BuildRequires: python3-rst.linker
41%endif
81bd6d7f
JB
42BuildRequires: rpm-pythonprov
43BuildRequires: rpmbuild(macros) >= 1.714
9377d2b6
JB
44Requires: python-modules >= 1:2.7
45# kwalletd5 through dbus
46Suggests: python-dbus
5f9ca321
ER
47Obsoletes: python-keyring-gnome < 0.5.1
48Obsoletes: python-keyring-kwallet < 0.5.1
49BuildArch: noarch
50BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52%description
9377d2b6
JB
53The Python keyring library provides a easy way to access the system
54keyring service from Python. It can be used in any application that
55needs safe password storage.
56
57%description -l pl.UTF-8
58Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
59systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
60aplikacji wymagającej bezpiecznego przechowywania haseł.
61
62%package -n python3-%{module}
63Summary: Python 3 library to access the system keyring service
64Summary(pl.UTF-8): Biblioteka Pythona 3 do dostępu do systemowego pęku kluczy
65Group: Libraries/Python
66Requires: python3-modules >= 1:3.3
67# kwalletd5 through dbus
68Suggests: python-dbus
9377d2b6
JB
69
70%description -n python3-%{module}
5f9ca321 71The Python keyring lib provides a easy way to access the system
9377d2b6 72keyring service from Python. It can be used in any application that
5f9ca321
ER
73needs safe password storage.
74
9377d2b6
JB
75%description -n python3-%{module} -l pl.UTF-8
76Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
77systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
78aplikacji wymagającej bezpiecznego przechowywania haseł.
79
80%package apidocs
81Summary: API documentation for Python keyring library
82Summary(pl.UTF-8): Dokumentacja API biblioteki Pythona keyring
83Group: Documentation
84
85%description apidocs
86API documentation for Python keyring library.
87
88%description apidocs -l pl.UTF-8
89Dokumentacja 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
108rm -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}
128ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
129%endif
5f9ca321
ER
130
131%clean
132rm -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
This page took 0.146188 seconds and 4 git commands to generate.