]> git.pld-linux.org Git - packages/python-keyring.git/blob - python-keyring.spec
05a4b22e405d3537f731d18ef9715822166ea99a
[packages/python-keyring.git] / python-keyring.spec
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
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
13 Release:        1
14 License:        MIT, PSF
15 Group:          Libraries/Python
16 Source0:        https://pypi.python.org/packages/d2/2f/b70bf3068b5964e4c45507e03652da0743c72460ff929e70aef201ed5ffb/%{module}-%{version}.tar.gz
17 # Source0-md5:  8a6a4617a70c8776da24a02fb63b3ecd
18 URL:            https://pypi.python.org/pypi/keyring
19 %if %{with python2}
20 BuildRequires:  python-devel >= 1:2.7
21 BuildRequires:  python-setuptools
22 BuildRequires:  python-setuptools_scm >= 1.15.0
23 %if %{with tests}
24 BuildRequires:  python-pytest >= 2.8
25 BuildRequires:  python-secretstorage
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-devel >= 1:3.3
30 BuildRequires:  python3-setuptools
31 BuildRequires:  python3-setuptools_scm >= 1.15.0
32 %if %{with tests}
33 BuildRequires:  python3-pytest >= 2.8
34 BuildRequires:  python3-secretstorage
35 %endif
36 %endif
37 %if %{with doc}
38 BuildRequires:  python3-Sphinx
39 BuildRequires:  python3-rst.linker
40 %endif
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.714
43 Requires:       python-modules >= 1:2.7
44 # kwalletd5 through dbus
45 Suggests:       python-dbus
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
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
68
69 %description -n python3-%{module}
70 The Python keyring lib provides a easy way to access the system
71 keyring service from Python. It can be used in any application that
72 needs safe password storage.
73
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.
89
90 %prep
91 %setup -q -n %{module}-%{version}
92
93 %build
94 %if %{with python2}
95 %py_build
96
97 %{?with_tests:%{__python} -m pytest}
98 %endif
99
100 %if %{with python3}
101 %py3_build %{?with_doc:build_sphinx}
102
103 %{?with_tests:%{__python3} -m pytest}
104 %endif
105
106 %install
107 rm -rf $RPM_BUILD_ROOT
108
109 %if %{with python3}
110 %py3_install
111
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
119
120 %py_postclean
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
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %if %{with python2}
131 %files
132 %defattr(644,root,root,755)
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
This page took 0.086044 seconds and 2 git commands to generate.