import sources

This commit is contained in:
Adam Samalik 2023-05-16 09:46:44 +02:00
parent cc1d36b017
commit 7e66bc4e50
4 changed files with 115 additions and 104 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/pygtk-2.24.0.tar.bz2
/pygtk-2.24.0.tar.bz2

View File

@ -1,29 +0,0 @@
--- pygtk-2.10.4/gtk/__init__.py.orig 2007-01-16 07:50:07.000000000 -0500
+++ pygtk-2.10.4/gtk/__init__.py 2007-02-05 17:09:37.000000000 -0500
@@ -59,19 +59,14 @@
def _init():
import sys
- try:
- sys_path = sys.path[:]
+ sys_path = sys.path[:]
- try:
- _gtk.init_check()
- except RuntimeError, e:
- import warnings
- warnings.warn(str(e), _gtk.Warning)
- finally:
- # init_check calls PySys_SetArgv which calls sys.path.insert(0, ''),
- # which causes problems for pychecker, restore it if modified.
- if sys.path != sys_path:
- sys.path[:] = sys_path
+ _gtk.init_check()
+
+ # init_check calls PySys_SetArgv which calls sys.path.insert(0, ''),
+ # which causes problems for pychecker, restore it if modified.
+ if sys.path != sys_path:
+ sys.path[:] = sys_path
# install the default log handlers
_gtk.add_log_handlers()

View File

