Accepting request 483214 from home:Zaitor:branches:GNOME:Factory

Revert, as the fallout is currently way more than I can handle alone, and frankly I suck at python things - we need to revisit this at a later time.

OBS-URL: https://build.opensuse.org/request/show/483214
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/python-gobject?expand=0&rev=80
This commit is contained in:
Bjørn Lie 2017-03-29 01:39:51 +00:00 committed by Git OBS Bridge
parent 5dddf0c019
commit 8f639b6cd8
5 changed files with 2205 additions and 109 deletions

4
pre_checkin.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
sed 's,build_for_python3 0,build_for_python3 1,;s,^\(Name: *\)python-gobject,\1python3-gobject,' python-gobject.spec > python3-gobject.spec
cp python-gobject.changes python3-gobject.changes

View File

@ -1,12 +1,3 @@
-------------------------------------------------------------------
Mon Mar 27 18:08:28 UTC 2017 - toddrme2178@gmail.com
- Switch to single-spec version.
- Add python version-dependent wrapper packages to pull in
necessary dependencies.
- Include all dependencies in -devel packages.
- Rebase .changes file to include changes in -devel package.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Mar 20 15:28:17 UTC 2017 - dimstar@opensuse.org Mon Mar 20 15:28:17 UTC 2017 - dimstar@opensuse.org

View File

