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}
12 # keep 0.19.x here for python2 support
15 License: GPL v2+ or Apache 2.0+
16 Group: Libraries/Python
17 Source0: https://www.dulwich.io/releases/%{module}-%{version}.tar.gz
18 # Source0-md5: 0715a7cc669dd19416b4ddc797e84c1f
19 URL: https://www.dulwich.io/
21 BuildRequires: python-devel >= 1:2.7
22 BuildRequires: python-setuptools
24 BuildRequires: python-certifi
25 BuildRequires: python-gevent
26 BuildRequires: python-geventhttpclient
27 BuildRequires: python-mock
28 BuildRequires: python-setuptools >= 1:17.1
29 BuildRequires: python-urllib3 >= 1.24.1
33 BuildRequires: python3-devel >= 1:3.4
34 BuildRequires: python3-setuptools
36 BuildRequires: python3-certifi
37 BuildRequires: python3-gevent
38 BuildRequires: python3-geventhttpclient
39 BuildRequires: python3-setuptools >= 1:17.1
40 BuildRequires: python3-urllib3 >= 1.24.1
43 BuildRequires: rpm-pythonprov
44 BuildRequires: rpmbuild(macros) >= 1.714
46 BuildRequires: python3-docutils
47 BuildRequires: sphinx-pdg-3
49 Requires: python-modules >= 1:2.7
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 Dulwich is a Python implementation of the Git file formats and
54 protocols, which does not depend on Git itself.
56 All functionality is available in pure Python. Optional C extensions
57 can be built for improved performance.
59 The project is named after the village in which Mr. and Mrs. Git live
60 in the Monty Python sketch.
62 %description -l pl.UTF-8
63 Dulwich to pythonowa implementacja formatów plików i protokołów Gita,
64 nie zależąca od samego Gita.
66 Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie
67 można zbudować rozszerzenia w C poprawiające wydajność.
69 Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
72 %package -n python3-%{module}
73 Summary: A Python implementation of the Git file formats and protocols
74 Summary(pl.UTF-8): Pythonowa implementacja formatów plików i protokołów Gita
75 Group: Libraries/Python
76 Requires: python3-modules >= 1:3.4
78 Conflicts: python-dulwich < 0.19.14
80 %description -n python3-%{module}
81 Dulwich is a Python implementation of the Git file formats and
82 protocols, which does not depend on Git itself.
84 All functionality is available in pure Python. Optional C extensions
85 can be built for improved performance.
87 The project is named after the village in which Mr. and Mrs. Git live
88 in the Monty Python sketch.
90 %description -n python3-%{module} -l pl.UTF-8
91 Dulwich to pythonowa implementacja formatów plików i protokołów Gita,
92 nie zależąca od samego Gita.
94 Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie
95 można zbudować rozszerzenia w C poprawiające wydajność.
97 Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
101 Summary: Documentation for Python Dulwich module
102 Summary(pl.UTF-8): Dokumentacja moduły Pythona Dulwich
107 Documentation for Python Dulwich module.
109 %description apidocs -l pl.UTF-8
110 Dokumentacja moduły Pythona Dulwich.
113 %setup -q -n %{module}-%{version}
115 %{__rm} -r %{module}.egg-info
122 %{__python} -m unittest discover -t . -s dulwich/tests
130 %{__python3} -m unittest discover -t . -s dulwich/tests
135 # sphinx fails with it from time to time with parallel build
136 %{__make} -C docs -j1 html \
137 SPHINXBUILD=sphinx-build-3
141 rm -rf $RPM_BUILD_ROOT
146 for p in dul-receive-pack dul-upload-pack dulwich ; do
147 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-2
151 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/*.[ch]
152 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/tests
153 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/contrib/test_*.py*
154 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/docs/tutorial
160 for p in dul-receive-pack dul-upload-pack dulwich ; do
161 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-3
162 ln -sf ${p}-3 $RPM_BUILD_ROOT%{_bindir}/${p}
165 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*.[ch]
166 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/tests
167 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/contrib/test_*.py*
168 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/docs/tutorial
172 rm -rf $RPM_BUILD_ROOT
176 %defattr(644,root,root,755)
177 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
178 %attr(755,root,root) %{_bindir}/dul-receive-pack-2
179 %attr(755,root,root) %{_bindir}/dul-upload-pack-2
180 %attr(755,root,root) %{_bindir}/dulwich-2
181 %dir %{py_sitedir}/%{module}
182 %{py_sitedir}/%{module}/*.py[co]
183 %attr(755,root,root) %{py_sitedir}/%{module}/_*.so
184 %dir %{py_sitedir}/%{module}/contrib
185 %{py_sitedir}/%{module}/contrib/*.py[co]
186 %{py_sitedir}/%{module}-%{version}-py*.egg-info
190 %files -n python3-%{module}
191 %defattr(644,root,root,755)
192 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
193 %attr(755,root,root) %{_bindir}/dul-receive-pack-3
194 %attr(755,root,root) %{_bindir}/dul-upload-pack-3
195 %attr(755,root,root) %{_bindir}/dulwich-3
196 %attr(755,root,root) %{_bindir}/dul-receive-pack
197 %attr(755,root,root) %{_bindir}/dul-upload-pack
198 %attr(755,root,root) %{_bindir}/dulwich
199 %dir %{py3_sitedir}/%{module}
200 %{py3_sitedir}/%{module}/*.py
201 %{py3_sitedir}/%{module}/__pycache__
202 %attr(755,root,root) %{py3_sitedir}/%{module}/_*.cpython-*.so
203 %dir %{py3_sitedir}/%{module}/contrib
204 %{py3_sitedir}/%{module}/contrib/*.py
205 %{py3_sitedir}/%{module}/contrib/__pycache__
206 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
211 %defattr(644,root,root,755)
212 %doc docs/build/html/{_static,tutorial,*.html,*.js}