]>
Commit | Line | Data |
---|---|---|
99fdd926 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_with tests # unit tests (SECURITY test seem to fail) | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
77ad6c6d | 7 | |
6b08247c | 8 | %define module Xlib |
77ad6c6d | 9 | |
99fdd926 JB |
10 | Summary: X client library for Python 2 |
11 | Summary(pl.UTF-8): Biblioteka klienta X dla Pythona 2 | |
77ad6c6d | 12 | Name: python-%{module} |
56bd40a2 | 13 | Version: 0.29 |
4787c2ae | 14 | Release: 5 |
99fdd926 | 15 | License: LGPL v2.1+ |
77ad6c6d | 16 | Group: Development/Languages/Python |
99fdd926 JB |
17 | #Source0Download: https://github.com/python-xlib/python-xlib/releases |
18 | Source0: https://github.com/python-xlib/python-xlib/releases/download/%{version}/python-xlib-%{version}.tar.bz2 | |
56bd40a2 | 19 | # Source0-md5: 001723b02c0dbbd2877bebebfe82d20c |
99fdd926 JB |
20 | URL: https://github.com/python-xlib/python-xlib |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel >= 1:2.7 | |
565d6684 | 23 | BuildRequires: python-setuptools >= 1:30.3.0 |
99fdd926 JB |
24 | BuildRequires: python-setuptools_scm |
25 | %if %{with tests} | |
26 | BuildRequires: python-nose | |
27 | BuildRequires: python-six >= 1.10.0 | |
28 | BuildRequires: xorg-xserver-Xvfb | |
29 | %endif | |
30 | %endif | |
31 | %if %{with python3} | |
32 | BuildRequires: python3-devel >= 1:3.3 | |
565d6684 | 33 | BuildRequires: python3-setuptools >= 1:30.3.0 |
99fdd926 JB |
34 | BuildRequires: python3-setuptools_scm |
35 | %if %{with tests} | |
36 | BuildRequires: python3-nose | |
37 | BuildRequires: python3-six >= 1.10.0 | |
38 | BuildRequires: xorg-xserver-Xvfb | |
39 | %endif | |
40 | %endif | |
3b536a49 | 41 | BuildRequires: rpm-pythonprov |
99fdd926 JB |
42 | BuildRequires: rpmbuild(macros) >= 1.714 |
43 | %if %{with doc} | |
44 | BuildRequires: texi2html | |
45 | %endif | |
46 | Requires: python-modules >= 1:2.7 | |
4350eefb | 47 | BuildArch: noarch |
77ad6c6d | 48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
50 | %description | |
51 | The Python X Library is intended to be a fully functional X client | |
52 | library for Python programs. It is written entirely in Python, in | |
53 | contrast to earlier X libraries for Python (the ancient X extension | |
54 | and the newer plxlib) which were interfaces to the C Xlib. | |
55 | ||
99fdd926 JB |
56 | %description -l pl.UTF-8 |
57 | Python X Library (biblioteka X dla Pythona) ma być w pełni | |
58 | funkcjonalną biblioteką kliencką X dla programów w Pythonie. Jest | |
59 | napisana całkowicie w Pythonie, w przeciwieństwie do poprzednich | |
60 | bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib), | |
61 | które były interfejsami do Xlib w C. | |
77ad6c6d | 62 | |
99fdd926 JB |
63 | %package -n python3-%{module} |
64 | Summary: X client library for Python 3 | |
65 | Summary(pl.UTF-8): Biblioteka klienta X dla Pythona 3 | |
66 | Group: Development/Languages/Python | |
67 | Requires: python3-devel >= 1:3.3 | |
77ad6c6d | 68 | |
99fdd926 JB |
69 | %description -n python3-%{module} |
70 | The Python X Library is intended to be a fully functional X client | |
71 | library for Python programs. It is written entirely in Python, in | |
72 | contrast to earlier X libraries for Python (the ancient X extension | |
73 | and the newer plxlib) which were interfaces to the C Xlib. | |
74 | ||
75 | %description -n python3-%{module} -l pl.UTF-8 | |
b6e677b7 JR |
76 | Python X Library (biblioteka X dla Pythona) ma być w pełni |
77 | funkcjonalną biblioteką kliencką X dla programów w Pythonie. Jest | |
78 | napisana całkowicie w Pythonie, w przeciwieństwie do poprzednich | |
4350eefb | 79 | bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib), |
b6e677b7 | 80 | które były interfejsami do Xlib w C. |
4350eefb | 81 | |
99fdd926 JB |
82 | %package apidocs |
83 | Summary: API documentation for Python Xlib module | |
84 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona Xlib | |
85 | Group: Documentation | |
86 | ||
87 | %description apidocs | |
88 | API documentation for Python Xlib module. | |
4350eefb | 89 | |
99fdd926 JB |
90 | %description apidocs -l pl.UTF-8 |
91 | Dokumentacja API modułu Pythona Xlib. | |
4350eefb | 92 | |
77ad6c6d | 93 | %prep |
94 | %setup -q -n python-xlib-%{version} | |
8e70f5e8 | 95 | %undos examples/*.py |
77ad6c6d | 96 | |
97 | %build | |
99fdd926 | 98 | %if %{with python2} |
46ec1e7b | 99 | %py_build |
77ad6c6d | 100 | |
99fdd926 JB |
101 | %if %{with tests} |
102 | %{__python} runtests.py | |
103 | %endif | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
107 | %py3_build | |
108 | ||
109 | %if %{with tests} | |
110 | %{__python3} runtests.py | |
111 | %endif | |
112 | %endif | |
113 | ||
114 | %if %{with doc} | |
115 | %{__make} -C doc html | |
116 | %endif | |
117 | ||
77ad6c6d | 118 | %install |
119 | rm -rf $RPM_BUILD_ROOT | |
99fdd926 JB |
120 | |
121 | %if %{with python2} | |
122 | %py_install | |
123 | ||
124 | %py_postclean | |
125 | ||
77ad6c6d | 126 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
127 | install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
8e70f5e8 JP |
128 | %{__sed} -i -e '1s,/usr/bin/python3\?$,%{__python},' \ |
129 | -e '1s,/usr/bin/env python3\?$,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py | |
99fdd926 | 130 | %endif |
77ad6c6d | 131 | |
99fdd926 JB |
132 | %if %{with python3} |
133 | %py3_install | |
134 | ||
135 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
136 | install examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
8e70f5e8 JP |
137 | %{__sed} -i -e '1s,/usr/bin/python3\?$,%{__python3},' \ |
138 | -e '1s,/usr/bin/env python3\?$,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py | |
99fdd926 | 139 | %endif |
77ad6c6d | 140 | |
141 | %clean | |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
99fdd926 | 144 | %if %{with python2} |
77ad6c6d | 145 | %files |
146 | %defattr(644,root,root,755) | |
99fdd926 JB |
147 | %doc CHANGELOG.md README.rst TODO |
148 | %{py_sitescriptdir}/Xlib | |
149 | %{py_sitescriptdir}/python_xlib-%{version}-py*.egg-info | |
4350eefb | 150 | %{_examplesdir}/%{name}-%{version} |
99fdd926 JB |
151 | %endif |
152 | ||
153 | %if %{with python3} | |
154 | %files -n python3-%{module} | |
155 | %defattr(644,root,root,755) | |
156 | %doc CHANGELOG.md README.rst TODO | |
157 | %{py3_sitescriptdir}/Xlib | |
158 | %{py3_sitescriptdir}/python_xlib-%{version}-py*.egg-info | |
159 | %{_examplesdir}/python3-%{module}-%{version} | |
160 | %endif | |
161 | ||
162 | %if %{with doc} | |
163 | %files apidocs | |
164 | %defattr(644,root,root,755) | |
165 | %doc doc/html/*.html | |
3b536a49 | 166 | %endif |