32e0c9f
# Last updated for version 3.4.1.1
32e0c9f
%define glib2_version                  2.31.0
32e0c9f
%define gobject_introspection_version  1.34.1.1
John (J5) Palmieri 11b6226
%define python2_version                2.3.5
John (J5) Palmieri 11b6226
c3c55b2
%if 0%{?fedora} > 12
John (J5) Palmieri 11b6226
%global with_python3 1
John (J5) Palmieri 11b6226
%define python3_version                3.1
John (J5) Palmieri 11b6226
%endif
John (J5) Palmieri 11b6226
4b2a891
%if 1
4b2a891
  # Verbose build
4b2a891
  %global verbosity V=1
4b2a891
%else
4b2a891
  # Quiet build
4b2a891
  %global verbosity %{nil}
4b2a891
%endif
4b2a891
4b2a891
%global with_check 1
4b2a891
John (J5) Palmieri 11b6226
### Abstract ###
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
Name: pygobject3
fb17c9a
Version: 3.4.2
4037de6
Release: 2%{?dist}
John (J5) Palmieri 11b6226
License: LGPLv2+ and MIT
John (J5) Palmieri 11b6226
Group: Development/Languages
John (J5) Palmieri 11b6226
Summary: Python 2 bindings for GObject Introspection
John (J5) Palmieri 11b6226
URL: https://live.gnome.org/PyGObject
John (J5) Palmieri 11b6226
#VCS: git:git://git.gnome.org/pygobject
32e0c9f
Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.4/pygobject-%{version}.tar.xz
John (J5) Palmieri 11b6226
4b2a891
# Add these additional exclusions to the pep8 rules in "make check":
4b2a891
#   E127 continuation line over-indented for visual indent
4b2a891
# Not yet sent upstream
4b2a891
Patch1: ignore-more-pep8-errors.patch
4b2a891
4b2a891
# Mark some tests as known to fail; currently:
62389bc
#
62389bc
# On i686:
4b2a891
#  ======================================================================
4b2a891
#  FAIL: test_strv (test_gi.TestPropertiesObject)
4b2a891
#  ----------------------------------------------------------------------
4b2a891
#  Traceback (most recent call last):
4b2a891
#    File "/builddir/build/BUILD/pygobject-3.3.4/tests/test_gi.py", line 2205, in test_strv
4b2a891
#      self.assertEqual(self.obj.props.some_strv, ['hello', 'world'])
4b2a891
#  AssertionError: Lists differ: ['hello'] != ['hello', 'world']
4b2a891
#  Second list contains 1 additional elements.
4b2a891
#  First extra element 1:
4b2a891
#  world
4b2a891
#  - ['hello']
4b2a891
#  + ['hello', 'world']
4b2a891
#  ----------------------------------------------------------------------
62389bc
#
62389bc
# Intermittently:
62389bc
#  ======================================================================
62389bc
#  FAIL: test_python_calls_sync (test_gdbus.TestGDBusClient)
62389bc
#  ----------------------------------------------------------------------
62389bc
#  Traceback (most recent call last):
62389bc
#    File "/builddir/build/BUILD/pygobject-3.3.4/tests/test_gdbus.py", line 140, in test_python_calls_sync
62389bc
#      self.assertTrue('Timeout' in str(e), str(e))
62389bc
#  AssertionError: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get PID of name '1': no such name
62389bc
#  ----------------------------------------------------------------------
62389bc
#
4b2a891
# Not yet sent upstream
4b2a891
Patch2: pygobject-3.3.4-known-failures.patch
4b2a891
aec497d
# Add regression test for rhbz#842880
aec497d
# Not yet sent upstream:
Daniel Drake a11c6cd
Patch3: test-list-marshalling.patch
aec497d
Daniel Drake 406cf1e
# upstream fix for property type lookup, needed for basic Sugar operation
Daniel Drake 406cf1e
Patch4: property-lookup.patch
Daniel Drake 406cf1e
John (J5) Palmieri 11b6226
### Build Dependencies ###
John (J5) Palmieri 11b6226
4037de6
BuildRequires: chrpath
John (J5) Palmieri 11b6226
BuildRequires: glib2-devel >= %{glib2_version}
John (J5) Palmieri 11b6226
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
John (J5) Palmieri 11b6226
BuildRequires: python2-devel >= %{python2_version}
John (J5) Palmieri 11b6226
%if 0%{?with_python3}
John (J5) Palmieri 11b6226
BuildRequires: python3-devel >= %{python3_version}
John (J5) Palmieri 11b6226
BuildRequires: python3-cairo-devel
John (J5) Palmieri 11b6226
%endif # if with_python3
John (J5) Palmieri 11b6226
a4de5d6
BuildRequires: cairo-gobject-devel
John (J5) Palmieri 11b6226
BuildRequires: pycairo-devel
John (J5) Palmieri 11b6226
4b2a891
# Required by the upstream selftest suite:
4b2a891
%if %{with_check}
223e379
%if 0%{?fedora}
4b2a891
BuildRequires: pyflakes
4b2a891
BuildRequires: python-pep8
223e379
%endif
4b2a891
## for the Gdk and Gtk typelibs, used during the test suite:
4b2a891
BuildRequires: gtk3
62389bc
## for xvfb-run:
4b2a891
BuildRequires: xorg-x11-server-Xvfb
4b2a891
BuildRequires: dejavu-sans-fonts
4b2a891
BuildRequires: dejavu-sans-mono-fonts
4b2a891
BuildRequires: dejavu-serif-fonts
4b2a891
## for dbus-launch, used by test_gdbus:
4b2a891
BuildRequires: dbus-x11
4b2a891
%endif # with_check
4b2a891
John (J5) Palmieri 11b6226
# The cairo override module depends on this
John (J5) Palmieri 11b6226
Requires: pycairo
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
Requires: gobject-introspection >= %{gobject_introspection_version}
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%description
John (J5) Palmieri 11b6226
The %{name} package provides a convenient wrapper for the GObject library
John (J5) Palmieri 11b6226
for use in Python programs.
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%package devel
John (J5) Palmieri 11b6226
Summary: Development files for embedding PyGObject introspection support
John (J5) Palmieri 11b6226
Group: Development/Languages
John (J5) Palmieri 11b6226
Requires: %{name} = %{version}-%{release}
John (J5) Palmieri 11b6226
Requires: glib2-devel
John (J5) Palmieri 11b6226
Requires: gobject-introspection-devel
John (J5) Palmieri 11b6226
Requires: pkgconfig
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%description devel
John (J5) Palmieri 11b6226
This package contains files required to embed PyGObject
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%if 0%{?with_python3}
John (J5) Palmieri 11b6226
%package -n python3-gobject
John (J5) Palmieri 11b6226
Summary: Python 3 bindings for GObject Introspection
John (J5) Palmieri 11b6226
Group: Development/Languages
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
# The cairo override module depends on this
John (J5) Palmieri fb0ea87
Requires: python3-cairo
John (J5) Palmieri 11b6226
Requires: gobject-introspection >= %{gobject_introspection_version}
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%description -n python3-gobject
John (J5) Palmieri 11b6226
The python3-gobject package provides a convenient wrapper for the GObject 
John (J5) Palmieri 11b6226
library and and other libraries that are compatible with GObject Introspection, 
John (J5) Palmieri 11b6226
for use in Python 3 programs.
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%endif # with_python3
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%prep
John (J5) Palmieri 11b6226
%setup -q -n pygobject-%{version}
4b2a891
%patch1 -p1 -b .ignore-more-pep8-errors
4b2a891
%patch2 -p1 -b .known-failures
Daniel Drake a11c6cd
%patch3 -p1 -b .test-list-marshalling
Daniel Drake 406cf1e
%patch4 -p1 -b .property-lookup
223e379
John (J5) Palmieri 11b6226
%if 0%{?with_python3}
John (J5) Palmieri 11b6226
rm -rf %{py3dir}
John (J5) Palmieri 11b6226
cp -a . %{py3dir}
John (J5) Palmieri 11b6226
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
John (J5) Palmieri 11b6226
%endif # with_python3
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%build
John (J5) Palmieri 11b6226
PYTHON=%{__python} 
John (J5) Palmieri 11b6226
export PYTHON
John (J5) Palmieri 11b6226
%configure
4b2a891
make %{?_smp_mflags} %{verbosity}
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%if 0%{?with_python3}
John (J5) Palmieri 11b6226
pushd %{py3dir}
John (J5) Palmieri 11b6226
PYTHON=%{__python3}
John (J5) Palmieri 11b6226
export PYTHON
John (J5) Palmieri 11b6226
%configure
4b2a891
make %{_smp_mflags} %{verbosity}
John (J5) Palmieri 11b6226
popd
John (J5) Palmieri 11b6226
%endif # with_python3
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%install
John (J5) Palmieri 11b6226
rm -rf $RPM_BUILD_ROOT
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%if 0%{?with_python3}
John (J5) Palmieri 11b6226
pushd %{py3dir}
John (J5) Palmieri 11b6226
PYTHON=%{__python3}
John (J5) Palmieri 11b6226
export PYTHON
4b2a891
make DESTDIR=$RPM_BUILD_ROOT install %{verbosity}
John (J5) Palmieri 11b6226
popd
John (J5) Palmieri 11b6226
4037de6
chrpath --delete $RPM_BUILD_ROOT%{python3_sitearch}/gi/{*.so,*/*.so}
4037de6
John (J5) Palmieri 11b6226
%endif # with_python3
John (J5) Palmieri 11b6226
4b2a891
make DESTDIR=$RPM_BUILD_ROOT install %{verbosity}
John (J5) Palmieri 11b6226
find $RPM_BUILD_ROOT -name '*.la' -delete
John (J5) Palmieri 11b6226
find $RPM_BUILD_ROOT -name '*.a' -delete
John (J5) Palmieri 11b6226
4037de6
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/gi/{*.so,*/*.so}
4037de6
986308e
# Don't include makefiles in the installed docs, in order to avoid creating
986308e
# multilib conflicts
986308e
rm -rf _docs
986308e
mkdir _docs
986308e
cp -a examples _docs
986308e
rm _docs/examples/Makefile*
986308e
4b2a891
%check
4b2a891
4b2a891
%if %{with_check}
62389bc
# Run the selftests under a temporary xvfb X server (so that they can
4b2a891
# initialize Gdk etc):
4b2a891
4b2a891
# FIXME: disabled for python3
4b2a891
# Currently this fails with python3 with:
4b2a891
#  File "/builddir/build/BUILD/python3-pygobject3-3.3.4-4.fc19/gi/__init__.py", line 23, in <module>
4b2a891
#    from ._gi import _API, Repository
4b2a891
#ValueError: level must be >= 0
794d078
# Reported upstream as http://bugs.python.org/issue15610
4b2a891
%if 0
4b2a891
pushd %{py3dir}
4b2a891
PYTHON=%{__python3}
4b2a891
export PYTHON
62389bc
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity}
4b2a891
popd
4b2a891
%endif # with_python3
4b2a891
62389bc
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity}
4b2a891
4b2a891
%endif # with_check
4b2a891
John (J5) Palmieri 11b6226
%post -p /sbin/ldconfig
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%postun -p /sbin/ldconfig
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%files
John (J5) Palmieri 11b6226
%defattr(644, root, root, 755)
John (J5) Palmieri 11b6226
%doc AUTHORS NEWS README COPYING
John (J5) Palmieri 11b6226
%{_libdir}/libpyglib-gi-2.0-python.so*
John (J5) Palmieri 11b6226
%dir %{python_sitearch}/gi
John (J5) Palmieri 11b6226
%{python_sitearch}/gi/*
32e0c9f
%{python_sitearch}/pygobject-*.egg-info
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%files devel
John (J5) Palmieri 11b6226
%defattr(644, root, root, 755)
986308e
%doc _docs/*
John (J5) Palmieri 11b6226
%dir %{_includedir}/pygobject-3.0/
John (J5) Palmieri 11b6226
%{_includedir}/pygobject-3.0/pygobject.h
John (J5) Palmieri 11b6226
%{_libdir}/pkgconfig/pygobject-3.0.pc
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%if 0%{?with_python3}
John (J5) Palmieri 11b6226
%files -n python3-gobject
John (J5) Palmieri 11b6226
%defattr(644, root, root, 755)
John (J5) Palmieri 11b6226
%doc AUTHORS NEWS README COPYING
John (J5) Palmieri 11b6226
%{_libdir}/libpyglib-gi-2.0-python3.so*
John (J5) Palmieri 11b6226
%dir %{python3_sitearch}/gi
John (J5) Palmieri 11b6226
%{python3_sitearch}/gi/*
32e0c9f
%{python3_sitearch}/pygobject-*.egg-info
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%endif # with_python3
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
%changelog
4037de6
* Mon Nov 12 2012 Kalev Lember <kalevlember@gmail.com> - 3.4.2-2
4037de6
- Remove lib64 rpaths (#817701)
986308e
- Move code examples to the -devel subpackage and fix the multilib
986308e
  conflict (#831434)
4037de6
fb17c9a
* Mon Nov 12 2012 Kalev Lember <kalevlember@gmail.com> - 3.4.2-1
fb17c9a
- Update to 3.4.2
fb17c9a
Daniel Drake 406cf1e
* Tue Nov  6 2012 Daniel Drake <dsd@laptop.org> - 3.4.1.1-2
Daniel Drake 406cf1e
- Upstream fix for property lookup; needed for basic Sugar operation.
Daniel Drake 406cf1e
32e0c9f
* Wed Oct 17 2012 Kalev Lember <kalevlember@gmail.com> - 3.4.1.1-1
32e0c9f
- Update to 3.4.1.1
32e0c9f
Daniel Drake a11c6cd
* Thu Sep 13 2012 Daniel Drake <dsd@laptop.org> - 3.3.91-1
Daniel Drake a11c6cd
- Latest version; upstreamed patches dropped
Daniel Drake a11c6cd
223e379
* Wed Aug 15 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-9
223e379
- avoid dragging pyflakes and python-pep8 into RHEL (patch 7)
223e379
794d078
* Fri Aug 10 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-8
794d078
- add endianness patch (rhbz#841596; attachment 603634)
794d078
58e8a6c
* Fri Aug 10 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-7
58e8a6c
- update endianness patch for rhbz#841596 (to attachment 603367)
58e8a6c
aec497d
* Thu Aug  9 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-6
aec497d
- fix issues on big-endian 64-bit machines (rhbz#841596, rhbz#842880)
aec497d
62389bc
* Thu Aug  9 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-5
62389bc
- use xvfb-run in selftests; update known failures
62389bc
4b2a891
* Wed Aug  8 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-4
4b2a891
- add a %%check check; add V=1 to all make invocations
4b2a891
2a14799
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-3
2a14799
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
2a14799
c3c55b2
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.4-2
c3c55b2
- remove rhel logic from with_python3 conditional
c3c55b2
Richard Hughes c6e58da
* Tue Jul 17 2012 Richard Hughes <hughsient@gmail.com> - 3.3.4-1
Richard Hughes c6e58da
- Update to 3.3.4
Richard Hughes c6e58da
7559bd5
* Tue Jun 26 2012 David Malcolm <dmalcolm@redhat.com> - 3.3.3.1-2
7559bd5
- fix a segfault when dealing with mismatched .so/typelib files
7559bd5
83ce018
* Mon Jun 25 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 3.3.3.1-1
83ce018
- Update to 3.3.3.1
83ce018
a4de5d6
* Tue Jun 19 2012 Kalev Lember <kalevlember@gmail.com> - 3.3.2-1
a4de5d6
- Update to 3.3.2
a4de5d6
4f86ea4
* Sat May 05 2012 Kalev Lember <kalevlember@gmail.com> - 3.3.1-1
4f86ea4
- Update to 3.3.1
4f86ea4
- Dropped the now unneeded -lm patch
4f86ea4
d767e17
* Tue Mar 27 2012 Kalev Lember <kalevlember@gmail.com> - 3.2.0-1
d767e17
- Update to 3.2.0
d767e17
143068f
* Thu Mar 22 2012 Matthias Clasen <mclasen@redhat.com> - 3.1.93-1
143068f
- Update to 3.1.93
143068f
31fbc9f
* Wed Mar 21 2012 Kalev Lember <kalevlember@gmail.com> - 3.1.92-1
31fbc9f
- Update to 3.1.92
31fbc9f
82b178c
* Sun Feb 26 2012 Matthias Clasen <mclasen@redhat.com> - 3.1.1-1
82b178c
- Update to 3.1.1
82b178c
622d397
* Tue Feb  7 2012 Matthias Clasen <mclasen@redhat.com> - 3.1.0-1
622d397
- Update to 3.1.0
622d397
1e0d7ec
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.3-2
1e0d7ec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
1e0d7ec
Ignacio Casal Quinteiro a17a75f
* Tue Dec 20 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 3.0.3-1
Ignacio Casal Quinteiro a17a75f
- udpate to 3.0.3
Ignacio Casal Quinteiro a17a75f
Ignacio Casal Quinteiro 52a7ec4
* Sat Oct 22 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 3.0.2-1
Ignacio Casal Quinteiro 52a7ec4
- udpate to 3.0.2
Ignacio Casal Quinteiro 52a7ec4
Ignacio Casal Quinteiro 5c7b234
* Fri Sep 30 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 3.0.1-1
Ignacio Casal Quinteiro 5c7b234
- udpate to 3.0.1
Ignacio Casal Quinteiro 5c7b234
86bc2c8
* Tue Sep 20 2011 Matthias Clasen <mclasen@redhat.com> - 3.0.0-1
86bc2c8
- Update to 3.0.0
86bc2c8
John (J5) Palmieri fb0ea87
* Thu Sep 15 2011 John (J5) Palmieri <johnp@gnome.org> - 2.90.4-1
John (J5) Palmieri fb0ea87
- update to 2.90.4
John (J5) Palmieri fb0ea87
- get rid of packaging cruft that is taken care of by upstream now
John (J5) Palmieri fb0ea87
Ignacio Casal Quinteiro 85d6ce9
* Wed Aug 31 2011 Ignacio Casal Quinteiro <icq@gnome.org> - 2.90.3-1
Ignacio Casal Quinteiro 85d6ce9
- udpate to 2.90.3
Ignacio Casal Quinteiro 85d6ce9
John (J5) Palmieri 11b6226
* Thu Aug 22 2011 John (J5) Palmieri <johnp@redhat.com> - 2.90.2-3
John (J5) Palmieri 11b6226
- remove some old requires
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
* Thu Aug 19 2011 John (J5) Palmieri <johnp@redhat.com> - 2.90.2-2
John (J5) Palmieri 11b6226
- fix up issues uncovered during package review
John (J5) Palmieri 11b6226
- disable docs because they still reference the static bindings 
John (J5) Palmieri 11b6226
  and upstream is working on new documentation
John (J5) Palmieri 11b6226
John (J5) Palmieri 11b6226
* Thu Aug 18 2011 John (J5) Palmieri <johnp@redhat.com> - 2.90.2-1
John (J5) Palmieri 11b6226
- Initial package