]>
Commit | Line | Data |
---|---|---|
77ad6c6d | 1 | |
6b08247c | 2 | %define module Xlib |
77ad6c6d | 3 | |
4 | Summary: X client library for Python | |
c1ee1d30 | 5 | Summary(pl.UTF-8): Biblioteka klienta X dla Pythona |
77ad6c6d | 6 | Name: python-%{module} |
3b536a49 | 7 | Version: 0.14 |
09f4b510 | 8 | Release: 3 |
77ad6c6d | 9 | License: GPL |
10 | Group: Development/Languages/Python | |
3b536a49 | 11 | Source0: http://downloads.sourceforge.net/python-xlib/python-xlib-%{version}.tar.gz |
12 | # Source0-md5: a038c2f410d8445f3fa8f6dcd45659c5 | |
77ad6c6d | 13 | URL: http://python-xlib.sourceforge.net/ |
5305c012 | 14 | BuildRequires: rpmbuild(macros) >= 1.710 |
07b77666 | 15 | BuildRequires: python |
9ac365b1 | 16 | BuildRequires: python-devel >= 1:2.3 |
3b536a49 | 17 | BuildRequires: rpm-pythonprov |
4350eefb JB |
18 | %pyrequires_eq python-modules |
19 | BuildArch: noarch | |
77ad6c6d | 20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
21 | ||
22 | %description | |
23 | The Python X Library is intended to be a fully functional X client | |
24 | library for Python programs. It is written entirely in Python, in | |
25 | contrast to earlier X libraries for Python (the ancient X extension | |
26 | and the newer plxlib) which were interfaces to the C Xlib. | |
27 | ||
28 | This is possible to do since X client programs communicate with the X | |
29 | server via the X protocol. The communication takes place over TCP/IP, | |
30 | Unix sockets, DECnet or any other suitable streaming network protocol. | |
31 | The C Xlib is merely an interface to this protocol, providing | |
32 | functions suited for a C environment. | |
33 | ||
34 | There are three advantages of choosing to implement a pure Python | |
35 | library: | |
36 | - Integration: The library can make use of the wonderful object system | |
37 | in Python, providing an easy-to-use class hierarchy. | |
38 | - Portability: The library will be usable on (almost) any computer | |
39 | which have Python installed. A C interface could be problematic to | |
40 | port to non-Unix systems, such as MS Windows or OpenVMS. | |
41 | ||
b6e677b7 JR |
42 | %description -l pl.UTF-8 |
43 | Python X Library (biblioteka X dla Pythona) ma być w pełni | |
44 | funkcjonalną biblioteką kliencką X dla programów w Pythonie. Jest | |
45 | napisana całkowicie w Pythonie, w przeciwieństwie do poprzednich | |
4350eefb | 46 | bibliotek X dla Pythona (starego rozszerzenia X i nowszej plxlib), |
b6e677b7 | 47 | które były interfejsami do Xlib w C. |
4350eefb | 48 | |
b6e677b7 JR |
49 | Jest to możliwe do zrobienia ponieważ programy klienckie X komunikują |
50 | się z X serwerem za pomocą protokołu X. Komunikacja odbywa się poprzez | |
4350eefb | 51 | TCP/IP, gniazda uniksowe, DECnet lub dowolny inny strumieniowy |
b6e677b7 JR |
52 | protokół sieciowy. Biblioteka Xlib w C jest jedynie interfejsem do |
53 | tego protokołu, dostarczając funkcje odpowiednie dla środowiska C. | |
4350eefb | 54 | |
b6e677b7 JR |
55 | Są trzy zalety wyboru implementacji jako czysto pythonowej biblioteki: |
56 | - integracja: biblioteka może używać cudownego systemu obiektowego | |
57 | Pythona, dostarczając łatwą w użyciu hierarchię klas | |
58 | - przenośność: biblioteka będzie użyteczna na (prawie) każdym | |
59 | komputerze z zainstalowanym Pythonem. Interfejs w C mógłby być | |
3b536a49 | 60 | problematyczny do sportowania na systemy nieuniksowe, jak na przykład |
61 | MS Windows czy OpenVMS. | |
4350eefb | 62 | |
77ad6c6d | 63 | %prep |
64 | %setup -q -n python-xlib-%{version} | |
65 | ||
66 | %build | |
46ec1e7b | 67 | %py_build |
77ad6c6d | 68 | |
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | install -d $RPM_BUILD_ROOT%{py_sitedir} | |
72 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
73 | install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
46ec1e7b | 74 | %py_install |
77ad6c6d | 75 | |
f2fe2e38 | 76 | find $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/ -name \*.py | xargs rm |
77ad6c6d | 77 | |
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %files | |
82 | %defattr(644,root,root,755) | |
83 | %doc NEWS README TODO | |
52c47676 | 84 | %dir %{py_sitescriptdir}/%{module} |
85 | %{py_sitescriptdir}/%{module}/*.py[co] | |
86 | %dir %{py_sitescriptdir}/%{module}/ext | |
87 | %{py_sitescriptdir}/%{module}/ext/*.py[co] | |
88 | %dir %{py_sitescriptdir}/%{module}/keysymdef | |
89 | %{py_sitescriptdir}/%{module}/keysymdef/*.py[co] | |
90 | %dir %{py_sitescriptdir}/%{module}/protocol | |
91 | %{py_sitescriptdir}/%{module}/protocol/*.py[co] | |
92 | %dir %{py_sitescriptdir}/%{module}/support | |
93 | %{py_sitescriptdir}/%{module}/support/*.py[co] | |
94 | %dir %{py_sitescriptdir}/%{module}/xobject | |
95 | %{py_sitescriptdir}/%{module}/xobject/*.py[co] | |
4350eefb | 96 | %{_examplesdir}/%{name}-%{version} |
3b536a49 | 97 | %if "%{py_ver}" > "2.4" |
98 | %{py_sitescriptdir}/python_xlib-0.12-py*.egg-info | |
99 | %endif |