]> git.pld-linux.org Git - packages/python-Xlib.git/blob - python-Xlib.spec
2cd39190fcbd891a6cf8aa39edca1a70e93fae57
[packages/python-Xlib.git] / python-Xlib.spec
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
7
8 %define         module  Xlib
9
10 Summary:        X client library for Python 2
11 Summary(pl.UTF-8):      Biblioteka klienta X dla Pythona 2
12 Name:           python-%{module}
13 Version:        0.29
14 Release:        3
15 License:        LGPL v2.1+
16 Group:          Development/Languages/Python
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
19 # Source0-md5:  001723b02c0dbbd2877bebebfe82d20c
20 URL:            https://github.com/python-xlib/python-xlib
21 %if %{with python2}
22 BuildRequires:  python-devel >= 1:2.7
23 BuildRequires:  python-setuptools >= 1:30.3.0
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
33 BuildRequires:  python3-setuptools >= 1:30.3.0
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
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.714
43 %if %{with doc}
44 BuildRequires:  texi2html
45 %endif
46 Requires:       python-modules >= 1:2.7
47 BuildArch:      noarch
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
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.
62
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
68
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
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
79 bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib),
80 które były interfejsami do Xlib w C.
81
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.
89
90 %description apidocs -l pl.UTF-8
91 Dokumentacja API modułu Pythona Xlib.
92
93 %prep
94 %setup -q -n python-xlib-%{version}
95 %undos examples/*.py
96
97 %build
98 %if %{with python2}
99 %py_build
100
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
118 %install
119 rm -rf $RPM_BUILD_ROOT
120
121 %if %{with python2}
122 %py_install
123
124 %py_postclean
125
126 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
127 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
128 %{__sed} -i -e '1s,/usr/bin/python3\?$,%{__python},' \
129         -e '1s,/usr/bin/env python3\?$,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
130 %endif
131
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}
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
139 %endif
140
141 %clean
142 rm -rf $RPM_BUILD_ROOT
143
144 %if %{with python2}
145 %files
146 %defattr(644,root,root,755)
147 %doc CHANGELOG.md README.rst TODO
148 %{py_sitescriptdir}/Xlib
149 %{py_sitescriptdir}/python_xlib-%{version}-py*.egg-info
150 %{_examplesdir}/%{name}-%{version}
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
166 %endif
This page took 0.034132 seconds and 2 git commands to generate.