]> git.pld-linux.org Git - packages/python-dulwich.git/blame - python-dulwich.spec
- rpm version for noarch subpackage
[packages/python-dulwich.git] / python-dulwich.spec
CommitLineData
44b0d135
ER
1#
2# Conditional build:
08981c9a
JB
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
e1e76b6e
JB
5%bcond_without tests # unit tests
6%bcond_without doc # Sphinx documentation
44b0d135
ER
7
8%define module dulwich
e156b51f 9Summary: A Python implementation of the Git file formats and protocols
b7a44a81 10Summary(pl.UTF-8): Pythonowa implementacja formatów plików i protokołów Gita
44b0d135 11Name: python-%{module}
b07e03e6
JB
12# keep 0.19.x here for python2 support
13Version: 0.19.16
14Release: 1
b7a44a81 15License: GPL v2+ or Apache 2.0+
44b0d135 16Group: Libraries/Python
2ece093f 17Source0: https://www.dulwich.io/releases/%{module}-%{version}.tar.gz
b07e03e6 18# Source0-md5: 0715a7cc669dd19416b4ddc797e84c1f
2bf830f1 19URL: https://www.dulwich.io/
08981c9a 20%if %{with python2}
2ece093f 21BuildRequires: python-devel >= 1:2.7
44b0d135 22BuildRequires: python-setuptools
91739a9d 23%if %{with tests}
e1e76b6e 24BuildRequires: python-certifi
b7a44a81
JB
25BuildRequires: python-gevent
26BuildRequires: python-geventhttpclient
b07e03e6 27BuildRequires: python-mock
b0c8ef0d 28BuildRequires: python-setuptools >= 1:17.1
e1e76b6e 29BuildRequires: python-urllib3 >= 1.24.1
91739a9d 30%endif
08981c9a
JB
31%endif
32%if %{with python3}
e1e76b6e 33BuildRequires: python3-devel >= 1:3.4
08981c9a
JB
34BuildRequires: python3-setuptools
35%if %{with tests}
e1e76b6e 36BuildRequires: python3-certifi
08981c9a
JB
37BuildRequires: python3-gevent
38BuildRequires: python3-geventhttpclient
b0c8ef0d 39BuildRequires: python3-setuptools >= 1:17.1
e1e76b6e 40BuildRequires: python3-urllib3 >= 1.24.1
08981c9a
JB
41%endif
42%endif
a4d91510 43BuildRequires: rpm-build >= 4.6
08981c9a
JB
44BuildRequires: rpm-pythonprov
45BuildRequires: rpmbuild(macros) >= 1.714
91739a9d 46%if %{with doc}
e1e76b6e
JB
47BuildRequires: python3-docutils
48BuildRequires: sphinx-pdg-3
91739a9d 49%endif
b7a44a81 50Requires: python-modules >= 1:2.7
44b0d135
ER
51BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53%description
e156b51f
ER
54Dulwich is a Python implementation of the Git file formats and
55protocols, which does not depend on Git itself.
56
57All functionality is available in pure Python. Optional C extensions
58can be built for improved performance.
59
60The project is named after the village in which Mr. and Mrs. Git live
61in the Monty Python sketch.
44b0d135 62
b7a44a81
JB
63%description -l pl.UTF-8
64Dulwich to pythonowa implementacja formatów plików i protokołów Gita,
65nie zależąca od samego Gita.
66
67Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie
68można zbudować rozszerzenia w C poprawiające wydajność.
69
70Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
71skeczu Monty Pythona.
72
08981c9a
JB
73%package -n python3-%{module}
74Summary: A Python implementation of the Git file formats and protocols
75Summary(pl.UTF-8): Pythonowa implementacja formatów plików i protokołów Gita
76Group: Libraries/Python
e1e76b6e
JB
77Requires: python3-modules >= 1:3.4
78# default binaries
79Conflicts: python-dulwich < 0.19.14
08981c9a
JB
80
81%description -n python3-%{module}
82Dulwich is a Python implementation of the Git file formats and
83protocols, which does not depend on Git itself.
84
85All functionality is available in pure Python. Optional C extensions
86can be built for improved performance.
87
88The project is named after the village in which Mr. and Mrs. Git live
89in the Monty Python sketch.
90
91%description -n python3-%{module} -l pl.UTF-8
92Dulwich to pythonowa implementacja formatów plików i protokołów Gita,
93nie zależąca od samego Gita.
94
95Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie
96można zbudować rozszerzenia w C poprawiające wydajność.
97
98Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w
99skeczu Monty Pythona.
100
1de419e4
JB
101%package apidocs
102Summary: Documentation for Python Dulwich module
103Summary(pl.UTF-8): Dokumentacja moduły Pythona Dulwich
104Group: Documentation
6ba76264 105BuildArch: noarch
1de419e4
JB
106
107%description apidocs
108Documentation for Python Dulwich module.
109
110%description apidocs -l pl.UTF-8
111Dokumentacja moduły Pythona Dulwich.
112
44b0d135
ER
113%prep
114%setup -q -n %{module}-%{version}
b7a44a81
JB
115
116%{__rm} -r %{module}.egg-info
44b0d135
ER
117
118%build
08981c9a 119%if %{with python2}
2dfc2e3a 120%py_build
44b0d135
ER
121
122%if %{with tests}
e1e76b6e 123%{__python} -m unittest discover -t . -s dulwich/tests
08981c9a
JB
124%endif
125%endif
126
127%if %{with python3}
128%py3_build
129
130%if %{with tests}
e1e76b6e 131%{__python3} -m unittest discover -t . -s dulwich/tests
08981c9a 132%endif
44b0d135
ER
133%endif
134
91739a9d 135%if %{with doc}
44b0d135 136# sphinx fails with it from time to time with parallel build
1de419e4 137%{__make} -C docs -j1 html \
e1e76b6e 138 SPHINXBUILD=sphinx-build-3
91739a9d 139%endif
44b0d135
ER
140
141%install
142rm -rf $RPM_BUILD_ROOT
08981c9a
JB
143
144%if %{with python2}
2dfc2e3a 145%py_install
44b0d135 146
08981c9a
JB
147for p in dul-receive-pack dul-upload-pack dulwich ; do
148 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-2
149done
150
1de419e4 151%py_postclean
44b0d135
ER
152%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/*.[ch]
153%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/tests
154%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/contrib/test_*.py*
155%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/docs/tutorial
08981c9a
JB
156%endif
157
158%if %{with python3}
159%py3_install
160
161for p in dul-receive-pack dul-upload-pack dulwich ; do
162 %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-3
e1e76b6e 163 ln -sf ${p}-3 $RPM_BUILD_ROOT%{_bindir}/${p}
08981c9a
JB
164done
165
166%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*.[ch]
167%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/tests
168%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/contrib/test_*.py*
169%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/docs/tutorial
170%endif
171
44b0d135
ER
172%clean
173rm -rf $RPM_BUILD_ROOT
174
08981c9a 175%if %{with python2}
44b0d135
ER
176%files
177%defattr(644,root,root,755)
e1e76b6e 178%doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
08981c9a
JB
179%attr(755,root,root) %{_bindir}/dul-receive-pack-2
180%attr(755,root,root) %{_bindir}/dul-upload-pack-2
181%attr(755,root,root) %{_bindir}/dulwich-2
44b0d135 182%dir %{py_sitedir}/%{module}
44b0d135
ER
183%{py_sitedir}/%{module}/*.py[co]
184%attr(755,root,root) %{py_sitedir}/%{module}/_*.so
b7a44a81 185%dir %{py_sitedir}/%{module}/contrib
44b0d135 186%{py_sitedir}/%{module}/contrib/*.py[co]
b7a44a81 187%{py_sitedir}/%{module}-%{version}-py*.egg-info
08981c9a
JB
188%endif
189
190%if %{with python3}
191%files -n python3-%{module}
192%defattr(644,root,root,755)
e1e76b6e 193%doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
08981c9a
JB
194%attr(755,root,root) %{_bindir}/dul-receive-pack-3
195%attr(755,root,root) %{_bindir}/dul-upload-pack-3
196%attr(755,root,root) %{_bindir}/dulwich-3
08981c9a
JB
197%attr(755,root,root) %{_bindir}/dul-receive-pack
198%attr(755,root,root) %{_bindir}/dul-upload-pack
199%attr(755,root,root) %{_bindir}/dulwich
08981c9a
JB
200%dir %{py3_sitedir}/%{module}
201%{py3_sitedir}/%{module}/*.py
202%{py3_sitedir}/%{module}/__pycache__
203%attr(755,root,root) %{py3_sitedir}/%{module}/_*.cpython-*.so
204%dir %{py3_sitedir}/%{module}/contrib
205%{py3_sitedir}/%{module}/contrib/*.py
206%{py3_sitedir}/%{module}/contrib/__pycache__
207%{py3_sitedir}/%{module}-%{version}-py*.egg-info
208%endif
1de419e4
JB
209
210%if %{with doc}
211%files apidocs
212%defattr(644,root,root,755)
213%doc docs/build/html/{_static,tutorial,*.html,*.js}
214%endif
This page took 0.148524 seconds and 4 git commands to generate.