2897a44
%if 0%{?fedora} && 0%{?fedora} <= 28
2897a44
  # https://github.com/libgit2/pygit2/issues/811
2897a44
  # https://github.com/libgit2/pygit2/issues/812
2897a44
  %global arch_test_fail aarch64 ppc64 s390x
2897a44
%else
2897a44
  # https://github.com/libgit2/pygit2/issues/811
2897a44
  %global arch_test_fail ppc64 s390x
2897a44
%endif
2274deb
%global pkgname pygit2
ee69ccd
%{?python_enable_dependency_generator}
2274deb
2274deb
Name:           python-%{pkgname}
ee69ccd
Version:        0.28.2
2274deb
Release:        1%{?dist}
2274deb
Summary:        Python bindings for libgit2
2274deb
2274deb
License:        GPLv2 with linking exception
2274deb
URL:            https://www.pygit2.org/
2274deb
Source0:        https://github.com/libgit2/%{pkgname}/archive/v%{version}/%{pkgname}-%{version}.tar.gz
2274deb
2274deb
BuildRequires:  gcc
2274deb
BuildRequires:  (libgit2-devel >= 0.28.0 with libgit2-devel < 0.29.0)
2274deb
2274deb
%description
2274deb
pygit2 is a set of Python bindings to the libgit2 library, which implements
2274deb
the core of Git.
2274deb
2274deb
%package -n python2-%{pkgname}
2274deb
Summary:        Python 2.x bindings for libgit2
2274deb
%{?python_provide:%python_provide python2-%{pkgname}}
2274deb
BuildRequires:  python2-devel
2274deb
BuildRequires:  python2-setuptools
2274deb
BuildRequires:  python2-cffi
2274deb
BuildRequires:  python2-six
2274deb
BuildRequires:  python2-pytest
2274deb
2274deb
%description -n python2-%{pkgname}
2274deb
pygit2 is a set of Python bindings to the libgit2 library, which implements
2274deb
the core of Git.
2274deb
2274deb
Python 2 version.
2274deb
2274deb
%package -n     python3-%{pkgname}
2274deb
Summary:        Python 3.x bindings for libgit2
2274deb
%{?python_provide:%python_provide python3-%{pkgname}}
2274deb
BuildRequires:  python3-devel
2274deb
BuildRequires:  python3-setuptools
2274deb
BuildRequires:  python3-cffi
2274deb
BuildRequires:  python3-six
2274deb
BuildRequires:  python3-pytest
2274deb
2274deb
%description -n python3-%{pkgname}
2274deb
pygit2 is a set of Python bindings to the libgit2 library, which implements
2274deb
the core of Git.
2274deb
2274deb
Python 3 version.
2274deb
2274deb
%package        doc
2274deb
Summary:        Documentation for %{name}
2274deb
BuildArch:      noarch
2274deb
BuildRequires:  /usr/bin/sphinx-build
2274deb
2274deb
%description    doc
2274deb
Documentation for %{name}.
2274deb
2274deb
%prep
2274deb
%autosetup -n %{pkgname}-%{version} -p1
2274deb
2274deb
%build
2274deb
%py2_build
2274deb
%py3_build
2274deb
make -C docs html
2274deb
2274deb
%install
2274deb
%py2_install
2274deb
%py3_install
2274deb
find %{_builddir} -name '.buildinfo' -delete
2274deb
2274deb
# Correct the permissions.
2274deb
find %{buildroot} -name '*.so' -exec chmod 755 {} ';'
2274deb
2274deb
%check
4f2efc3
%ifarch %{arch_test_fail}
2274deb
  PYTHONPATH=%{buildroot}%{python2_sitearch} py.test-%{python2_version} -v || :
2274deb
  PYTHONPATH=%{buildroot}%{python3_sitearch} py.test-%{python3_version} -v || :
2274deb
%else
2274deb
  PYTHONPATH=%{buildroot}%{python2_sitearch} py.test-%{python2_version} -v
2274deb
  PYTHONPATH=%{buildroot}%{python3_sitearch} py.test-%{python3_version} -v
2274deb
%endif
2274deb
2274deb
%files -n python2-%{pkgname}
2274deb
%doc README.rst TODO.txt
2274deb
%license COPYING
2274deb
%{python2_sitearch}/%{pkgname}-*.egg-info/
2274deb
%{python2_sitearch}/%{pkgname}/
2274deb
%{python2_sitearch}/_%{pkgname}.so
2274deb
2274deb
%files -n python3-%{pkgname}
2274deb
%doc README.rst TODO.txt
2274deb
%license COPYING
2274deb
%{python3_sitearch}/%{pkgname}-*.egg-info/
2274deb
%{python3_sitearch}/%{pkgname}/
2274deb
%{python3_sitearch}/_%{pkgname}.*.so
2274deb
2274deb
%files doc
2274deb
%license COPYING
2274deb
%doc docs/_build/html/*
2274deb
2274deb
%changelog
ee69ccd
* Thu Jun 06 14:32:34 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.28.2-1
ee69ccd
- Update to 0.28.2
ee69ccd
ee69ccd
* Sun Apr 07 13:12:51 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.28.0-1
2274deb
- Initial package