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

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
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)")}

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

%setup -n py2cairo-%{version}

export CFLAGS='%{optflags}'
./waf configure --prefix=%{_prefix} --libdir=%{_libdir}
./waf build

./waf install --destdir=%{buildroot}
# waf is broken and generated byte-code that references the build root, see
%py_compile %{buildroot}/%{py_sitedir}
%py_compile -O %{buildroot}/%{py_sitedir}
%fdupes %{buildroot}/%{py_sitedir}


%files devel

openSUSE Build Service is sponsored by