%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name: pygobject
Summary: Python bindings for GObject
Summary(ja): GObject の Python バインディング
Version: 2.28.6
Release: 7%{?_dist_release}

Group: Development/Languages
License: LGPL
URL: http://www.pygtk.org/

Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-%{version}.tar.xz
Patch0: 00git_cairo_init.patch
Patch1: 00git_enum_properties.patch
Patch2: 00git_fix_qdata_warning.patch
Patch3: 00git_gio_flag_type.patch
Patch4: 00git_gio_test.patch
Patch5: 00git_messagebox_type.patch
Patch6: 00git_python3-maketrans.patch
Patch7: 00git_python3_build.patch
Patch8: 00git_test_case_hang.patch
Patch9: 00git_textiter_crash.patch
Patch10: 20_deprecated_spam.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: glib2-devel >= 2.26.0
BuildRequires: python-devel >= 2.6
BuildRequires: libffi-devel
BuildRequires: libtool, automake
BuildRequires: pycairo-devel >= 1.8.10

Vendor: Project Vine
Distribution: Vine Linux
Packager: daisuke

%description
pygobject provides a convenient wrapper for the GObject library
for use in Python programs.

%package devel
Summary: Development files for building add-on libraries
Group: Development/Libraries
Requires: pygobject = %{version}-%{release}
#Requires: pygobject-doc = %{version}-%{release}
Requires: glib2-devel
Requires: libffi-devel
Requires: pkgconfig

%description devel
This package contains files required to build wrappers for
pygobject-based libraries such as pygtk2.

%package doc
Summary: Documentation files for pygobject
Group: Documentation

%description doc
This package contains documentation files for pygobject.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1

%build
# --disable-docs doesn't work; it builds the docs anyway.
%configure \
    --enable-silent-rules \
    --disable-static \
    --enable-thread \
    --disable-introspection \
    --disable-docs
export tagname=CC
make LIBTOOL=/usr/bin/libtool

%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

rm -f examples/Makefile*

%clean
rm -fr $RPM_BUILD_ROOT

%files
%defattr(644, root, root, 755)
%doc AUTHORS NEWS README ChangeLog
%doc examples

%{_libdir}/libpyglib-2.0-python.so.*
%dir %{python_sitearch}/gtk-2.0
%{python_sitearch}/gtk-2.0/dsextras.*
%{python_sitearch}/pygtk.*

%defattr(755, root, root, 755)
%{python_sitearch}/gtk-2.0/gio
%{python_sitearch}/glib
%{python_sitearch}/gobject

%files devel
%defattr(755, root, root, 755)
%{_bindir}/pygobject-codegen-2.0
%defattr(644, root, root, 755)
%dir %{_datadir}/pygobject
%dir %{_datadir}/pygobject/2.0
%dir %{_includedir}/pygtk-2.0
%{_datadir}/pygobject/2.0/codegen
%{_datadir}/pygobject/2.0/defs
%{_datadir}/pygobject/xsl
%{_includedir}/pygtk-2.0/pyglib.h
%{_includedir}/pygtk-2.0/pygobject.h
%{_libdir}/libpyglib-2.0-python.so
%{_libdir}/pkgconfig/pygobject-2.0.pc

%files doc
%defattr(644, root, root, 755)
%{_datadir}/gtk-doc/html/pygobject

%changelog
* Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.28.6-7
- rebuilt with libffi-3.3.

* Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.28.6-6
- rebuild with libffi-3.0.13

* Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.28.6-5
- rebuild with VineSeed environment

* Tue May 08 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.28.6-4
- added Patch0-10 from Debian sid

* Wed Feb 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.28.6-3
- rebuild with python-2.7.2

* Sat Sep 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.28.6-2
- remove BuildRequires: gobject-introspection-devel
- change configure option --disable-introspection instead of --enable-introspection=yes

* Sun Aug 14 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.28.6-1
- new upstream release

* Tue Jun 07 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.28.4-1
- update to 2.28.4

* Sat Oct 02 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.26.0-1
- new upstream release
- add BuildRequires: gobject-introspection-devel, pycairo-devel
- change configure option --enable-introspection=yes instead of --disable-introspection

