%define pyexeclib %(python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)')
%define name 	PyQt
%define version 3.18.1
%define release 2%{?_dist_release}

Summary:	Python bindings for Qt.
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	GPL
Group:		Development/Languages
Source:		http://www.riverbankcomputing.com/Downloads/PyQt3/GPL/%{name}-x11-gpl-%{version}.tar.gz
URL:		http://www.riverbankcomputing.co.uk/pyqt
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:	python-devel sip-devel qt-devel
Requires:	python

%description
Python bindings for the Qt C++ class library.

%package devel
Summary: 	Files needed to build other bindings based on Qt
Group: 		Development/Libraries
Requires:	%{name} = %{version}
Requires:	sip-devel qt-devel

%description devel
Files needed to build other bindings for C++ classes that inherit from any
of the Qt classes (e.g. KDE or your own).

%prep
%setup -q -n %{name}-x11-gpl-%{version}

%build
mkdir -p $RPM_BUILD_ROOT%{pyexeclib}
python configure.py -d %{pyexeclib} <<EOF
    yes
EOF
# note that -j2 does not work
make

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT%{_datadir}/sip/qt
cp -r sip/* $RPM_BUILD_ROOT%{_datadir}/sip/qt/

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root, 755)
%doc NEWS README ChangeLog THANKS
%doc doc/PyQt.html
%{_bindir}/*
%{pyexeclib}/*

%files devel
%defattr(-,root,root)
%doc examples*
%{_datadir}/sip/*

%changelog
* Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 3.18.1-2
- rebuilt with python-2.6.4

* Thu Nov 12 2009 Ryoichi INAGAKI <owa@bg.wakwak.com> 3.18.1-1
- new upstream release
- removed qscintilla dependency

* Mon Jul 21 2008 Shu KONNO <owa@bg.wakwak.com> 3.17.3-1vl5
- rebuilt with python-2.5.2
- added pyexeclib macro
- applied new versioning policy

* Fri Nov 30 2007 Shu KONNO <owa@bg.wakwak.com> 3.17.3-0vl2
- changed source url
- fixed python site-packages path (for lib64)

* Thu Sep 13 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.17.3-0vl1
- updated to 3.16
- rebuilt with new toolchain

* Sun Jun 11 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.16-0vl1
- updated to 3.16
- changed Group to Development/Languages
- rebuild with python-2.4.3, sip-4.4.5, qscinteilla-1.6

* Sun Apr 03 2005 Shu KONNO <owa@bg.wakwak.com> 3.13-0vl2
- rebuild with python-2.4.1

* Sat Jan 15 2005 Satoshi MACHINO <machino@vinelinux.org> 3.13-0vl1
- initial release for VineLinux

