File python3-cairo.spec of Package python3-cairo
#
# spec file for package python3-cairo
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# We manually define those because we don't have any python3 macros yet
%define local_python3_requires Requires: python(abi) = %py3_ver
Name: python3-cairo
%define _name pycairo
Version: 1.10.0
Release: 1
Summary: Python Bindings for Cairo
License: LGPLv3
Group: Development/Libraries/Python
# FIXME: on update, check if we finally have python3 macros to replace our local ones
# FIXME: on update, check if we still need to manually remove the byte-code in %%install
Url: http://www.cairographics.org/
Source: %{_name}-%{version}.tar.bz2
BuildRequires: cairo-devel
# Needed to have the modules for different hash algorithms; python3-devel only brings in python3-base
BuildRequires: python3
BuildRequires: python3-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%local_python3_requires
%description
Python bindings for cairo.
%package devel
License: LGPLv3
Summary: Headers for python-cairo
Group: Development/Libraries/Python
Requires: %name = %{version}
Requires: cairo-devel python3-devel
%description devel
Headers for python-cairo
%prep
%setup -q -n %{_name}-%{version}
%build
PYTHON=python3 python3 ./waf configure --prefix=%{_prefix} --libdir=%{_libdir}
python3 ./waf build
%install
python3 ./waf install --destdir=%{buildroot}
# waf is broken and generated byte-code that references the build root, see http://code.google.com/p/waf/issues/detail?id=986
rm %{buildroot}%{python3_sitearch}/cairo/*.py[co]
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc AUTHORS COPYING.LESSER INSTALL NEWS README
%{python3_sitearch}/cairo/
%files devel
%defattr(-,root,root)
%{_includedir}/pycairo/
%{_libdir}/pkgconfig/py3cairo.pc
%changelog