fca856
# Last updated for version 3.18.0
fca856
%define glib2_version                  2.38.0
fca856
%define gobject_introspection_version  1.46.0
fca856
%define python2_version                2.7
fca856
fca856
%if 0%{?fedora} > 12
fca856
%global with_python3 1
fca856
%define python3_version                3.1
fca856
%endif
fca856
fca856
%global with_check 0
fca856
fca856
Name:           pygobject3
fca856
Version:        3.22.0
fca856
Release:        1%{?dist}.1
fca856
Summary:        Python bindings for GObject Introspection
fca856
fca856
License:        LGPLv2+ and MIT
fca856
URL:            https://wiki.gnome.org/Projects/PyGObject
fca856
Source0:        https://download.gnome.org/sources/pygobject/3.22/pygobject-%{version}.tar.xz
fca856
fca856
# https://bugzilla.redhat.com/1247996
fca856
# which reverts https://bugzilla.gnome.org/709183
fca856
Patch1:         pygobject-3.22.0-allow-static-module-import.patch
fca856
fca856
BuildRequires:  glib2-devel >= %{glib2_version}
fca856
BuildRequires:  gobject-introspection-devel >= %{gobject_introspection_version}
fca856
BuildRequires:  python2-devel >= %{python2_version}
fca856
%if 0%{?with_python3}
fca856
BuildRequires:  python3-devel >= %{python3_version}
fca856
BuildRequires:  python3-cairo-devel
fca856
%endif # if with_python3
fca856
fca856
BuildRequires:  cairo-gobject-devel
fca856
BuildRequires:  pycairo-devel
fca856
fca856
# Required by the upstream selftest suite:
fca856
%if %{with_check}
fca856
%if 0%{?fedora}
fca856
# Temporarily disabled pyflakes tests to avoid the build failing due to too new
fca856
# pyflakes 0.7.2 in F19
fca856
# https://bugzilla.gnome.org/show_bug.cgi?id=701009
fca856
#BuildRequires:  pyflakes
fca856
BuildRequires:  python-pep8
fca856
%endif
fca856
## for the Gdk and Gtk typelibs, used during the test suite:
fca856
BuildRequires:  gtk3
fca856
## for xvfb-run:
fca856
BuildRequires:  xorg-x11-server-Xvfb
fca856
BuildRequires:  dejavu-sans-fonts
fca856
BuildRequires:  dejavu-sans-mono-fonts
fca856
BuildRequires:  dejavu-serif-fonts
fca856
## for dbus-launch, used by test_gdbus:
fca856
BuildRequires:  dbus-x11
fca856
%endif # with_check
fca856
fca856
%description
fca856
The %{name} package provides a convenient wrapper for the GObject library
fca856
for use in Python programs.
fca856
fca856
%package     -n python-gobject
fca856
Summary:        Python 2 bindings for GObject Introspection
fca856
Requires:       python-gobject-base%{?_isa} = %{version}-%{release}
fca856
# The cairo override module depends on this
fca856
Requires:       pycairo%{?_isa}
fca856
fca856
Obsoletes:      %{name} < 3.17.90-2
fca856
Provides:       %{name} = %{version}-%{release}
fca856
Provides:       %{name}%{?_isa} = %{version}-%{release}
fca856
fca856
%description -n python-gobject
fca856
The python-gobject package provides a convenient wrapper for the GObject
fca856
library and and other libraries that are compatible with GObject Introspection,
fca856
for use in Python 2 programs.
fca856
fca856
%package     -n python-gobject-base
fca856
Summary:        Python 2 bindings for GObject Introspection base package
fca856
Requires:       gobject-introspection%{?_isa} >= %{gobject_introspection_version}
fca856
fca856
Obsoletes:      %{name}-base < 3.17.90-2
fca856
Provides:       %{name}-base = %{version}-%{release}
fca856
Provides:       %{name}-base%{?_isa} = %{version}-%{release}
fca856
fca856
%description -n python-gobject-base
fca856
This package provides the non-cairo specific bits of the GObject Introspection
fca856
library.
fca856
fca856
%if 0%{?with_python3}
fca856
%package     -n python3-gobject
fca856
Summary:        Python 3 bindings for GObject Introspection
fca856
Requires:       python3-gobject-base%{?_isa} = %{version}-%{release}
fca856
# The cairo override module depends on this
fca856
Requires:       python3-cairo%{?_isa}
fca856
fca856
%description -n python3-gobject
fca856
The python3-gobject package provides a convenient wrapper for the GObject 
fca856
library and and other libraries that are compatible with GObject Introspection, 
fca856
for use in Python 3 programs.
fca856
fca856
%package     -n python3-gobject-base
fca856
Summary:        Python 3 bindings for GObject Introspection base package
fca856
Requires:       gobject-introspection%{?_isa} >= %{gobject_introspection_version}
fca856
fca856
%description -n python3-gobject-base
fca856
This package provides the non-cairo specific bits of the GObject Introspection
fca856
library.
fca856
fca856
%endif # with_python3
fca856
fca856
%package        devel
fca856
Summary:        Development files for embedding PyGObject introspection support
fca856
Requires:       python-gobject%{?_isa} = %{version}-%{release}
fca856
%if 0%{?with_python3}
fca856
Requires:       python3-gobject%{?_isa} = %{version}-%{release}
fca856
%endif
fca856
Requires:       gobject-introspection-devel%{?_isa}
fca856
fca856
%description    devel
fca856
This package contains files required to embed PyGObject
fca856
fca856
%prep
fca856
%setup -q -n pygobject-%{version}
fca856
%patch1 -p1 -b .allow-static-module-import
fca856
fca856
%if 0%{?with_python3}
fca856
rm -rf %{py3dir}
fca856
cp -a . %{py3dir}
fca856
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
fca856
%endif # with_python3
fca856
fca856
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
fca856
fca856
%build
fca856
PYTHON=%{__python} 
fca856
export PYTHON
fca856
%configure
fca856
make %{?_smp_mflags} V=1
fca856
fca856
%if 0%{?with_python3}
fca856
pushd %{py3dir}
fca856
PYTHON=%{__python3}
fca856
export PYTHON
fca856
%configure
fca856
make %{?_smp_mflags} V=1
fca856
popd
fca856
%endif # with_python3
fca856
fca856
%install
fca856
%if 0%{?with_python3}
fca856
pushd %{py3dir}
fca856
PYTHON=%{__python3}
fca856
export PYTHON
fca856
%make_install
fca856
popd
fca856
fca856
%endif # with_python3
fca856
fca856
%make_install
fca856
find $RPM_BUILD_ROOT -name '*.la' -delete
fca856
fca856
# Don't include makefiles in the installed docs, in order to avoid creating
fca856
# multilib conflicts
fca856
rm -rf _docs
fca856
mkdir _docs
fca856
cp -a examples _docs
fca856
rm _docs/examples/Makefile*
fca856
fca856
%check
fca856
%if %{with_check}
fca856
# Run the selftests under a temporary xvfb X server (so that they can
fca856
# initialize Gdk etc):
fca856
fca856
# FIXME: disabled for python3
fca856
# Currently this fails with python3 with:
fca856
#  File "/builddir/build/BUILD/python3-pygobject3-3.3.4-4.fc19/gi/__init__.py", line 23, in <module>
fca856
#    from ._gi import _API, Repository
fca856
#ValueError: level must be >= 0
fca856
# Reported upstream as http://bugs.python.org/issue15610
fca856
%if 0
fca856
pushd %{py3dir}
fca856
PYTHON=%{__python3}
fca856
export PYTHON
fca856
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
fca856
popd
fca856
%endif # with_python3
fca856
fca856
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
fca856
fca856
%endif # with_check
fca856
fca856
%files -n python-gobject
fca856
%{python_sitearch}/gi/_gi_cairo.so
fca856
fca856
%files -n python-gobject-base
fca856
%license COPYING
fca856
%doc AUTHORS NEWS README
fca856
%dir %{python_sitearch}/gi
fca856
%{python_sitearch}/gi/*
fca856
%exclude %{python_sitearch}/gi/_gi_cairo.so
fca856
%{python_sitearch}/pygobject-*.egg-info
fca856
%{python_sitearch}/pygtkcompat/
fca856
fca856
%if 0%{?with_python3}
fca856
%files -n python3-gobject
fca856
%{python3_sitearch}/gi/_gi_cairo*.so
fca856
fca856
%files -n python3-gobject-base
fca856
%license COPYING
fca856
%doc AUTHORS NEWS README
fca856
%dir %{python3_sitearch}/gi
fca856
%{python3_sitearch}/gi/*
fca856
%exclude %{python3_sitearch}/gi/_gi_cairo*.so
fca856
%{python3_sitearch}/pygobject-*.egg-info
fca856
%{python3_sitearch}/pygtkcompat/
fca856
%endif # with_python3
fca856
fca856
%files devel
fca856
%doc _docs/*
fca856
%dir %{_includedir}/pygobject-3.0/
fca856
%{_includedir}/pygobject-3.0/pygobject.h
fca856
%{_libdir}/pkgconfig/pygobject-3.0.pc
fca856
fca856
%changelog
fca856
* Thu Nov 09 2017 John Francini - 3.22.0-1.1
fca856
- Bump release to allow rebuild to fix BZ#1510160
fca856
fca856
* Mon Sep 19 2016 Kalev Lember <klember@redhat.com> - 3.22.0-1
fca856
- Update to 3.22.0
fca856
- Resolves: #1387039
fca856
fca856
* Tue Sep 15 2015 Matthew Barnes <mbarnes@redhat.com> - 3.14.0-3
fca856
- Allow importing static modules to fix RHEL7 rebase regressions
fca856
fca856
* Fri May 22 2015 Rui Matos <rmatos@redhat.com> - 3.14.0-2
fca856
- Add patch to fix a coverity issue
fca856
  https://bugzilla.gnome.org/show_bug.cgi?id=749698
fca856
fca856
* Mon Sep 22 2014 Kalev Lember <kalevlember@gmail.com> - 3.14.0-1
fca856
- Update to 3.14.0
fca856
fca856
* Tue Sep 16 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.92-1
fca856
- Update to 3.13.92
fca856
fca856
* Tue Sep 02 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.91-1
fca856
- Update to 3.13.91
fca856
fca856
* Thu Aug 21 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.90-2
fca856
- Backport a fix for virt-manager crash (#1130758)
fca856
fca856
* Tue Aug 19 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.90-1
fca856
- Update to 3.13.90
fca856
fca856
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.13.4-2
fca856
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
fca856
fca856
* Fri Aug 15 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.4-1
fca856
- Update to 3.13.4
fca856
fca856
* Tue Jun 24 2014 Richard Hughes <rhughes@redhat.com> - 3.13.3-1
fca856
- Update to 3.13.3
fca856
fca856
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.13.2-2
fca856
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
fca856
fca856
* Mon May 26 2014 Kalev Lember <kalevlember@gmail.com> - 3.13.2-1
fca856
- Update to 3.13.2
fca856
- Drop old testsuite patches
fca856
fca856
* Mon May 12 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 3.13.1-2
fca856
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
fca856
fca856
* Tue Apr 29 2014 Richard Hughes <rhughes@redhat.com> - 3.13.1-1
fca856
- Update to 3.13.1
fca856
fca856
* Tue Apr 15 2014 Kalev Lember <kalevlember@gmail.com> - 3.12.1-1
fca856
- Update to 3.12.1
fca856
fca856
* Sat Apr 05 2014 Kalev Lember <kalevlember@gmail.com> - 3.12.0-2
fca856
- Update dep versions
fca856
- Tighten deps with %%_isa
fca856
fca856
* Mon Mar 24 2014 Richard Hughes <rhughes@redhat.com> - 3.12.0-1
fca856
- Update to 3.12.0
fca856
fca856
* Tue Mar 18 2014 Richard Hughes <rhughes@redhat.com> - 3.11.92-1
fca856
- Update to 3.11.92
fca856
fca856
* Tue Mar 04 2014 Richard Hughes <rhughes@redhat.com> - 3.11.91-1
fca856
- Update to 3.11.91
fca856
fca856
* Tue Feb 18 2014 Richard Hughes <rhughes@redhat.com> - 3.11.90-1
fca856
- Update to 3.11.90
fca856
fca856
* Wed Feb 05 2014 Richard Hughes <rhughes@redhat.com> - 3.11.5-1
fca856
- Update to 3.11.5
fca856
fca856
* Tue Jan 14 2014 Richard Hughes <rhughes@redhat.com> - 3.11.4-1
fca856
- Update to 3.11.4
fca856
fca856
* Tue Dec 17 2013 Richard Hughes <rhughes@redhat.com> - 3.11.3-1
fca856
- Update to 3.11.3
fca856
fca856
* Mon Nov 18 2013 Richard Hughes <rhughes@redhat.com> - 3.11.2-1
fca856
- Update to 3.11.2
fca856
fca856
* Tue Oct 29 2013 Richard Hughes <rhughes@redhat.com> - 3.11.1-1
fca856
- Update to 3.11.1
fca856
fca856
* Wed Sep 25 2013 Kalev Lember <kalevlember@gmail.com> - 3.10.0-1
fca856
- Update to 3.10.0
fca856
fca856
* Wed Sep 18 2013 Kalev Lember <kalevlember@gmail.com> - 3.9.92-1
fca856
- Update to 3.9.92
fca856
fca856
* Tue Sep 03 2013 Kalev Lember <kalevlember@gmail.com> - 3.9.91-1
fca856
- Update to 3.9.91
fca856
fca856
* Thu Aug 22 2013 Kalev Lember <kalevlember@gmail.com> - 3.9.90-1
fca856
- Update to 3.9.90
fca856
fca856
* Fri Aug  9 2013 Daniel Drake <dsd@laptop.org> - 3.9.5-1
fca856
- Update to 3.9.5
fca856
fca856
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.9.2-2
fca856
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
fca856
fca856
* Sun Jun 02 2013 Kalev Lember <kalevlember@gmail.com> - 3.9.2-1
fca856
- Update to 3.9.2
fca856
fca856
* Sun Jun 02 2013 Kalev Lember <kalevlember@gmail.com> - 3.9.1-2
fca856
- Disable pyflakes tests to avoid failures with too new pyflakes 0.7.2
fca856
fca856
* Fri May 10 2013 Richard Hughes <rhughes@redhat.com> - 3.9.1-1
fca856
- Update to 3.9.1
fca856
fca856
* Thu Apr 25 2013 Peter Robinson <pbrobinson@fedoraproject.org> 3.8.1-2
fca856
- Add upstream patch to fix Sugar (RHBZ 947538)
fca856
fca856
* Mon Apr 15 2013 Kalev Lember <kalevlember@gmail.com> - 3.8.1-1
fca856
- Update to 3.8.1
fca856
fca856
* Tue Apr  2 2013 David Malcolm <dmalcolm@redhat.com> - 3.8.0-2
fca856
- add workarounds for ppc64 (rhbz#924425)
fca856
fca856
* Tue Mar 26 2013 Kalev Lember <kalevlember@gmail.com> - 3.8.0-1
fca856
- Update to 3.8.0
fca856
fca856
* Wed Mar 20 2013 Kalev Lember <kalevlember@gmail.com> - 3.7.92-1
fca856
- Update to 3.7.92
fca856
fca856
* Thu Mar  7 2013 Matthias Clasen <mclasen@redhat.com> - 3.7.91-1
fca856
- Update to 3.7.91
fca856
fca856
* Thu Feb 21 2013 Kalev Lember <kalevlember@gmail.com> - 3.7.90-1
fca856
- Update to 3.7.90
fca856
fca856
* Wed Feb 06 2013 Kalev Lember <kalevlember@gmail.com> - 3.7.5.1-1
fca856
- Update to 3.7.5.1
fca856
- Re-enable tests
fca856
fca856
* Wed Jan 16 2013 Matthias Clasen <mclasen@redhat.com> - 3.7.4-1
fca856
- Update to 3.7.4
fca856
fca856
* Fri Dec 28 2012 Dan HorĂ¡k <dan[at]danny.cz> - 3.7.3-2
fca856
- Fix GBytes test (gnome#690837)
fca856
fca856
* Thu Dec 20 2012 Kalev Lember <kalevlember@gmail.com> - 3.7.3-1
fca856
- Update to 3.7.3
fca856
- Drop upstreamed patches; rebase the ignore-more-pep8-errors patch
fca856
fca856
* Thu Dec 13 2012 Ray Strode <rstrode@redhat.com> 3.7.1-3
fca856
- Split non-cairo parts into a subpackage
fca856
fca856
* Mon Nov 12 2012 Kalev Lember <kalevlember@gmail.com> - 3.7.1-2
fca856
- Remove lib64 rpaths (#817701)
fca856
- Move code examples to the -devel subpackage and fix the multilib
fca856
  conflict (#831434)
fca856
fca856
* Fri Nov 09 2012 Kalev Lember <kalevlember@gmail.com> - 3.7.1-1
fca856
- Update to 3.7.1
fca856
fca856
* Tue Nov  6 2012 Daniel Drake <dsd@laptop.org> - 3.4.1.1-2
fca856
- Upstream fix for property lookup; needed for basic Sugar operation.
fca856
fca856
* Wed Oct 17 2012 Kalev Lember <kalevlember@gmail.com> - 3.4.1.1-1
fca856
- Update to 3.4.1.1
fca856
fca856
* Thu Sep 13 2012 Daniel Drake <dsd@laptop.org> - 3.3.91-1
fca856
- Latest version; upstreamed patches dropped
fca856
fca856
* Wed Aug 15 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-9
fca856
- avoid dragging pyflakes and python-pep8 into RHEL (patch 7)
fca856
fca856
* Fri Aug 10 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-8
fca856
- add endianness patch (rhbz#841596; attachment 603634)
fca856
fca856
* Fri Aug 10 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-7
fca856
- update endianness patch for rhbz#841596 (to attachment 603367)
fca856
fca856
* Thu Aug  9 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-6
fca856
- fix issues on big-endian 64-bit machines (rhbz#841596, rhbz#842880)
fca856
fca856
* Thu Aug  9 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-5
fca856
- use xvfb-run in selftests; update known failures
fca856
fca856
* Wed Aug  8 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-4
fca856
- add a %%check check; add V=1 to all make invocations
fca856
fca856
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-3
fca856
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
fca856
fca856
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-2
fca856
- remove rhel logic from with_python3 conditional
fca856
fca856
* Tue Jul 17 2012 Richard Hughes <hughsient@gmail.com> - 3.3.4-1
fca856
- Update to 3.3.4
fca856
fca856
* Tue Jun 26 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.3.1-2
fca856
- fix a segfault when dealing with mismatched .so/typelib files
fca856
fca856
* Mon Jun 25 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 3.3.3.1-1
fca856
- Update to 3.3.3.1
fca856
fca856
* Tue Jun 19 2012 Kalev Lember <kalevlember@gmail.com> - 3.3.2-1
fca856
- Update to 3.3.2
fca856
fca856
* Sat May 05 2012 Kalev Lember <kalevlember@gmail.com> - 3.3.1-1
fca856
- Update to 3.3.1
fca856
- Dropped the now unneeded -lm patch
fca856
fca856
* Tue Mar 27 2012 Kalev Lember <kalevlember@gmail.com> - 3.2.0-1
fca856
- Update to 3.2.0
fca856
fca856
* Thu Mar 22 2012 Matthias Clasen <mclasen@redhat.com> - 3.1.93-1
fca856
- Update to 3.1.93
fca856
fca856
* Wed Mar 21 2012 Kalev Lember <kalevlember@gmail.com> - 3.1.92-1
fca856
- Update to 3.1.92
fca856
fca856
* Sun Feb 26 2012 Matthias Clasen <mclasen@redhat.com> - 3.1.1-1
fca856
- Update to 3.1.1
fca856
fca856
* Tue Feb  7 2012 Matthias Clasen <mclasen@redhat.com> - 3.1.0-1
fca856
- Update to 3.1.0
fca856
fca856
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.3-2
fca856
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
fca856
fca856
* Tue Dec 20 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 3.0.3-1
fca856
- udpate to 3.0.3
fca856
fca856
* Sat Oct 22 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 3.0.2-1
fca856
- udpate to 3.0.2
fca856
fca856
* Fri Sep 30 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 3.0.1-1
fca856
- udpate to 3.0.1
fca856
fca856
* Tue Sep 20 2011 Matthias Clasen <mclasen@redhat.com> - 3.0.0-1
fca856
- Update to 3.0.0
fca856
fca856
* Thu Sep 15 2011 John (J5) Palmieri <johnp@gnome.org> - 2.90.4-1
fca856
- update to 2.90.4
fca856
- get rid of packaging cruft that is taken care of by upstream now
fca856
fca856
* Wed Aug 31 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 2.90.3-1
fca856
- udpate to 2.90.3
fca856
fca856
* Thu Aug 22 2011 John (J5) Palmieri <johnp@redhat.com> - 2.90.2-3
fca856
- remove some old requires
fca856
fca856
* Thu Aug 19 2011 John (J5) Palmieri <johnp@redhat.com> - 2.90.2-2
fca856
- fix up issues uncovered during package review
fca856
- disable docs because they still reference the static bindings 
fca856
  and upstream is working on new documentation
fca856
fca856
* Thu Aug 18 2011 John (J5) Palmieri <johnp@redhat.com> - 2.90.2-1
fca856
- Initial package