]> git.pld-linux.org Git - packages/python-keyring.git/blob - python-keyring.spec
64a23c4efd709c3674a0a115eba7b4333d7088cc
[packages/python-keyring.git] / python-keyring.spec
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_without  python3 # CPython 3.x module
7
8 %define         module  keyring
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
11 Name:           python-%{module}
12 Version:        10.3.2
13 Release:        1
14 License:        MIT, PSF
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.python.org/simple/keyring
17 Source0:        https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
18 # Source0-md5:  20a2b23488b9da0c248b6c21a5d1154f
19 URL:            https://pypi.python.org/pypi/keyring
20 %if %{with python2}
21 BuildRequires:  python-devel >= 1:2.7
22 BuildRequires:  python-setuptools
23 BuildRequires:  python-setuptools_scm >= 1.15.0
24 %if %{with tests}
25 BuildRequires:  python-pytest >= 2.8
26 BuildRequires:  python-secretstorage
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-devel >= 1:3.3
31 BuildRequires:  python3-setuptools
32 BuildRequires:  python3-setuptools_scm >= 1.15.0
33 %if %{with tests}
34 BuildRequires:  python3-pytest >= 2.8
35 BuildRequires:  python3-secretstorage
36 %endif
37 %endif
38 %if %{with doc}
39 BuildRequires:  python3-Sphinx
40 BuildRequires:  python3-rst.linker
41 %endif
42 BuildRequires:  rpm-pythonprov
43 BuildRequires:  rpmbuild(macros) >= 1.714
44 Requires:       python-modules >= 1:2.7
45 # kwalletd5 through dbus
46 Suggests:       python-dbus
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
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
70 %description -n python3-%{module}
71 The Python keyring lib provides a easy way to access the system
72 keyring service from Python. It can be used in any application that
73 needs safe password storage.
74
75 %description -n python3-%{module} -l pl.UTF-8
76 Biblioteka Pythona keyring udostępnia prosty sposób dostępu do usługi
77 systemowego pęku kluczy z poziomu Pythona. Może być używana w dowolnej
78 aplikacji wymagającej bezpiecznego przechowywania haseł.
79
80 %package apidocs
81 Summary:        API documentation for Python keyring library
82 Summary(pl.UTF-8):      Dokumentacja API biblioteki Pythona keyring
83 Group:          Documentation
84
85 %description apidocs
86 API documentation for Python keyring library.
87
88 %description apidocs -l pl.UTF-8
89 Dokumentacja API biblioteki Pythona keyring.
90
91 %prep
92 %setup -q -n %{module}-%{version}
93
94 %build
95 %if %{with python2}
96 %py_build
97
98 %{?with_tests:PYTHON_PATH=$(pwd)/build-2/lib %{__python} -m pytest tests keyring/tests}
99 %endif
100
101 %if %{with python3}
102 %py3_build %{?with_doc:build_sphinx}
103
104 %{?with_tests:PYTHON_PATH=$(pwd)/build-3/lib %{__python3} -m pytest tests keyring/tests}
105 %endif
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109
110 %if %{with python3}
111 %py3_install
112
113 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
114 # "keyring" name is too generic, add -py[version] suffix
115 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3}
116 %endif
117
118 %if %{with python2}
119 %py_install
120
121 %py_postclean
122 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
123 # "keyring" name is too generic, add -py[version] suffix
124 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py2}
125 ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
126 %endif
127
128 %clean
129 rm -rf $RPM_BUILD_ROOT
130
131 %if %{with python2}
132 %files
133 %defattr(644,root,root,755)
134 %doc CHANGES.rst README.rst
135 %attr(755,root,root) %{_bindir}/keyring-py
136 %attr(755,root,root) %{_bindir}/keyring-py2
137 %{py_sitescriptdir}/keyring
138 %{py_sitescriptdir}/keyring-%{version}-py*.egg-info
139 %endif
140
141 %if %{with python3}
142 %files -n python3-%{module}
143 %defattr(644,root,root,755)
144 %doc CHANGES.rst README.rst
145 %attr(755,root,root) %{_bindir}/keyring-py3
146 %{py3_sitescriptdir}/keyring
147 %{py3_sitescriptdir}/keyring-%{version}-py*.egg-info
148 %endif
149
150 %if %{with python3} && %{with doc}
151 %files apidocs
152 %defattr(644,root,root,755)
153 %doc build-3/sphinx/html/{_static,*.html,*.js}
154 %endif
This page took 0.059175 seconds and 2 git commands to generate.