]> git.pld-linux.org Git - packages/python-Xlib.git/blob - python-Xlib.spec
- new URLs, updated to 0.26, added python3- package and -apidocs
[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.26
14 Release:        1
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:  678871a692c5409a6d6b5aaaf7f6e60d
20 URL:            https://github.com/python-xlib/python-xlib
21 %if %{with python2}
22 BuildRequires:  python-devel >= 1:2.7
23 BuildRequires:  python-setuptools >= 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 >= 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
96 %build
97 %if %{with python2}
98 %py_build
99
100 %if %{with tests}
101 %{__python} runtests.py
102 %endif
103 %endif
104
105 %if %{with python3}
106 %py3_build
107
108 %if %{with tests}
109 %{__python3} runtests.py
110 %endif
111 %endif
112
113 %if %{with doc}
114 %{__make} -C doc html
115 %endif
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119
120 %if %{with python2}
121 %py_install
122
123 %py_postclean
124
125 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
126 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
127 %{__sed} -i -e '1s,/usr/bin/python,%{__python},' \
128         -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
129 %endif
130
131 %if %{with python3}
132 %py3_install
133
134 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
135 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
136 %{__sed} -i -e '1s,/usr/bin/python,%{__python3},' \
137         -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
138 %endif
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %if %{with python2}
144 %files
145 %defattr(644,root,root,755)
146 %doc CHANGELOG.md README.rst TODO
147 %{py_sitescriptdir}/Xlib
148 %{py_sitescriptdir}/python_xlib-%{version}-py*.egg-info
149 %{_examplesdir}/%{name}-%{version}
150 %endif
151
152 %if %{with python3}
153 %files -n python3-%{module}
154 %defattr(644,root,root,755)
155 %doc CHANGELOG.md README.rst TODO
156 %{py3_sitescriptdir}/Xlib
157 %{py3_sitescriptdir}/python_xlib-%{version}-py*.egg-info
158 %{_examplesdir}/python3-%{module}-%{version}
159 %endif
160
161 %if %{with doc}
162 %files apidocs
163 %defattr(644,root,root,755)
164 %doc doc/html/*.html
165 %endif
This page took 0.045577 seconds and 3 git commands to generate.