2007-01-12 16:15:54 +00:00
#
2011-05-04 13:30:01 +00:00
# spec file for package python-gtk
2007-01-12 16:15:54 +00:00
#
2024-06-20 11:50:58 +00:00
# Copyright (c) 2024 SUSE LLC
2007-01-12 16:15:54 +00:00
#
2008-11-03 13:18:39 +00:00
# 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.
2019-11-27 17:11:02 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2007-01-12 16:15:54 +00:00
#
2008-04-08 22:46:18 +00:00
2017-07-13 07:09:28 +00:00
%define lparen (
%define rparen )
%define python_gtk_req %(zgrep -a _required_version %{SOURCE0} | 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' ' ')
2007-01-12 16:15:54 +00:00
Name : python-gtk
2017-07-13 07:09:28 +00:00
Version : 2.24.0
Release : 0
Summary : Python bindings for the GTK+ widget set
2018-03-05 17:51:43 +00:00
License : LGPL-2.1-or-later
2017-07-13 07:09:28 +00:00
Group : Development/Libraries/Python
2018-03-05 17:51:43 +00:00
URL : http://www.pygtk.org/
2017-07-13 07:09:28 +00:00
Source : http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-%{version} .tar.bz2
# PATCH-FIX-UPSTREAM pygtk-2.22.0-capsule.patch bgo#623965 bnc#669802 jmatejek@novell.com -- Conditionally use the new Capsule API instead of PyCObject
Patch0 : pygtk-2.22.0-capsule.patch
2021-05-18 09:07:40 +00:00
# PATCH-FIX-UPSTREAM pygtk-Drop-the-PangoFont-find_shaper-virtual-method.patch dimstar@opensuse.org -- Drop the PangoFont find_shaper virtual method
2019-11-27 17:11:02 +00:00
Patch1 : https://raw.githubusercontent.com/flathub/org.glimpse_editor.Glimpse/master/patches/pygtk-Drop-the-PangoFont-find_shaper-virtual-method.patch
2024-06-20 11:50:58 +00:00
# Patch to fix C99 violations [boo#1225916]
# originally from https://bugzilla.redhat.com/show_bug.cgi?id=2190017
Patch2 : pygtk2-c99.patch
2012-09-07 21:01:28 +00:00
BuildRequires : fdupes
2017-07-13 07:09:28 +00:00
# Only for directory ownership:
BuildRequires : gtk-doc
2012-09-07 21:01:28 +00:00
BuildRequires : libglade2-devel
BuildRequires : python-cairo-devel
BuildRequires : python-devel
BuildRequires : python-gobject2-devel
2022-01-12 19:39:04 +00:00
BuildRequires : python-rpm-macros
2017-07-13 07:09:28 +00:00
Requires : %{python_gtk_req}
2011-05-04 14:03:11 +00:00
# for cross-distro compatibility:
2011-05-05 07:25:08 +00:00
Provides : pygtk2 = %{version}
2017-07-13 07:09:28 +00:00
Provides : python2-gtk = %{version}
2007-01-12 16:15:54 +00:00
%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
Summary : Files needed to build wrappers for GTK+ addon libraries
Group : Development/Libraries/Python
2012-09-07 21:01:28 +00:00
Requires : %{name} = %{version}
Requires : python-cairo-devel
Requires : python-gobject2-devel
2017-07-13 07:09:28 +00:00
Provides : python2-gtk-devel = %{version}
2007-01-12 16:15:54 +00:00
%description devel
This package contains files required to build wrappers for GTK+ addon
libraries so that they interoperate with pygtk.
%package doc
Summary : Python bindings for the GTK+ widget set
Group : Development/Libraries/Python
Requires : %{name} = %{version}
2010-01-15 12:14:37 +00:00
BuildArch : noarch
2007-01-12 16:15:54 +00:00
%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
2023-11-27 15:46:34 +00:00
%autosetup -p1 -n pygtk-%{version}
2007-01-12 16:15:54 +00:00
2018-03-05 17:51:43 +00:00
find examples -type f -name " * . p y " -exec sed -i " s | # ! %{_bindir} / e n v p y t h o n | # ! %{_bindir} / p y t h o n 2 | " {} \;
find examples -type f -name " * . p y " -exec sed -i " s | # ! %{_bindir} / e n v p y t h o n | # ! %{_bindir} / p y t h o n 2 | " {} \;
2017-07-13 07:09:28 +00:00
2007-01-12 16:15:54 +00:00
%build
%configure
2017-07-13 07:09:28 +00:00
make %{?_smp_mflags}
2007-01-12 16:15:54 +00:00
%install
2017-07-13 07:09:28 +00:00
%make_install
find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -v
2011-10-11 13:29:32 +00:00
# move the docs to FHS-correct directory
2017-07-13 07:09:28 +00:00
mkdir -p %{buildroot} %{_docdir}
mv %{buildroot} %{_datadir} /gtk-doc %{buildroot} %{_docdir} /%{name}
2018-03-05 17:51:43 +00:00
sed -i " s | # ! %{_bindir} / p y t h o n | # ! %{_bindir} / p y t h o n 2 | " %{buildroot} %{_bindir} /pygtk-demo
2011-10-11 13:29:32 +00:00
2008-04-08 22:46:18 +00:00
rm examples/Makefile*
2010-08-08 13:40:28 +00:00
# demo is already in devel package
rm -rf examples/pygtk-demo
2017-07-13 07:09:28 +00:00
chmod +x %{buildroot} %{_libdir} /pygtk/2.0/{,*/}*.py
%fdupes %{buildroot} %{_libdir}
%fdupes %{buildroot} %{_datadir}
2007-01-12 16:15:54 +00:00
%files
2018-03-05 17:51:43 +00:00
%license COPYING
%doc AUTHORS NEWS README MAPPING ChangeLog THREADS
2017-07-13 07:09:28 +00:00
%exclude %{_docdir} /%{name} /html/
2020-03-23 13:27:21 +00:00
%{python2_sitearch} /gtk-2.0/gtk/
%{python2_sitearch} /gtk-2.0/atk.so
%{python2_sitearch} /gtk-2.0/gtkunixprint.so
%{python2_sitearch} /gtk-2.0/pango*.so
2007-01-12 16:15:54 +00:00
%files devel
2017-07-13 07:09:28 +00:00
%{_bindir} /pygtk-codegen-2.0
%{_bindir} /pygtk-demo
%{_includedir} /pygtk-2.0/pygtk/
2010-08-08 13:40:28 +00:00
%{_libdir} /pkgconfig/*.pc
# we explicitly list the directories here to be sure we don't include something
# that should live in the main package
2017-07-13 07:09:28 +00:00
%dir %{_datadir} /pygtk
%dir %{_libdir} /pygtk
%dir %{_datadir} /pygtk/2.0
%dir %{_libdir} /pygtk/2.0
%{_datadir} /pygtk/2.0/defs/
%{_libdir} /pygtk/2.0/pygtk-demo.py*
%{_libdir} /pygtk/2.0/demos/
2007-01-12 16:15:54 +00:00
%files doc
2017-07-13 07:09:28 +00:00
%doc examples/
%{_docdir} /%{name} /html/
2007-12-14 16:21:17 +00:00
2007-05-08 23:15:15 +00:00
%changelog