%global pkgname pygit2
Name: python-%{pkgname}
Version: 0.26.4
Release: 1%{?dist}
Summary: Python bindings for libgit2
License: GPLv2 with linking exception
URL: http://www.pygit2.org
Source0: https://github.com/libgit2/%{pkgname}/archive/v%{version}/%{pkgname}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: libgit2-devel
%description
pygit2 is a set of Python bindings to the libgit2 library, which implements
the core of Git.
%package -n python3-%{pkgname}
Summary: Python 3.x bindings for libgit2
%{?python_provide:%python_provide python3-%{pkgname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-cffi
BuildRequires: python3-six
Requires: python3-cffi
Requires: python3-six
%description -n python3-%{pkgname}
pygit2 is a set of Python bindings to the libgit2 library, which implements
the core of Git.
Python 3 version.
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
BuildRequires: %{_bindir}/sphinx-build
%description doc
Documentation for %{name}.
%prep
%autosetup -n %{pkgname}-%{version} -p1
%build
%py3_build
make -C docs html
%install
%py3_install
find %{_builddir} -name '.buildinfo' -delete
# Correct the permissions.
find %{buildroot} -name '*.so' -exec chmod 755 {} ';'
%check
# https://github.com/libgit2/pygit2/issues/811
# https://github.com/libgit2/pygit2/issues/812
%ifarch aarch64 ppc64 s390x
%{__python3} setup.py test || :
%else
%{__python3} setup.py test
%endif
%files -n python3-%{pkgname}
%doc README.rst TODO.txt
%license COPYING
%{python3_sitearch}/%{pkgname}-*.egg-info/
%{python3_sitearch}/%{pkgname}/
%{python3_sitearch}/_%{pkgname}.*.so
%files doc
%license COPYING
%doc docs/_build/html/*
%changelog
* Fri Sep 28 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.26.4-1
- Initial package