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