File python-cairo.spec of Package python-cairo

#
# spec file for package python-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/
#



Name:           python-cairo
%define _name   py2cairo
Version:        1.10.0
Release:        1
Summary:        Python Bindings for Cairo
License:        LGPLv2.1+ ; MPL ..
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:         %{_name}-%{version}.tar.bz2
BuildRequires:  cairo-devel
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%py_requires

%description
Python bindings for cairo.

%package devel
License:        LGPLv2.1+ ; MPL ..
Summary:        Headers for python-cairo
Group:          Development/Libraries/Python
Requires:       %name = %{version}
Requires:       cairo-devel python-devel

%description devel
Headers for python-cairo

%prep
%setup -n %{_name}-%{version}

%build
./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 $RPM_BUILD_ROOT/%{py_sitedir}
%py_compile -O $RPM_BUILD_ROOT/%{py_sitedir}
%fdupes $RPM_BUILD_ROOT/%{py_sitedir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc AUTHORS COPYING COPYING-* INSTALL NEWS README
%{py_sitedir}/cairo/

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

%changelog
openSUSE Build Service is sponsored by