python-gtk/python-gtk.spec
Vincent Untz e216dee62e Accepting request 44818 from home:vuntz:branches:devel:languages:python
Copy from home:vuntz:branches:devel:languages:python/python-gtk via accept of submit request 44818 revision 2.
Request was accepted with message:
Forwarding to openSUSE:Factory

OBS-URL: https://build.opensuse.org/request/show/44818
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gtk?expand=0&rev=11
2010-08-07 10:45:59 +00:00

121 lines
4.0 KiB
RPMSpec

#
# spec file for package python-gtk (Version 2.17.0)
#
# Copyright (c) 2010 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/
#
# norootforbuild
Name: python-gtk
%define _name pygtk
BuildRequires: fdupes libglade2-devel python-cairo-devel python-devel python-gobject2-devel
%if %suse_version > 1020 || 0%{?opensuse_bs}
BuildRequires: python-gobject2-doc
%endif
BuildRequires: python-numpy-devel
Requires: python-numpy
# Only for directory ownership:
BuildRequires: gtk-doc
Url: http://www.pygtk.org/
Summary: Python bindings for the GTK+ widget set
Version: 2.17.0
Release: 2
License: LGPLv2.1+
Group: Development/Libraries/Python
Source: %{_name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM python-gtk-fix-pkg-config.patch vuntz@opensuse.org -- Taken from upstream
Patch0: python-gtk-fix-pkg-config.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define lparen (
%define rparen )
%define python_gtk_req %(zgrep -a _required_version %{S:0} | sed -n 's/_required_version,[[:space:]]*/ >= /;s/%{rparen}$//;s/1.0.2%{rparen} dnl or 1.1.7/1.1.7/;s/\\%{lparen}glib\\|gtk\\|libglade\\|gobject\\%{rparen}/&2/;s/py\\%{lparen}.*\\%{rparen} /python-\\1 /;/gtk2unixprint/d;s/^m4_define%{lparen}//p' | tr '\\n' ' ')
Requires: %python_gtk_req
%{py_requires}
%description
PyGTK is an extension module for python that gives you access to the
GTK+ widget set. Just about anything you can write in C with GTK+ you
can write in python with PyGTK (within reason), but with all of
python's benefits.
%package devel
License: LGPLv2.1+
Summary: Files needed to build wrappers for GTK+ addon libraries
Group: Development/Libraries/Python
Requires: %{name} = %{version} python-gobject2-devel python-cairo-devel
%description devel
This package contains files required to build wrappers for GTK+ addon
libraries so that they interoperate with pygtk.
%package doc
License: LGPLv2.1+
Summary: Python bindings for the GTK+ widget set
Group: Development/Libraries/Python
Requires: %{name} = %{version}
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description doc
PyGTK is an extension module for python that gives you access to the
GTK+ widget set. Just about anything you can write in C with GTK+ you
can write in python with PyGTK (within reason), but with all of
python's benefits.
%prep
%setup -q -n %{_name}-%{version}
%patch0 -p1
%build
%configure
make %{?jobs:-j%jobs}
%install
%makeinstall
find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -v
rm examples/Makefile*
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
cp -a AUTHORS NEWS README MAPPING ChangeLog THREADS COPYING examples $RPM_BUILD_ROOT%{_docdir}/%{name}
#chmod +x $RPM_BUILD_ROOT%{_libdir}/pygtk/2.0/{,*/}*.py $RPM_BUILD_ROOT%{_datadir}/pygtk/2.0/*/*.py
chmod +x $RPM_BUILD_ROOT%{_libdir}/pygtk/2.0/{,*/}*.py
%fdupes $RPM_BUILD_ROOT%{_libdir}
%fdupes $RPM_BUILD_ROOT%{_datadir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/[ACMNRT]*
%{py_sitedir}/gtk-2.0/*
%{_datadir}/%{_name}
%{_libdir}/%{_name}
%files devel
%defattr(-,root,root)
%doc %{_docdir}/%{name}/examples
%{_bindir}/%{_name}-codegen-2.0
%{_bindir}/%{_name}-demo
%{_includedir}/%{_name}-2.0/%{_name}
%{_libdir}/pkgconfig/*.pc
%files doc
%defattr(-,root,root)
%{_datadir}/gtk-doc/html/*
%changelog