* Thu Sep 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.21.5-1
- new upstream release
- added --disable-intropection option (it needs gobject-introspection >= 0.9)
- moved xsl files to devel package
- built with rpm-4.8.1

* Sat Apr 17 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.21.1-1
- new upstream release

* Tue Feb 02 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.20.0-3
- build for python-2.6

* Wed Dec  2 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.20.0-2
- added Requires: libffi-devel to devel package <BTS:830>

* Sun Nov  1 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.20.0-1
- new upstream release

* Sun Mar 22 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.16.1-1
- new upstream release

* Sat Jan 17 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.16.0-1
- new upstream release

* Sat Oct 04 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.15.4-1
- new upstream release

* Sun Jul 20 2008 Shu KONNO <owa@bg.wakwak.com> 2.14.2-2
- rebuilt with python-2.5.2

* Tue May 27 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.14.2-1
- new upstream release
- spec in UTF-8

* Sat Mar 22 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.14.1-1vl5
- rebuilt with python-2.4.5 and glib2-2.16.1
- used %%{?_dist_release} macro

* Sun Feb 24 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.14.1-0vl1
- new upstream release

* Sat Nov 17 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.14.0-0vl1
- new upstream release
- dropped Patch1 (merged into upstream)

* Thu Apr 26 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.12.3-0vl1
- initial build for Vine Linux

* Thu Apr 19 2007 Matthew Barnes <mbarnes@redhat.com> - 2.12.3-3.fc7
- Add patch for RH bug #237179 (memory leak).

* Thu Dec  7 2006 Jeremy Katz <katzj@redhat.com> - 2.12.3-2
- rebuild against python 2.5

* Sat Nov 18 2006 Matthew Barnes <mbarnes@redhat.com> - 2.12.3-1.fc7
- Update to 2.12.3

* Thu Oct 26 2006 Matthew Barnes <mbarnes@redhat.com> - 2.12.2-3.fc7
- Add subpackage pygobject2-doc (bug #205231).

* Tue Oct 24 2006 Matthew Barnes <mbarnes@redhat.com> - 2.12.2-2.fc7
- Use python_sitearch instead of python_sitelib.

* Sun Oct 15 2006 Matthew Barnes <mbarnes@redhat.com> - 2.12.2-1.fc7
- Update to 2.12.2

* Sun Sep 24 2006 Matthew Barnes <mbarnes@redhat.com> - 2.12.1-3.fc6
- Require glib2-devel for the -devel package.

* Fri Sep 22 2006 Matthew Barnes <mbarnes@redhat.com> - 2.12.1-2.fc6
- Define a python_sitelib macro for files under site_packages.
- Spec file cleanups.

* Tue Sep  5 2006 Matthias Clasen <mclasen@redhat.com> - 2.12.1-1.fc6
- Update to 2.12.1
- Require pkgconfig for the -devel package

* Sun Aug 27 2006 Matthias Clasen <mclasen@redhat.com> - 2.11.4-1.fc6
- Update to 2.11.4
- Use pre-built docs

* Mon Aug 21 2006 Matthias Clasen <mclasen@redhat.com> - 2.11.3-1.fc6
- Update to 2.11.3

* Sun Aug 13 2006 Matthias Clasen <mclasen@redhat.com> - 2.11.2-2.fc6
- BR libxslt

* Sun Aug 13 2006 Matthias Clasen <mclasen@redhat.com> - 2.11.2-1.fc6
- Update to 2.11.2

* Wed Jul 19 2006 Jesse Keating <jkeating@redhat.com> - 2.11.0-2
- rebuild

* Wed Jul 12 2006 Matthias Clasen <mclasen@redhat.com> - 2.11.0-1
- Update to 2.11.0

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.10.1-3
- rebuild
- Add missing br libtool

* Fri May 19 2006 John (J5) Palmieri <johnp@redhat.com> - 2.10.1-2
- Cleanup

* Fri May 12 2006 John (J5) Palmieri <johnp@redhat.com> - 2.10.1-1
- Initial package