@ -1,32 +1,28 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
# Last updated for version 2.17.0
%define glib2_version 2.8.0
%define pango_version 1.16.0
%define gtk2_version 2.9.0
%define libglade2_version 2.5.0
%define pycairo_version 1.0.2
%define pygobject2_version 2.21.3
%define python2_version 2.3.5
%define buildglade %(pkg-config libglade-2.0 && echo 1 || echo 0)
### Abstract ###
Name: pygtk2
Version: 2.24.0
Release: 9%{?dist}
Release: 25%{?dist}
License: LGPLv2+
Group: Development/Languages
Summary: Python bindings for GTK+
URL: http://www.pygtk.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Source: http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-%{version}.tar.bz2
### Patches ###
# https://bugzilla.gnome.org/show_bug.cgi?id=660216
# https://git.gnome.org/browse/pygtk/commit/?id=eca72baa56
Patch0: 0001-Fix-leaks-of-Pango-objects.patch
# RH bug #208608
Patch0: pygtk-nodisplay-exception.patch
# This was dropped from gnome-python; obsolete it here because, well,
# we have to put it somewhere
@ -36,7 +32,7 @@ Obsoletes: gnome-python2-applet < 2.32.0-5
# Leave these requirements alone! RPM isn't smart enough
# to derive these from the build requirements below.
Requires: pycairo
Requires: python2-cairo
Requires: pygobject2
### Build Dependencies ###
@ -45,12 +41,19 @@ BuildRequires: automake
BuildRequires: docbook-style-xsl
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gtk2-devel >= %{gtk2_version}
BuildRequires: libglade2-devel >= %{libglade2_version}
BuildRequires: libtool
BuildRequires: libxslt
BuildRequires: numpy
# python2-numpy is only needed if you use a small subset of pygtk2, and has
# to be pulled in explicitly - there is no longer a hard Requires. Since we're
# not including python2-numpy in the GIMP Flatpak, which is the only Flatpak where
# we're including pygtk, there is no reason to build the support at all for
# a Flatpak build. (This avoids having to build python2-numpy and a pile of
# dependencies in the GIMP Flatpak.)
%if !0%{?flatpak}
BuildRequires: python2-numpy
%endif
BuildRequires: pango-devel >= %{pango_version}
BuildRequires: pycairo-devel >= %{pycairo_version}
BuildRequires: python2-cairo-devel >= %{pycairo_version}
BuildRequires: pygobject2-devel >= %{pygobject2_version}
BuildRequires: python2-devel >= %{python2_version}
@ -67,24 +70,13 @@ Group: Development/Languages
%description codegen
This package contains the C code generation program for PyGTK.
%package libglade
Summary: A wrapper for the libglade library for use with PyGTK
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
%description libglade
This module contains a wrapper for the libglade library. Libglade allows
a program to construct its user interface from an XML description, which
allows the programmer to keep the UI and program logic separate.
%package devel
Summary: Development files for building add-on libraries
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
Requires: %{name}-codegen = %{version}-%{release}
Requires: %{name}-doc = %{version}-%{release}
Requires: pkgconfig
Requires: pycairo-devel
Requires: python2-cairo-devel
Requires: pygobject2-devel
%description devel
@ -101,75 +93,122 @@ This package contains documentation files for %{name}.
%prep
%setup -q -n pygtk-%{version}
%patch0 -p1
%patch0 -p1 -b .Fix-leaks-of-Pango-objects
# Fix shebangs to system Python2.x
for file in $(find . -name '*.py' -type f)
do
%{__sed} -i.orig \
-e 's~#!/usr/bin/python(2\?)~#!%{__python2}~'\
-e 's~#!/usr/bin/env python(2\?)~#!%{__python2}~'\
${file}
/bin/touch -r ${file}.orig ${file}
%{__rm} -f ${file}.orig
done
%build
%configure --enable-thread --enable-numpy
export tagname=CC
make LIBTOOL=/usr/bin/libtool
%if !0%{?flatpak}
%configure --enable-thread --disable-numpy --without-glade
%else
%configure --enable-thread --enable-numpy --without-glade
%endif
%{make_build}
%install
rm -rf $RPM_BUILD_ROOT
export tagname=CC
make LIBTOOL=/usr/bin/libtool DESTDIR=$RPM_BUILD_ROOT install
find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f
%{make_install}
find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f
%clean
rm -fr $RPM_BUILD_ROOT
# Fix python shebangs
sed -i 's|^#! /usr/bin/python(2\?)|#!%{__python2}|' %{buildroot}%{_bindir}/pygtk-demo
%files
%defattr(644, root, root, 755)
%doc AUTHORS NEWS README MAPPING COPYING
%dir %{python_sitearch}/gtk-2.0
%dir %{python_sitearch}/gtk-2.0/gtk
%{python_sitearch}/gtk-2.0/gtk/*.py*
%dir %{_libdir}/pygtk
%dir %{_libdir}/pygtk/2.0
%{_libdir}/pygtk/2.0/*
%defattr(755, root, root, 755)
%doc AUTHORS NEWS README MAPPING
%license COPYING
%{_bindir}/pygtk-demo
%{python_sitearch}/gtk-2.0/atk.so
%{python_sitearch}/gtk-2.0/pango.so
%{python_sitearch}/gtk-2.0/gtk/_gtk.so
%{python_sitearch}/gtk-2.0/gtkunixprint.so
%{python_sitearch}/gtk-2.0/pangocairo.so
%if %{buildglade}
%files libglade
%defattr(755, root, root, 755)
%{python_sitearch}/gtk-2.0/gtk/glade.so
%endif
%{_libdir}/pygtk/
%dir %{python2_sitearch}/gtk-2.0
%dir %{python2_sitearch}/gtk-2.0/gtk
%{python2_sitearch}/gtk-2.0/gtk/*.py*
%{python2_sitearch}/gtk-2.0/gtk/_gtk.so
%{python2_sitearch}/gtk-2.0/*.so
%files codegen
%defattr(755, root, root, 755)
%{_prefix}/bin/pygtk-codegen-2.0
%{_bindir}/pygtk-codegen-2.0
%files devel
%defattr(644, root, root, 755)
%dir %{_prefix}/include/pygtk-2.0
%dir %{_prefix}/include/pygtk-2.0/pygtk
%{_prefix}/include/pygtk-2.0/pygtk/*.h
%{_includedir}/pygtk-2.0/
%{_libdir}/pkgconfig/pygtk-2.0.pc
%dir %{_prefix}/share/pygtk
%dir %{_prefix}/share/pygtk/2.0
%dir %{_prefix}/share/pygtk/2.0/defs
%{_prefix}/share/pygtk/2.0/defs/*.defs
%{_prefix}/share/pygtk/2.0/defs/pangocairo.override
%{_datadir}/pygtk/
%files doc
%defattr(644, root, root, 755)
%doc examples
%{_datadir}/gtk-doc/html/pygtk
%{_datadir}/gtk-doc/html/pygtk/
%changelog
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 2.24.0-9
- Mass rebuild 2014-01-24
* Mon Jan 11 2021 Jan Beran <jaberan@redhat.com> 2.24.0-25
- Fix shebang mangling for _prefix=app (#1907579)
- disable numpy for flatpak (#1907579)
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 2.24.0-8
- Mass rebuild 2013-12-27
* Wed Sep 12 2018 Josef Ridky <jridky@redhat.com> - 2.24.0-24
- remove libglade dependency and sub-package (#1622134)
* Tue Mar 02 2013 Colin Walters <walters@verbum.org> - 2.24.0-7
* Tue Aug 14 2018 Josef Ridky <jridky@redhat.com> - 2.24.0-23.1
- fix python2 regex in sed command
* Tue Aug 14 2018 Josef Ridky <jridky@redhat.com> - 2.24.0-23
- resotre doc sub package
* Mon Aug 13 2018 Josef Ridky <jridky@redhat.com> - 2.24.0-22
- fix python2 macros
* Fri Jun 22 2018 Troy Dawson <tdawson@redhat.com> - 2.24.0-21.1
- Fix python shebangs (#1580855)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.24.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Feb 01 2018 Leigh Scott <leigh123linux@googlemail.com> - 2.24.0-20
- Try again to fix shebangs
* Thu Feb 01 2018 Leigh Scott <leigh123linux@googlemail.com> - 2.24.0-19
- Fix shebangs
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.24.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.24.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.24.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24.0-15
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Sun Apr 17 2016 Leigh Scott <leigh123linux@googlemail.com> - 2.24.0-14
- Fix leaks of Pango objects (bz 660216)
- Update macros in files section
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.24.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Leigh Scott <leigh123linux@googlemail.com> - 2.24.0-12
- use license tag for COPYING
* Sat Dec 06 2014 Leigh Scott <leigh123linux@googlemail.com> - 2.24.0-11
- update spec file
- drop patch (system-config-authentication is a gui app that requires X and I don't give a damn if it segfaults because someone runs it without X)
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sat Mar 02 2013 Colin Walters <walters@verbum.org> - 2.24.0-7
- Patch from mbarnes to hopefully fix multilib conflict
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24.0-6
@ -421,7 +460,7 @@ rm -fr $RPM_BUILD_ROOT
python support is added
- Add a Requires on python-numeric as well
* Tue Aug 18 2005 John (J5) Palmieri <johnp@redhat.com> - 2.7.3-2
* Thu Aug 18 2005 John (J5) Palmieri <johnp@redhat.com> - 2.7.3-2
- Bump and rebuild for cairo ABI changes
* Wed Aug 10 2005 <jrb@redhat.com> - 2.7.3-1

View File

@ -1 +1 @@
SHA1 (pygtk-2.24.0.tar.bz2) = 344e6a32a5e8c7e0aaeb807e0636a163095231c2
SHA512 (pygtk-2.24.0.tar.bz2) = 64f4344fcf7636e0b2016ffd5310250b5c02a1bf87e44aef39b5d4cf4a5fc50d27cb4f030d4c6802cff61fffb88dee7752821e3d8a4cd1c34dc3745d9ff2f0da