]> git.pld-linux.org Git - packages/python-Xlib.git/blame - python-Xlib.spec
rebuild with tests and docs
[packages/python-Xlib.git] / python-Xlib.spec
CommitLineData
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
10Summary: X client library for Python 2
11Summary(pl.UTF-8): Biblioteka klienta X dla Pythona 2
77ad6c6d 12Name: python-%{module}
56bd40a2 13Version: 0.29
4787c2ae 14Release: 5
99fdd926 15License: LGPL v2.1+
77ad6c6d 16Group: Development/Languages/Python
99fdd926
JB
17#Source0Download: https://github.com/python-xlib/python-xlib/releases
18Source0: https://github.com/python-xlib/python-xlib/releases/download/%{version}/python-xlib-%{version}.tar.bz2
56bd40a2 19# Source0-md5: 001723b02c0dbbd2877bebebfe82d20c
99fdd926
JB
20URL: https://github.com/python-xlib/python-xlib
21%if %{with python2}
22BuildRequires: python-devel >= 1:2.7
565d6684 23BuildRequires: python-setuptools >= 1:30.3.0
99fdd926
JB
24BuildRequires: python-setuptools_scm
25%if %{with tests}
26BuildRequires: python-nose
27BuildRequires: python-six >= 1.10.0
28BuildRequires: xorg-xserver-Xvfb
29%endif
30%endif
31%if %{with python3}
32BuildRequires: python3-devel >= 1:3.3
565d6684 33BuildRequires: python3-setuptools >= 1:30.3.0
99fdd926
JB
34BuildRequires: python3-setuptools_scm
35%if %{with tests}
36BuildRequires: python3-nose
37BuildRequires: python3-six >= 1.10.0
38BuildRequires: xorg-xserver-Xvfb
39%endif
40%endif
3b536a49 41BuildRequires: rpm-pythonprov
99fdd926
JB
42BuildRequires: rpmbuild(macros) >= 1.714
43%if %{with doc}
44BuildRequires: texi2html
45%endif
46Requires: python-modules >= 1:2.7
4350eefb 47BuildArch: noarch
77ad6c6d 48BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50%description
51The Python X Library is intended to be a fully functional X client
52library for Python programs. It is written entirely in Python, in
53contrast to earlier X libraries for Python (the ancient X extension
54and the newer plxlib) which were interfaces to the C Xlib.
55
99fdd926
JB
56%description -l pl.UTF-8
57Python X Library (biblioteka X dla Pythona) ma być w pełni
58funkcjonalną biblioteką kliencką X dla programów w Pythonie. Jest
59napisana całkowicie w Pythonie, w przeciwieństwie do poprzednich
60bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib),
61które były interfejsami do Xlib w C.
77ad6c6d 62
99fdd926
JB
63%package -n python3-%{module}
64Summary: X client library for Python 3
65Summary(pl.UTF-8): Biblioteka klienta X dla Pythona 3
66Group: Development/Languages/Python
67Requires: python3-devel >= 1:3.3
77ad6c6d 68
99fdd926
JB
69%description -n python3-%{module}
70The Python X Library is intended to be a fully functional X client
71library for Python programs. It is written entirely in Python, in
72contrast to earlier X libraries for Python (the ancient X extension
73and the newer plxlib) which were interfaces to the C Xlib.
74
75%description -n python3-%{module} -l pl.UTF-8
b6e677b7
JR
76Python X Library (biblioteka X dla Pythona) ma być w pełni
77funkcjonalną biblioteką kliencką X dla programów w Pythonie. Jest
78napisana całkowicie w Pythonie, w przeciwieństwie do poprzednich
4350eefb 79bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib),
b6e677b7 80które były interfejsami do Xlib w C.
4350eefb 81
99fdd926
JB
82%package apidocs
83Summary: API documentation for Python Xlib module
84Summary(pl.UTF-8): Dokumentacja API modułu Pythona Xlib
85Group: Documentation
86
87%description apidocs
88API documentation for Python Xlib module.
4350eefb 89
99fdd926
JB
90%description apidocs -l pl.UTF-8
91Dokumentacja 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
119rm -rf $RPM_BUILD_ROOT
99fdd926
JB
120
121%if %{with python2}
122%py_install
123
124%py_postclean
125
77ad6c6d 126install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
127install 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
135install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
136install 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
142rm -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
This page took 0.134686 seconds and 4 git commands to generate.