%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:           qzion
Summary:        A canvas abstraction
Version:        0.4.0
Release:        7%{?_dist_release}

Group:          System Environment/Libraries
License:        GPLv3+
URL:            http://code.openbossa.org/projects/qzion

Source0:        http://code.openbossa.org/projects/%{name}/repos/mainline/archive/d32223eae1bba7f1b191c334668f3f7dd662f582.tar.gz

Patch0:         qzion-0.4.0-fix_python_install.patch
Patch1:		qzion-0.4.0-fix_char_conversion.patch
#Make configure_file use full path so that qzion.pc can be found correctly.
Patch2:		qzion-0.4.0-fix_configure_paths.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-root

BuildRequires:  qt4-devel
BuildRequires:  PyQt4-devel
BuildRequires:  cmake
BuildRequires:  pkgconfig
BuildRequires:  python-devel
BuildRequires:  sip-devel

%description
QZion is an canvas abstraction used by and made for QEdje.

%package devel
Summary:   Development files for %{name}
Group:     Development/Libraries
Requires:  cmake
Requires:  pkgconfig
Requires:  %{name} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package python
Summary:  Python bindings for %{name}
Group:    Development/Libraries
Requires: PyQt4

%description python
The %{name}-python package contains python bindings for %{name}


%package python-devel
Summary:  Python bindings for %{name}
Group:    Development/Libraries
Requires: sip
Requires: PyQt4-devel
Requires: %{name}-python = %{version}-%{release}

%description python-devel
The %{name}-python-devel package contains the development files for
the python bindings for %{name}

%prep
%setup -q -n %{name}-mainline
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build

mkdir -p %{_target_platform}
pushd %{_target_platform} 
%cmake \
    -DPYTHON_SITE_PACKAGES_DIR=%{python_sitearch} \
    ..
popd

make %{?_smp_mflags} -C %{_target_platform}

%install
rm -rf %{buildroot}
make install/fast -C %{_target_platform} DESTDIR=%{buildroot}

%clean
rm -rf %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc README COPYING
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_includedir}/*
%{_libdir}/pkgconfig/%{name}.pc

%files python
%defattr(-,root,root,-)
%{python_sitearch}/%{name}

%files python-devel
%defattr(-,root,root,-)
%{_datadir}/sip/%{name}

%changelog
* Thu Sep 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.4.0-7
- rebuilt with rpm-4.8.1 for pkg-config

* Tue Mar 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.4.0-6
- rebuilt with python2.6

* Sun Sep 06 2009 NAKAMURA Kenta <kenta@vinelinux.org> - 0.4.0-5
- use %%cmake macro

* Sat Aug 29 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.4.0-4
- Initial build for Vine Linux

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Jul 16 2009 John5342 <john5342 at, fedoraproject.org> 0.4.0-2
- Fix char* conversion (#511583)

* Fri Mar 06 2009 John5342 <john5342 at, fedoraproject.org> 0.4.0-1
- Updated to new upstream release (0.4.0)

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Dec 19 2008 John5342 <john5342 at, fedoraproject.org> 0.3.0-2
- Implemented package review suggestions
- Remove BR: eet-devel

* Fri Dec 19 2008 John5342 <john5342 at, fedoraproject.org> 0.3.0-1
- Initial package
