diff --git a/python-pygit2-docbuild.patch b/python-pygit2-docbuild.patch deleted file mode 100644 index 6b9b8f4..0000000 --- a/python-pygit2-docbuild.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- docs/conf.py.orig 2013-10-13 17:53:38.807267727 +0100 -+++ docs/conf.py 2013-10-13 18:06:24.038047114 +0100 -@@ -12,11 +12,13 @@ - # serve to show the default. - - import sys, os -+from distutils.util import get_platform - - # If extensions (or modules to document with autodoc) are in another directory, - # add these directories to sys.path here. If the directory is relative to the - # documentation root, use os.path.abspath to make it absolute, like shown here. --sys.path.insert(0, os.path.abspath('../build/lib.linux-x86_64-2.7')) -+builddir = os.getenv('PACKAGE_BUILD', '../build') -+sys.path.insert(0, os.path.abspath('%s/lib.%s-%s' % (builddir, get_platform(), sys.version[0:3]))) - - # -- General configuration ----------------------------------------------------- - diff --git a/python-pygit2.spec b/python-pygit2.spec index c51acd5..bc1f657 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -1,128 +1,78 @@ # # Conditional build: -%bcond_without tests # do not perform "make test" -%bcond_without python3 # CPython 3.x module -%bcond_without docs # documentation +%bcond_with tests # unit tests -%define module pygit2 +%define module pygit2 +%define egg_name pygit2 +%define pypi_name pygit2 Summary: Python bindings for libgit2 library +Summary(pl.UTF-8): Wiązania Pythona do biblioteki libgit2 Name: python-%{module} -Version: 0.20.0 +Version: 1.19.0 Release: 1 License: GPL v2 with linking exception Group: Libraries/Python -Source0: http://pypi.python.org/packages/source/p//pygit2/%{module}-%{version}.tar.gz -# Source0-md5: e4b42ad3abde5f5c9911bf1e4278d69a -Patch0: %{name}-docbuild.patch -URL: https://pypi.python.org/pypi/pygit2 -BuildRequires: libgit2-devel >= 0.19.0 -BuildRequires: python-devel -BuildRequires: python-distribute +#Source0Download: https://pypi.org/simple/pygit2/ +Source0: https://files.pythonhosted.org/packages/source/p/pygit2/%{pypi_name}-%{version}.tar.gz +# Source0-md5: 411d41189d99a69e6c7f0faa35e62442 +URL: https://pypi.org/project/pygit2/ +BuildRequires: libgit2-devel >= 1.4 +BuildRequires: python3-cffi >= 2.0 +BuildRequires: python3-devel >= 1:3.11 +BuildRequires: python3-modules >= 1:3.11 +BuildRequires: python3-setuptools +%{?with_tests:BuildRequires: python3-pytest} BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.219 -%if %{with python3} -BuildRequires: python3-devel -BuildRequires: python3-distribute -BuildRequires: python3-modules -%endif -%{?with_docs:BuildRequires: sphinx-pdg} +BuildRequires: rpmbuild(macros) >= 1.714 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description pygit2 is a set of Python bindings to the libgit2 shared library. +%description -l pl.UTF-8 +pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. + %package -n python3-%{module} -Summary: Python bindings for libgit2 library +Summary: Python 3.x bindings for libgit2 library +Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libgit2 +Group: Libraries/Python +Requires: libgit2 >= 1.4 %description -n python3-%{module} pygit2 is a set of Python bindings to the libgit2 shared library. -%package apidoc -Summary: pygit2 API documentation -Summary(pl.UTF-8): Dokumentacja API pygit2 -Group: Documentation - -%description apidoc -API documentation for %{module}. - -%description apidoc -l pl.UTF-8 -Dokumentacja API %{module}. +%description -n python3-%{module} -l pl.UTF-8 +pygit2 to zbiór wiązań Pythona do biblioteki współdzielonej libgit2. %prep %setup -q -n %{module}-%{version} -%patch0 -p0 %build -%{__python} setup.py build --build-base build-2 -%if %{with python3} -%{__python3} setup.py build --build-base build-3 -%endif - -%{?with_tests:%{__python} setup.py build -b build-2 test} - -%if %{with python3} -%{__python3} setup.py \ - build -b build-3 +%py3_build %if %{with tests} -%{__python3} setup.py build -b build-3 test -%endif -%endif - -%if %{with docs} -cd docs -PACKAGE_BUILD=../build-2 %{__make} -j1 html -rm -rf _build/html/_sources +PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ +PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ +%{__python3} -m pytest test %endif %install rm -rf $RPM_BUILD_ROOT -%{__python} -- setup.py \ - build -b build-2 \ - install \ - --root=$RPM_BUILD_ROOT \ - --optimize=2 - -%py_postclean - -%if %{with python3} -%{__python3} setup.py \ - build --build-base build-3 \ - install \ - --root=$RPM_BUILD_ROOT \ - --optimize=2 -%endif -%py_ocomp $RPM_BUILD_ROOT%{py_sitedir} -%py_comp $RPM_BUILD_ROOT%{py_sitedir} -%py_postclean +%py3_install %clean rm -rf $RPM_BUILD_ROOT -%files -%defattr(644,root,root,755) -%doc COPYING README.rst TODO.txt -%dir %{py_sitedir}/%{module} -%{py_sitedir}/pygit2/*.py[co] -%attr(755,root,root) %{py_sitedir}/*.so -%if "%{py_ver}" > "2.4" -%{py_sitedir}/pygit2-*.egg-info -%endif - -%if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) -%doc COPYING README.rst TODO.txt -%dir %{py3_sitedir}/%{module} -%attr(755,root,root) %{py3_sitedir}/*.so -%{py3_sitedir}/%{module}/*.py -%{py3_sitedir}/%{module}/__pycache__ -%{py3_sitedir}/pygit2-*.egg-info -%endif - -%if %{with docs} -%files apidoc -%defattr(644,root,root,755) -%doc docs/_build/html/* -%endif +%doc AUTHORS.md CHANGELOG.md README.md SPONSORS.md +%dir %{py3_sitedir}/pygit2 +%{py3_sitedir}/pygit2/decl +%{py3_sitedir}/pygit2/py.typed +%{py3_sitedir}/pygit2/*.py +%{py3_sitedir}/pygit2/*.pyi +%{py3_sitedir}/pygit2/__pycache__ +%attr(755,root,root) %{py3_sitedir}/pygit2/_libgit2.abi3.so +%attr(755,root,root) %{py3_sitedir}/pygit2/_pygit2.cpython-*.so +%{py3_sitedir}/pygit2-%{version}-py*.egg-info