File python-cairo.spec of Package python-cairo
#
# spec file for package python-cairo
#
# Copyright (c) 2013 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/
#
Name: python-cairo
Version: 1.10.0
Release: 0
Summary: Python Bindings for Cairo
License: LGPL-2.1+ or MPL-1.1
Group: Development/Libraries/Python
# FIXME: on update, check if we still need to manually compile the byte-code in %%install
Url: http://www.cairographics.org/
Source: http://www.cairographics.org/releases/py2cairo-%{version}.tar.bz2
BuildRequires: cairo-devel
BuildRequires: fdupes
BuildRequires: python-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
%description
Python bindings for cairo.
%package devel
Summary: Headers for python-cairo
Group: Development/Libraries/C and C++
Requires: %name = %{version}
Requires: cairo-devel
Requires: python-devel
%description devel
Headers for python-cairo
%prep
%setup -n py2cairo-%{version}
%build
export CFLAGS='%{optflags}'
./waf configure --prefix=%{_prefix} --libdir=%{_libdir}
./waf build
%install
./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
%py_compile %{buildroot}/%{py_sitedir}
%py_compile -O %{buildroot}/%{py_sitedir}
%fdupes %{buildroot}/%{py_sitedir}
%files
%defattr(-,root,root)
%doc AUTHORS COPYING COPYING-* INSTALL NEWS README
%{python_sitearch}/cairo/
%files devel
%defattr(-,root,root)
%{_includedir}/pycairo/
%{_libdir}/pkgconfig/pycairo.pc
%changelog