]> git.pld-linux.org Git - packages/python-Xlib.git/commitdiff
- new URLs, updated to 0.26, added python3- package and -apidocs auto/th/python-Xlib-0.26-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 8 Mar 2020 17:49:47 +0000 (18:49 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 8 Mar 2020 17:49:47 +0000 (18:49 +0100)
python-Xlib.spec

index 589d2fea63bda76afe127ed8798b45e123cb9bcb..e76728836d624b98d1072de96a47c9d359a5212e 100644 (file)
@@ -1,21 +1,49 @@
+#
+# Conditional build:
+%bcond_without doc     # Sphinx documentation
+%bcond_with    tests   # unit tests (SECURITY test seem to fail)
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
 
 %define                module  Xlib
 
-Summary:       X client library for Python
-Summary(pl.UTF-8):     Biblioteka klienta X dla Pythona
+Summary:       X client library for Python 2
+Summary(pl.UTF-8):     Biblioteka klienta X dla Pythona 2
 Name:          python-%{module}
-Version:       0.14
-Release:       3
-License:       GPL
+Version:       0.26
+Release:       1
+License:       LGPL v2.1+
 Group:         Development/Languages/Python
-Source0:       http://downloads.sourceforge.net/python-xlib/python-xlib-%{version}.tar.gz
-# Source0-md5: a038c2f410d8445f3fa8f6dcd45659c5
-URL:           http://python-xlib.sourceforge.net/
-BuildRequires: rpmbuild(macros) >= 1.710
-BuildRequires: python
-BuildRequires: python-devel >= 1:2.3
+#Source0Download: https://github.com/python-xlib/python-xlib/releases
+Source0:       https://github.com/python-xlib/python-xlib/releases/download/%{version}/python-xlib-%{version}.tar.bz2
+# Source0-md5: 678871a692c5409a6d6b5aaaf7f6e60d
+URL:           https://github.com/python-xlib/python-xlib
+%if %{with python2}
+BuildRequires: python-devel >= 1:2.7
+BuildRequires: python-setuptools >= 30.3.0
+BuildRequires: python-setuptools_scm
+%if %{with tests}
+BuildRequires: python-nose
+BuildRequires: python-six >= 1.10.0
+BuildRequires: xorg-xserver-Xvfb
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-devel >= 1:3.3
+BuildRequires: python3-setuptools >= 30.3.0
+BuildRequires: python3-setuptools_scm
+%if %{with tests}
+BuildRequires: python3-nose
+BuildRequires: python3-six >= 1.10.0
+BuildRequires: xorg-xserver-Xvfb
+%endif
+%endif
 BuildRequires: rpm-pythonprov
-%pyrequires_eq python-modules
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires: texi2html
+%endif
+Requires:      python-modules >= 1:2.7
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -25,75 +53,113 @@ library for Python programs. It is written entirely in Python, in
 contrast to earlier X libraries for Python (the ancient X extension
 and the newer plxlib) which were interfaces to the C Xlib.
 
-This is possible to do since X client programs communicate with the X
-server via the X protocol. The communication takes place over TCP/IP,
-Unix sockets, DECnet or any other suitable streaming network protocol.
-The C Xlib is merely an interface to this protocol, providing
-functions suited for a C environment.
+%description -l pl.UTF-8
+Python X Library (biblioteka X dla Pythona) ma być w pełni
+funkcjonalną biblioteką kliencką X dla programów w Pythonie. Jest
+napisana całkowicie w Pythonie, w przeciwieństwie do poprzednich
+bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib),
+które były interfejsami do Xlib w C.
 
-There are three advantages of choosing to implement a pure Python
-library:
-- Integration: The library can make use of the wonderful object system
-  in Python, providing an easy-to-use class hierarchy.
-- Portability: The library will be usable on (almost) any computer
-  which have Python installed. A C interface could be problematic to
-  port to non-Unix systems, such as MS Windows or OpenVMS.
+%package -n python3-%{module}
+Summary:       X client library for Python 3
+Summary(pl.UTF-8):     Biblioteka klienta X dla Pythona 3
+Group:         Development/Languages/Python
+Requires:      python3-devel >= 1:3.3
 