@ -16,12 +16,24 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# This figures in an error message # This figures in an error message
%global __requires_exclude typelib\\(%%namespaces\\) %global __requires_exclude typelib\\(%%namespaces\\)
%global __requires_exclude_from ^%{python2_sitearch}/gi/__init__.py$ %global __requires_exclude_from ^%{local_py_sitedir}/gi/__init__.py$
%global __requires_exclude_from ^%{python3_sitearch}/gi/__init__.py$ %define build_for_python3 0
%if %{build_for_python3}
%define local_py_requires Requires: python(abi) = %py3_ver
%define local_py_sitedir %{python3_sitearch}
%define local_py_suffix 3
%define local_py_pkg python3
%define local_lib_ver 3-0
%else
%define local_py_requires %{py_requires}
%define local_py_sitedir %{py_sitedir}
%define local_py_suffix 2
%define local_py_pkg python
%define local_lib_ver 2-0
%endif
Name: python-gobject Name: python-gobject
%define _name pygobject %define _name pygobject
@ -39,31 +51,37 @@ BuildRequires: glib2-devel >= 2.38.0
BuildRequires: gnome-common BuildRequires: gnome-common
BuildRequires: gobject-introspection-devel >= 1.46.0 BuildRequires: gobject-introspection-devel >= 1.46.0
BuildRequires: libffi-devel >= 3.0.0 BuildRequires: libffi-devel >= 3.0.0
%if %{build_for_python3}
BuildRequires: python3-cairo-devel
BuildRequires: python3-devel
%else
BuildRequires: python-cairo-devel
BuildRequires: python-devel
%endif
BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(cairo-gobject) BuildRequires: pkgconfig(cairo-gobject)
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module cairo}
BuildRequires: %{python_module cairo-devel}
# Trigger an automatic installation of python(3)?-gobject when python and libgirepository are installed. # Trigger an automatic installation of python(3)?-gobject when python and libgirepository are installed.
Supplements: packageand(python:%{gdk_real_package}) Supplements: packageand(%{local_py_pkg}:libgirepository-1_0-1)
%if %local_py_suffix == 2
Provides: python2-gobject = %{version}
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{local_py_requires}
%python_subpackages
%description %description
Pygobjects is an extension module for python that gives you access to Pygobjects is an extension module for python that gives you access to
GLib's GObjects. GLib's GObjects.
%package Gdk %package Gdk
Summary: Python bindings for GObject -- Gdk bindings Summary: Python bindings for GObject -- Gdk bindings
Group: Development/Libraries/Python Group: Development/Libraries/Python
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: %{name}-cairo = %{version} Requires: %{name}-cairo = %{version}
%define gdk_real_package %(rpm -q --qf '%%{NAME}' -f $(readlink %{_libdir}/libgdk-3.so -f)) %if %local_py_suffix == 2
Supplements: packageand(python-gobject:%{gdk_real_package}) Provides: python2-gobject-Gdk = %{version}
%endif
%define gdk_real_package %(rpm -q --qf '%%{NAME}' -f $(readlink /usr/lib64/libgdk-3.so -f))
Supplements: packageand(%{name}:%{gdk_real_package})
%description Gdk %description Gdk
Pygobjects is an extension module for python that gives you access to Pygobjects is an extension module for python that gives you access to
@ -71,13 +89,15 @@ GLib's GObjects.
This package contains the Python Gdk bindings for GObject. This package contains the Python Gdk bindings for GObject.
%package cairo %package cairo
Summary: Python bindings for GObject -- Cairo bindings Summary: Python bindings for GObject -- Cairo bindings
Group: Development/Libraries/Python Group: Development/Libraries/Python
Requires: %{name} = %{version} Requires: %{name} = %{version}
%if %local_py_suffix == 2
Provides: python2-gobject-cairo = %{version}
%endif
%define cairo_real_package %(rpm -q --qf '%%{NAME}' --whatprovides cairo) %define cairo_real_package %(rpm -q --qf '%%{NAME}' --whatprovides cairo)
Supplements: packageand(python-gobject:%{cairo_real_package}) Supplements: packageand(%{name}:%{cairo_real_package})
%description cairo %description cairo
Pygobjects is an extension module for python that gives you access to Pygobjects is an extension module for python that gives you access to
@ -85,120 +105,85 @@ GLib's GObjects.
This package contains the Python Cairo bindings for GObject. This package contains the Python Cairo bindings for GObject.
%if ! %{build_for_python3}
# Dummy wrapper file to pull in all Python-version-specific dependencies
%package devel %package devel
Summary: Python bindings for GObject -- development files Summary: Python bindings for GObject
Requires: python-devel Group: Development/Libraries/Python
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: %{name}-Gdk = %{version} Requires: python3-gobject = %{version}
Requires: %{name}-cairo = %{version} # Until version 3.11.5, the -devel package contained python2 / python3 specifiecs
Requires: %{name}-common-devel = %{version} # AS this was cleared and the package no longer depends on the python version, the
# python3-gobject-devel package is no longer being built. In order to ease upgrades
# and remove the obsolete package, we obsolete/provide it here.
Obsoletes: python3-gobject-devel < 3.11.5
Provides: python2-gobject-devel = %{version}
Provides: python3-gobject-devel = %{version}
%description devel %description devel
This package contains files required to build wrappers for gobject This package contains files required to build wrappers for gobject
addon libraries such as pygtk. addon libraries such as pygtk.
%endif
%package -n %{name}-common-devel
Summary: Python bindings for GObject -- shared development files
Group: Development/Libraries/Python
Requires: glib2-devel >= 2.38.0
Requires: gnome-common
Requires: gobject-introspection-devel >= 1.46.0
Requires: libffi-devel >= 3.0.0
Requires: pkgconfig(cairo)
Requires: pkgconfig(cairo-gobject)
Provides: %{python_module gobject-common-devel = %{version}}
%description -n %{name}-common-devel
This package contains common files required to build wrappers for gobject
addon libraries such as pygtk in both Python2 and Python3.
%prep %prep
%setup -q -n %{_name}-%{version} %setup -q -n %{_name}-%{version}
%patch1 -p1 %patch1 -p1
%build %build
autoreconf -fiv autoreconf -fiv
%if %{build_for_python3}
# We want to do an out-of-source build export PYTHON=python3
%define _configure ../configure %else
export PYTHON=python2
%{python_expand mkdir build_%{$python_bin_suffix} %endif
pushd build_%{$python_bin_suffix} %configure \
%if %{build_for_python3}
export PYTHON=$python --without-common
%configure %endif
make %{?jobs:-j%jobs} V=1 make %{?jobs:-j%jobs} V=1
popd
}
%install %install
%{python_expand pushd build_%{$python_bin_suffix} %makeinstall
find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f
%make_install
popd
}
# Drop pygtkcompat layer.it's useless and we lack other stuff for it to work # Drop pygtkcompat layer.it's useless and we lack other stuff for it to work
%python_expand rm %{buildroot}%{$python_sitearch}/gi/pygtkcompat.py* rm %{buildroot}%{local_py_sitedir}/gi/pygtkcompat.py
%python_expand rm -r %{buildroot}%{$python_sitearch}/pygtkcompat/ rm -r %{buildroot}%{local_py_sitedir}/pygtkcompat/
# Drop GIMarshallingTests - It's test suite remainders that should not be installed # Drop GIMarshallingTests - It's test suite remainders that should not be installed
find %{buildroot}%{_prefix} -name GIMarshallingTests.py* -delete -print find %{buildroot}%{local_py_sitedir}/gi -name GIMarshallingTests.py* -delete -print
rm examples/Makefile* rm examples/Makefile*
find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f %fdupes $RPM_BUILD_ROOT
%fdupes %{buildroot} %clean
rm -rf $RPM_BUILD_ROOT
%files
%files %{python_files}
%defattr(-,root,root) %defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README %doc AUTHORS NEWS README ChangeLog examples
%doc examples/ %{local_py_sitedir}/gi/
%{python_sitearch}/gi/ %{local_py_sitedir}/*.egg-info
%{python_sitearch}/*.egg-info
# Lives in cairo subpackage # Lives in cairo subpackage
%exclude %{python_sitearch}/gi/_gi_cairo*.so %exclude %{local_py_sitedir}/gi/_gi_cairo*.so
# Lives in Gdk subpackage %exclude %{local_py_sitedir}/gi/overrides/Gdk.*
%exclude %{python_sitearch}/gi/overrides/Gdk.* %exclude %{local_py_sitedir}/gi/overrides/Gtk.*
%exclude %{python_sitearch}/gi/overrides/Gtk.* %exclude %{local_py_sitedir}/gi/overrides/keysyms.*
%exclude %{python_sitearch}/gi/overrides/keysyms.* %exclude %{local_py_sitedir}/gi/overrides/Pango.py
%exclude %{python_sitearch}/gi/overrides/Pango.*
%files Gdk
%files %{python_files Gdk}
%defattr(-,root,root) %defattr(-,root,root)
%doc AUTHORS COPYING %{local_py_sitedir}/gi/overrides/Gdk.*
%{python_sitearch}/gi/overrides/Gdk.* %{local_py_sitedir}/gi/overrides/Gtk.*
%{python_sitearch}/gi/overrides/Gtk.* %{local_py_sitedir}/gi/overrides/keysyms.*
%{python_sitearch}/gi/overrides/keysyms.* %{local_py_sitedir}/gi/overrides/Pango.py
%{python_sitearch}/gi/overrides/Pango.*
%files cairo
%files %{python_files cairo}
%defattr(-,root,root) %defattr(-,root,root)
%doc AUTHORS COPYING %{local_py_sitedir}/gi/_gi_cairo*.so
%{python_sitearch}/gi/_gi_cairo*.so
%if ! %{build_for_python3}
%files %{python_files devel} %files devel
%defattr(-,root,root) %defattr(-,root,root)
%doc AUTHORS COPYING
%files -n %{name}-common-devel
%defattr(-,root,root)
%doc AUTHORS COPYING
%{_includedir}/pygobject-3.0/ %{_includedir}/pygobject-3.0/
%{_libdir}/pkgconfig/pygobject-3.0.pc %{_libdir}/pkgconfig/pygobject-3.0.pc
%endif
%changelog %changelog

1927
python3-gobject.changes Normal file

File diff suppressed because it is too large Load Diff

189
python3-gobject.spec Normal file
View File

@ -0,0 +1,189 @@
#
# spec file for package python3-gobject
#
# Copyright (c) 2017 SUSE LINUX 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/
#
# This figures in an error message
%global __requires_exclude typelib\\(%%namespaces\\)
%global __requires_exclude_from ^%{local_py_sitedir}/gi/__init__.py$
%define build_for_python3 1
%if %{build_for_python3}
%define local_py_requires Requires: python(abi) = %py3_ver
%define local_py_sitedir %{python3_sitearch}
%define local_py_suffix 3
%define local_py_pkg python3
%define local_lib_ver 3-0
%else
%define local_py_requires %{py_requires}
%define local_py_sitedir %{py_sitedir}
%define local_py_suffix 2
%define local_py_pkg python
%define local_lib_ver 2-0
%endif
Name: python3-gobject
%define _name pygobject
Summary: Python bindings for GObject
License: LGPL-2.1+
Group: Development/Libraries/Python
Version: 3.24.0
Release: 0
Url: https://wiki.gnome.org/Projects/PyGObject/
Source: http://download.gnome.org/sources/pygobject/3.24/%{_name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM pycompile-searchpath.patch jmatejek@suse.com -- Fix build with python 3.4
Patch1: pycompile-searchpath.patch
BuildRequires: fdupes
BuildRequires: glib2-devel >= 2.38.0
BuildRequires: gnome-common
BuildRequires: gobject-introspection-devel >= 1.46.0
BuildRequires: libffi-devel >= 3.0.0
%if %{build_for_python3}
BuildRequires: python3-cairo-devel
BuildRequires: python3-devel
%else
BuildRequires: python-cairo-devel
BuildRequires: python-devel
%endif
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(cairo-gobject)
# Trigger an automatic installation of python(3)?-gobject when python and libgirepository are installed.
Supplements: packageand(%{local_py_pkg}:libgirepository-1_0-1)
%if %local_py_suffix == 2
Provides: python2-gobject = %{version}
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{local_py_requires}
%description
Pygobjects is an extension module for python that gives you access to
GLib's GObjects.
%package Gdk
Summary: Python bindings for GObject -- Gdk bindings
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: %{name}-cairo = %{version}
%if %local_py_suffix == 2
Provides: python2-gobject-Gdk = %{version}
%endif
%define gdk_real_package %(rpm -q --qf '%%{NAME}' -f $(readlink /usr/lib64/libgdk-3.so -f))
Supplements: packageand(%{name}:%{gdk_real_package})
%description Gdk
Pygobjects is an extension module for python that gives you access to
GLib's GObjects.
This package contains the Python Gdk bindings for GObject.
%package cairo
Summary: Python bindings for GObject -- Cairo bindings
Group: Development/Libraries/Python
Requires: %{name} = %{version}
%if %local_py_suffix == 2
Provides: python2-gobject-cairo = %{version}
%endif
%define cairo_real_package %(rpm -q --qf '%%{NAME}' --whatprovides cairo)
Supplements: packageand(%{name}:%{cairo_real_package})
%description cairo
Pygobjects is an extension module for python that gives you access to
GLib's GObjects.
This package contains the Python Cairo bindings for GObject.
%if ! %{build_for_python3}
%package devel
Summary: Python bindings for GObject
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: python3-gobject = %{version}
# Until version 3.11.5, the -devel package contained python2 / python3 specifiecs
# AS this was cleared and the package no longer depends on the python version, the
# python3-gobject-devel package is no longer being built. In order to ease upgrades
# and remove the obsolete package, we obsolete/provide it here.
Obsoletes: python3-gobject-devel < 3.11.5
Provides: python2-gobject-devel = %{version}
Provides: python3-gobject-devel = %{version}
%description devel
This package contains files required to build wrappers for gobject
addon libraries such as pygtk.
%endif
%prep
%setup -q -n %{_name}-%{version}
%patch1 -p1
%build
autoreconf -fiv
%if %{build_for_python3}
export PYTHON=python3
%else
export PYTHON=python2
%endif
%configure \
%if %{build_for_python3}
--without-common
%endif
make %{?jobs:-j%jobs} V=1
%install
%makeinstall
find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f
# Drop pygtkcompat layer.it's useless and we lack other stuff for it to work
rm %{buildroot}%{local_py_sitedir}/gi/pygtkcompat.py
rm -r %{buildroot}%{local_py_sitedir}/pygtkcompat/
# Drop GIMarshallingTests - It's test suite remainders that should not be installed
find %{buildroot}%{local_py_sitedir}/gi -name GIMarshallingTests.py* -delete -print
rm examples/Makefile*
%fdupes $RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc AUTHORS NEWS README ChangeLog examples
%{local_py_sitedir}/gi/
%{local_py_sitedir}/*.egg-info
# Lives in cairo subpackage
%exclude %{local_py_sitedir}/gi/_gi_cairo*.so
%exclude %{local_py_sitedir}/gi/overrides/Gdk.*
%exclude %{local_py_sitedir}/gi/overrides/Gtk.*
%exclude %{local_py_sitedir}/gi/overrides/keysyms.*
%exclude %{local_py_sitedir}/gi/overrides/Pango.py
%files Gdk
%defattr(-,root,root)
%{local_py_sitedir}/gi/overrides/Gdk.*
%{local_py_sitedir}/gi/overrides/Gtk.*
%{local_py_sitedir}/gi/overrides/keysyms.*
%{local_py_sitedir}/gi/overrides/Pango.py
%files cairo
%defattr(-,root,root)
%{local_py_sitedir}/gi/_gi_cairo*.so
%if ! %{build_for_python3}
%files devel
%defattr(-,root,root)
%{_includedir}/pygobject-3.0/
%{_libdir}/pkgconfig/pygobject-3.0.pc
%endif
%changelog