%define pyver %(python -c 'import sys;print(sys.version[0:3])')
#%%define pysite %{_libdir}/python%{pyver}/site-packages
%define pysite %(python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(0)')
%define pyinc %{_includedir}/python%{pyver}
%define pkg_release	4%{?_dist_release}

Summary:	The Python X Library
Summary(ja):	Python X ライブラリ
Name:		python-xlib
Version:	0.14
Release:	%{pkg_release}
License:	GPL
Group:		Development/Languages
URL:		http://python-xlib.sourceforge.net/
Source0:	http://downloads.sourceforge.net/python-xlib/%{name}-%{version}.tar.gz

AutoReqProv:	no
Requires:	python >= 1.5.2
BuildRequires:	python python-devel
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch: noarch

%description
python-xlib is a 100% pure Python implementation of the X11 protocol.
It currently implements client-side X11R6 fully, supports the resource
database, ICCM, and the Shape extension.

%description -l ja
python-xlib は 100% Python 言語で書かれた X11 protocol の実装です。
現在はクライアントサイドの X11R6 が全て実装されており、リソース
データベースや、ICCM、Shape Extension がサポートされています。

%prep
%setup -q

%build
%{__python} setup.py build
# create html document
pushd $docdir doc/html
%{__make}
popd

%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__python} setup.py install --root=${RPM_BUILD_ROOT}

%clean
%{__rm} -rf $}RPM_BUILD_ROOT}

%files
%defattr(-, root, root)
%doc COPYING NEWS README TODO doc/html/*.html examples
%{pysite}/Xlib
%{pysite}/python_xlib-0.12-py%{pyver}.egg-info

%changelog
* Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14-4
- rebuild with python-2.7.2

* Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.14-3
- rebuild with python-2.6

* Mon Dec 15 2008 Shu KONNO <owa@bg.wakwak.com> 0.14-2
- buildarch to noarch
- changed %%pysite macro to noarch

* Fri Dec 12 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.14-1
- applied new versioning policy

* Wed Dec 10 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.14-0vl1
- new upstream release

* Mon Jan 08 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.13-0vl1
- initial build for Vine Linux