-%description -l pl.UTF-8
+%description -n python3-%{module}
+The Python X Library is intended to be a fully functional X client
+library for Python programs. It is written entirely in Python, in
+contrast to earlier X libraries for Python (the ancient X extension
+and the newer plxlib) which were interfaces to the C Xlib.
+
+%description -n python3-%{module} -l pl.UTF-8
 Python X Library (biblioteka X dla Pythona) ma być w pełni
 funkcjonalną biblioteką kliencką X dla programów w Pythonie. Jest
 napisana całkowicie w Pythonie, w przeciwieństwie do poprzednich
 bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib),
 które były interfejsami do Xlib w C.
 
-Jest to możliwe do zrobienia ponieważ programy klienckie X komunikują
-się z X serwerem za pomocą protokołu X. Komunikacja odbywa się poprzez
-TCP/IP, gniazda uniksowe, DECnet lub dowolny inny strumieniowy
-protokół sieciowy. Biblioteka Xlib w C jest jedynie interfejsem do
-tego protokołu, dostarczając funkcje odpowiednie dla środowiska C.
+%package apidocs
+Summary:       API documentation for Python Xlib module
+Summary(pl.UTF-8):     Dokumentacja API modułu Pythona Xlib
+Group:         Documentation
+
+%description apidocs
+API documentation for Python Xlib module.
 
-Są trzy zalety wyboru implementacji jako czysto pythonowej biblioteki:
-- integracja: biblioteka może używać cudownego systemu obiektowego
-  Pythona, dostarczając łatwą w użyciu hierarchię klas
-- przenośność: biblioteka będzie użyteczna na (prawie) każdym
-  komputerze z zainstalowanym Pythonem. Interfejs w C mógłby być
-  problematyczny do sportowania na systemy nieuniksowe, jak na przykład
-  MS Windows czy OpenVMS.
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona Xlib.
 
 %prep
 %setup -q -n python-xlib-%{version}
 
 %build
+%if %{with python2}
 %py_build
 
+%if %{with tests}
+%{__python} runtests.py
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+%{__python3} runtests.py
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C doc html
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{py_sitedir}
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-%py_install
+%{__sed} -i -e '1s,/usr/bin/python,%{__python},' \
+       -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
+%endif
 
-find $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/ -name \*.py | xargs rm
+%if %{with python3}
+%py3_install
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+install examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+%{__sed} -i -e '1s,/usr/bin/python,%{__python3},' \
+       -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc NEWS README TODO
-%dir %{py_sitescriptdir}/%{module}
-%{py_sitescriptdir}/%{module}/*.py[co]
-%dir %{py_sitescriptdir}/%{module}/ext
-%{py_sitescriptdir}/%{module}/ext/*.py[co]
-%dir %{py_sitescriptdir}/%{module}/keysymdef
-%{py_sitescriptdir}/%{module}/keysymdef/*.py[co]
-%dir %{py_sitescriptdir}/%{module}/protocol
-%{py_sitescriptdir}/%{module}/protocol/*.py[co]
-%dir %{py_sitescriptdir}/%{module}/support
-%{py_sitescriptdir}/%{module}/support/*.py[co]
-%dir %{py_sitescriptdir}/%{module}/xobject
-%{py_sitescriptdir}/%{module}/xobject/*.py[co]
+%doc CHANGELOG.md README.rst TODO
+%{py_sitescriptdir}/Xlib
+%{py_sitescriptdir}/python_xlib-%{version}-py*.egg-info
 %{_examplesdir}/%{name}-%{version}
-%if "%{py_ver}" > "2.4"
-%{py_sitescriptdir}/python_xlib-0.12-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc CHANGELOG.md README.rst TODO
+%{py3_sitescriptdir}/Xlib
+%{py3_sitescriptdir}/python_xlib-%{version}-py*.egg-info
+%{_examplesdir}/python3-%{module}-%{version}
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/html/*.html
 %endif
This page took 0.100546 seconds and 4 git commands to generate.