]>
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 | |
e1e76b6e JB |
5 | %bcond_without tests # unit tests |
6 | %bcond_without doc # Sphinx documentation | |
44b0d135 ER |
7 | |
8 | %define module dulwich | |
e156b51f | 9 | Summary: A Python implementation of the Git file formats and protocols |
b7a44a81 | 10 | Summary(pl.UTF-8): Pythonowa implementacja formatów plików i protokołów Gita |
44b0d135 | 11 | Name: python-%{module} |
b07e03e6 JB |
12 | # keep 0.19.x here for python2 support |
13 | Version: 0.19.16 | |
14 | Release: 1 | |
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 |
b07e03e6 | 18 | # Source0-md5: 0715a7cc669dd19416b4ddc797e84c1f |
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} |
e1e76b6e | 24 | BuildRequires: python-certifi |
b7a44a81 JB |
25 | BuildRequires: python-gevent |
26 | BuildRequires: python-geventhttpclient | |
b07e03e6 | 27 | BuildRequires: python-mock |
b0c8ef0d | 28 | BuildRequires: python-setuptools >= 1:17.1 |
e1e76b6e | 29 | BuildRequires: python-urllib3 >= 1.24.1 |
91739a9d | 30 | %endif |
08981c9a JB |
31 | %endif |
32 | %if %{with python3} | |
e1e76b6e | 33 | BuildRequires: python3-devel >= 1:3.4 |
08981c9a JB |
34 | BuildRequires: python3-setuptools |
35 | %if %{with tests} | |
e1e76b6e | 36 | BuildRequires: python3-certifi |
08981c9a JB |
37 | BuildRequires: python3-gevent |
38 | BuildRequires: python3-geventhttpclient | |
b0c8ef0d | 39 | BuildRequires: python3-setuptools >= 1:17.1 |
e1e76b6e | 40 | BuildRequires: python3-urllib3 >= 1.24.1 |
08981c9a JB |
41 | %endif |
42 | %endif | |
a4d91510 | 43 | BuildRequires: rpm-build >= 4.6 |
08981c9a JB |
44 | BuildRequires: rpm-pythonprov |
45 | BuildRequires: rpmbuild(macros) >= 1.714 | |
91739a9d | 46 | %if %{with doc} |
e1e76b6e JB |
47 | BuildRequires: python3-docutils |
48 | BuildRequires: sphinx-pdg-3 | |
91739a9d | 49 | %endif |
b7a44a81 | 50 | Requires: python-modules >= 1:2.7 |
44b0d135 ER |
51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
52 | ||
53 | %description | |
e156b51f ER |
54 | Dulwich is a Python implementation of the Git file formats and |
55 | protocols, which does not depend on Git itself. | |
56 | ||
57 | All functionality is available in pure Python. Optional C extensions | |
58 | can be built for improved performance. | |
59 | ||
60 | The project is named after the village in which Mr. and Mrs. Git live | |
61 | in the Monty Python sketch. | |
44b0d135 | 62 | |
b7a44a81 JB |
63 | %description -l pl.UTF-8 |
64 | Dulwich to pythonowa implementacja formatów plików i protokołów Gita, | |
65 | nie zależąca od samego Gita. | |
66 | ||
67 | Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie | |
68 | można zbudować rozszerzenia w C poprawiające wydajność. | |
69 | ||
70 | Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w | |
71 | skeczu Monty Pythona. | |
72 | ||
08981c9a JB |
73 | %package -n python3-%{module} |
74 | Summary: A Python implementation of the Git file formats and protocols | |
75 | Summary(pl.UTF-8): Pythonowa implementacja formatów plików i protokołów Gita | |
76 | Group: Libraries/Python | |
e1e76b6e JB |
77 | Requires: python3-modules >= 1:3.4 |
78 | # default binaries | |
79 | Conflicts: python-dulwich < 0.19.14 | |
08981c9a JB |
80 | |
81 | %description -n python3-%{module} | |
82 | Dulwich is a Python implementation of the Git file formats and | |
83 | protocols, which does not depend on Git itself. | |
84 | ||
85 | All functionality is available in pure Python. Optional C extensions | |
86 | can be built for improved performance. | |
87 | ||
88 | The project is named after the village in which Mr. and Mrs. Git live | |
89 | in the Monty Python sketch. | |
90 | ||
91 | %description -n python3-%{module} -l pl.UTF-8 | |
92 | Dulwich to pythonowa implementacja formatów plików i protokołów Gita, | |
93 | nie zależąca od samego Gita. | |
94 | ||
95 | Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie | |
96 | można zbudować rozszerzenia w C poprawiające wydajność. | |
97 | ||
98 | Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w | |
99 | skeczu Monty Pythona. | |
100 | ||
1de419e4 JB |
101 | %package apidocs |
102 | Summary: Documentation for Python Dulwich module | |
103 | Summary(pl.UTF-8): Dokumentacja moduły Pythona Dulwich | |
104 | Group: Documentation | |
6ba76264 | 105 | BuildArch: noarch |
1de419e4 JB |
106 | |
107 | %description apidocs | |
108 | Documentation for Python Dulwich module. | |
109 | ||
110 | %description apidocs -l pl.UTF-8 | |
111 | Dokumentacja 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 | |
142 | rm -rf $RPM_BUILD_ROOT | |
08981c9a JB |
143 | |
144 | %if %{with python2} | |
2dfc2e3a | 145 | %py_install |
44b0d135 | 146 | |
08981c9a JB |
147 | for p in dul-receive-pack dul-upload-pack dulwich ; do |
148 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/$p $RPM_BUILD_ROOT%{_bindir}/${p}-2 | |
149 | done | |
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 | ||
161 | for 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 |
164 | done |
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 |
173 | rm -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 |