3 %bcond_without tests # do not perform "make test"
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without docs # documentation
8 Summary: Python bindings for libgit2 library
12 License: GPL v2 with linking exception
13 Group: Libraries/Python
14 Source0: http://pypi.python.org/packages/source/p//pygit2/%{module}-%{version}.tar.gz
15 # Source0-md5: 8d27f84509a96d6791a6c393ae67d7c8
16 URL: https://pypi.python.org/pypi/pygit2
17 BuildRequires: python-devel
18 BuildRequires: python-distribute
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.219
22 BuildRequires: python3-devel
23 BuildRequires: python3-distribute
24 BuildRequires: python3-modules
26 %{?with_docs:BuildRequires: sphinx-pdg}
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 pygit2 is a set of Python bindings to the libgit2 shared library.
32 %package -n python3-%{module}
33 Summary: Python bindings for libgit2 library
35 %description -n python3-%{module}
36 pygit2 is a set of Python bindings to the libgit2 shared library.
40 Summary: pygit2 API documentation
41 Summary(pl.UTF-8): Dokumentacja API pygit2
45 API documentation for %{module}.
47 %description apidoc -l pl.UTF-8
48 Dokumentacja API %{module}.
51 %setup -q -n %{module}-%{version}
55 %{__python} setup.py build --build-base build-2
57 %{__python3} setup.py build --build-base build-3
60 %{?with_tests:%{__python} setup.py test}
63 %{__python3} setup.py \
67 %{__python3} setup.py test
74 rm -rf _build/html/_sources
78 rm -rf $RPM_BUILD_ROOT
80 %{__python} -- setup.py \
83 --root=$RPM_BUILD_ROOT \
88 %{__python3} setup.py \
89 build --build-base build-3 \
91 --root=$RPM_BUILD_ROOT \
96 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
97 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
98 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
102 rm -rf $RPM_BUILD_ROOT
105 %defattr(644,root,root,755)
106 %doc COPYING README.rst TODO.txt
107 %dir %{py_sitedir}/%{module}
108 %{py_sitedir}/pygit2/*.py[co]
109 %attr(755,root,root) %{py_sitedir}/*.so
110 %if "%{py_ver}" > "2.4"
111 %{py_sitedir}/pygit2-*.egg-info
115 %files -n python3-%{module}
116 %defattr(644,root,root,755)
117 %doc COPYING README.rst TODO.txt
118 %dir %{py3_sitedir}/%{module}
119 %attr(755,root,root) %{py3_sitedir}/*.so
120 %{py3_sitedir}/%{module}/*.py
121 %{py3_sitedir}/%{module}/__pycache__
122 %{py3_sitedir}/pygit2-*.egg-info
127 %defattr(644,root,root,755)
128 %doc docs/_build/html/*