%bcond_with python2
%bcond_without python3

Name: pygobject3
Summary: Python bindings for GObject Introspection
Summary(ja): GObject Introspection の Python バインディング
Version: 3.40.1
Release: 2%{?_dist_release}
Group: programming
Vendor: Project Vine
Distribution: Vine Linux

License: LGPL
URL: https://pypi.org/project/PyGObject/
%global shortver %(echo "%{version}" | cut -d . -f 1-2)
Source: https://ftp.gnome.org/pub/GNOME/sources/pygobject/%{shortver}/pygobject-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: glib2-devel >= 2.26.0
BuildRequires: python-devel >= 2.6
BuildRequires: libffi-devel
BuildRequires: libtool, automake
BuildRequires: gobject-introspection-devel >= 0.9.8
BuildRequires: python-rpm-macros
%if %{with python2}
BuildRequires: python-devel >= 2.6
BuildRequires: python-setuptools
BuildRequires: python2-rpm-macros
BuildRequires: python2-pycairo-devel >= 1.8.10
%endif

Obsoletes:	%{name}-doc < 3.10.0

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


%if %{with python3}
%package -n python3-pygobject
Summary: Python3 bindings for GObject Introspection
Summary(ja): GObject Introspection の Python3 バインディング
Group: programming
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-rpm-macros
BuildRequires: python3-pycairo-devel
Provides: python3-pygobject3 = %{version}-%{release}
Obsoletes: python3-pygobject < 3.16.1

%description -n python3-pygobject
python3-pygobject provides a convenient wrapper for the GObject library
for use in Python3 programs.


%package -n python3-pygobject-devel
Summary: Development files for building add-on libraries
Group: programming
Obsoletes: pygobject-devel < 3.40.0
Provides: pygobject-devel = %{version}-%{release}
Provides: pygobject3-devel = %{version}-%{release}
Requires: python3-pygobject = %{version}-%{release}
Requires: glib2-devel
Requires: libffi-devel
Requires: pkgconfig

%description -n python3-pygobject-devel
This package contains files required to build wrappers for
pygobject-based libraries such as pygtk3.
%endif


%debug_package


%prep
%setup -q -n pygobject-%{version}


%build
%if %{with python3}
%py3_build
%endif


%install
rm -rf $RPM_BUILD_ROOT
%if %{with python3}
%py3_install
%endif


%clean
rm -fr $RPM_BUILD_ROOT


%if %{with python3}
%files -n python3-pygobject
%defattr(-,root,root,-)
%license COPYING
%doc NEWS README*
%{python3_sitearch}/pygtkcompat
%{python3_sitearch}/*.egg-info
%{python3_sitearch}/gi

%files -n python3-pygobject-devel
%defattr(-,root,root,-)
%{_includedir}/pygobject-3.0/pygobject.h
%{_libdir}/pkgconfig/pygobject-3.0.pc
%endif


%changelog
* Sun May 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.40.1-2
- fixed Provides:.

* Thu Apr 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.40.0-1
- new upstream release.
- python2 is no longer supported.

* Sun Aug 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.36.1-1
- new upstream release.

* Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.34.0-1
- new upstream release.

* Fri Jul 15 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.20.1-1
- new upstream release

* Thu Nov 12 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.2-2
- fix spec file

* Sat Oct 31 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.2-1
- new upstream release

* Sun Jun 28 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.2-1
- new upstream release

* Sun Apr 19 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.1-1
- new upstream release
- create python3-pygobject subpackage

* Mon Mar 30 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.0-1
- new upstream release

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.0-1
- new upstream release

* Fri Jun 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.2-1
- new upstream release

* Sat Apr 19 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.1-1
- new upstream release

* Sat Mar 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.0-1
- new upstream release

* Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.2-1
- new upstream release

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.1-1
- new upstream release
- remove doc subpackage

* Mon Jul 15 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.3-1
- new upstream release

* Sat May 18 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.2-1
- new upstream release

* Wed Apr 17 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.1-1
- new upstream release

* Wed Apr 17 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.1-1
- new upstream release

* Wed Nov 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.2-1
- new upstream release

* Thu Oct 18 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.1.1-1
- new upstream release

* Thu Sep 27 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.0-1
- new upstream release

* Sun May 20 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.2-1
- new upstream release

* Sat Mar 31 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.0-1
- new upstream release

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

* Wed Feb 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.0.4-1
- new upstream release

* Thu Nov 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.0.2-1
- new upstream release

* Thu Oct 06 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.0.1-1
- new upstream release

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.0.0-1
- new upstream release

* Sat Sep 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.90.3-1
- initial build for Vine Linux

