3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # unit tests
6 %bcond_without doc # Sphinx documentation
9 Summary: A Python implementation of the Git file formats and protocols
10 Summary(pl.UTF-8): Pythonowa implementacja formatów plików i protokołów Gita
11 Name: python-%{module}
14 License: GPL v2+ or Apache 2.0+
15 Group: Libraries/Python
16 Source0: https://www.dulwich.io/releases/%{module}-%{version}.tar.gz
17 # Source0-md5: ed939b01bf60f1d217a0ae7b2828a225
18 URL: https://www.dulwich.io/
20 BuildRequires: python-devel >= 1:2.7
21 BuildRequires: python-setuptools
23 BuildRequires: python-certifi
24 BuildRequires: python-gevent
25 BuildRequires: python-geventhttpclient
26 BuildRequires: python-setuptools >= 17.1
27 BuildRequires: python-urllib3 >= 1.24.1
31 BuildRequires: python3-devel >= 1:3.4
32 BuildRequires: python3-setuptools
34 BuildRequires: python3-certifi
35 BuildRequires: python3-gevent
36 BuildRequires: python3-geventhttpclient
37 BuildRequires: python3-setuptools >= 17.1
38 BuildRequires: python3-urllib3 >= 1.24.1
41 BuildRequires: rpm-pythonprov
42 BuildRequires: rpmbuild(macros) >= 1.714
44 BuildRequires: python3-docutils
45 BuildRequires: sphinx-pdg-3
47 Requires: python-modules >= 1:2.7
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 Dulwich is a Python implementation of the Git file formats and
52 protocols, which does not depend on Git itself.
54 All functionality is available in pure Python. Optional C extensions
55 can be built for improved performance.
57 The project is named after the village in which Mr. and Mrs. Git live
58 in the Monty Python sketch.
60 %description -l pl.UTF-8
61 Dulwich to pythonowa implementacja formatów plików i protokołów Gita,
62 nie zależąca od samego Gita.
64 Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie
65 można zbudować rozszerzenia w C poprawiające wydajność.
67 Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
70 %package -n python3-%{module}
71 Summary: A Python implementation of the Git file formats and protocols
72 Summary(pl.UTF-8): Pythonowa implementacja formatów plików i protokołów Gita
73 Group: Libraries/Python
74 Requires: python3-modules >= 1:3.4
76 Conflicts: python-dulwich < 0.19.14
78 %description -n python3-%{module}
79 Dulwich is a Python implementation of the Git file formats and
80 protocols, which does not depend on Git itself.
82 All functionality is available in pure Python. Optional C extensions
83 can be built for improved performance.
85 The project is named after the village in which Mr. and Mrs. Git live
86 in the Monty Python sketch.
88 %description -n python3-%{module} -l pl.UTF-8
89 Dulwich to pythonowa implementacja formatów plików i protokołów Gita,
90 nie zależąca od samego Gita.
92 Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie
93 można zbudować rozszerzenia w C poprawiające wydajność.
95 Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
99 Summary: Documentation for Python Dulwich module
100 Summary(pl.UTF-8): Dokumentacja moduły Pythona Dulwich
105 Documentation for Python Dulwich module.
107 %description apidocs -l pl.UTF-8
108 Dokumentacja moduły Pythona Dulwich.
111 %setup -q -n %{module}-%{version}
113 %{__rm} -r %{module}.egg-info
120 %{__python} -m unittest discover -t . -s dulwich/tests
128 %{__python3} -m unittest discover -t . -s dulwich/tests
133 # sphinx fails with it from time to time with parallel build
134 %{__make} -C docs -j1 html \
135 SPHINXBUILD=sphinx-build-3
139 rm -rf $RPM_BUILD_ROOT
144 for p in dul-receive-pack dul-upload-pack dulwich ; do
145 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-2
149 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/*.[ch]
150 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/tests
151 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/contrib/test_*.py*
152 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/docs/tutorial
158 for p in dul-receive-pack dul-upload-pack dulwich ; do
159 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-3
160 ln -sf ${p}-3 $RPM_BUILD_ROOT%{_bindir}/${p}
163 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*.[ch]
164 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/tests
165 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/contrib/test_*.py*
166 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/docs/tutorial
170 rm -rf $RPM_BUILD_ROOT
174 %defattr(644,root,root,755)
175 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
176 %attr(755,root,root) %{_bindir}/dul-receive-pack-2
177 %attr(755,root,root) %{_bindir}/dul-upload-pack-2
178 %attr(755,root,root) %{_bindir}/dulwich-2
179 %dir %{py_sitedir}/%{module}
180 %{py_sitedir}/%{module}/*.py[co]
181 %attr(755,root,root) %{py_sitedir}/%{module}/_*.so
182 %dir %{py_sitedir}/%{module}/contrib
183 %{py_sitedir}/%{module}/contrib/*.py[co]
184 %{py_sitedir}/%{module}-%{version}-py*.egg-info
188 %files -n python3-%{module}
189 %defattr(644,root,root,755)
190 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
191 %attr(755,root,root) %{_bindir}/dul-receive-pack-3
192 %attr(755,root,root) %{_bindir}/dul-upload-pack-3
193 %attr(755,root,root) %{_bindir}/dulwich-3
194 %attr(755,root,root) %{_bindir}/dul-receive-pack
195 %attr(755,root,root) %{_bindir}/dul-upload-pack
196 %attr(755,root,root) %{_bindir}/dulwich
197 %dir %{py3_sitedir}/%{module}
198 %{py3_sitedir}/%{module}/*.py
199 %{py3_sitedir}/%{module}/__pycache__
200 %attr(755,root,root) %{py3_sitedir}/%{module}/_*.cpython-*.so
201 %dir %{py3_sitedir}/%{module}/contrib
202 %{py3_sitedir}/%{module}/contrib/*.py
203 %{py3_sitedir}/%{module}/contrib/__pycache__
204 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
209 %defattr(644,root,root,755)
210 %doc docs/build/html/{_static,tutorial,*.html,*.js}