]>
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 | |
43 | BuildRequires: rpm-pythonprov | |
44 | BuildRequires: rpmbuild(macros) >= 1.714 | |
91739a9d | 45 | %if %{with doc} |
e1e76b6e JB |
46 | BuildRequires: python3-docutils |
47 | BuildRequires: sphinx-pdg-3 | |
91739a9d | 48 | %endif |
b7a44a81 | 49 | Requires: python-modules >= 1:2.7 |
44b0d135 ER |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
52 | %description | |
e156b51f ER |
53 | Dulwich is a Python implementation of the Git file formats and |
54 | protocols, which does not depend on Git itself. | |
55 | ||
56 | All functionality is available in pure Python. Optional C extensions | |
57 | can be built for improved performance. | |
58 | ||
59 | The project is named after the village in which Mr. and Mrs. Git live | |
60 | in the Monty Python sketch. | |
44b0d135 | 61 | |
b7a44a81 JB |
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. | |
65 | ||
66 | Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie | |
67 | można zbudować rozszerzenia w C poprawiające wydajność. | |
68 | ||
69 | Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w | |
70 | skeczu Monty Pythona. | |
71 | ||
08981c9a JB |
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 | |
e1e76b6e JB |
76 | Requires: python3-modules >= 1:3.4 |
77 | # default binaries | |
78 | Conflicts: python-dulwich < 0.19.14 | |
08981c9a JB |
79 | |
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. | |
83 | ||
84 | All functionality is available in pure Python. Optional C extensions | |
85 | can be built for improved performance. | |
86 | ||
87 | The project is named after the village in which Mr. and Mrs. Git live | |
88 | in the Monty Python sketch. | |
89 | ||
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. | |
93 | ||
94 | Cała funkcjonalność jest dostępna w czystym Pythonie. Opcjonalnie | |
95 | można zbudować rozszerzenia w C poprawiające wydajność. | |
96 | ||
97 | Nazwa projektu wywodzi się od wioski, w której żyją Pan i Pani Git w | |
98 | skeczu Monty Pythona. | |
99 | ||
1de419e4 JB |
100 | %package apidocs |
101 | Summary: Documentation for Python Dulwich module | |
102 | Summary(pl.UTF-8): Dokumentacja moduły Pythona Dulwich | |
103 | Group: Documentation | |
6ba76264 | 104 | BuildArch: noarch |
1de419e4 JB |
105 | |
106 | %description apidocs | |
107 | Documentation for Python Dulwich module. | |
108 | ||
109 | %description apidocs -l pl.UTF-8 | |
110 | Dokumentacja moduły Pythona Dulwich. | |
111 | ||
44b0d135 ER |
112 | %prep |
113 | %setup -q -n %{module}-%{version} | |
b7a44a81 JB |
114 | |
115 | %{__rm} -r %{module}.egg-info | |
44b0d135 ER |
116 | |
117 | %build | |
08981c9a | 118 | %if %{with python2} |
2dfc2e3a | 119 | %py_build |
44b0d135 ER |
120 | |
121 | %if %{with tests} | |
e1e76b6e | 122 | %{__python} -m unittest discover -t . -s dulwich/tests |
08981c9a JB |
123 | %endif |
124 | %endif | |
125 | ||
126 | %if %{with python3} | |
127 | %py3_build | |
128 | ||
129 | %if %{with tests} | |
e1e76b6e | 130 | %{__python3} -m unittest discover -t . -s dulwich/tests |
08981c9a | 131 | %endif |
44b0d135 ER |
132 | %endif |
133 | ||
91739a9d | 134 | %if %{with doc} |
44b0d135 | 135 | # sphinx fails with it from time to time with parallel build |
1de419e4 | 136 | %{__make} -C docs -j1 html \ |
e1e76b6e | 137 | SPHINXBUILD=sphinx-build-3 |
91739a9d | 138 | %endif |
44b0d135 ER |
139 | |
140 | %install | |
141 | rm -rf $RPM_BUILD_ROOT | |
08981c9a JB |
142 | |
143 | %if %{with python2} | |
2dfc2e3a | 144 | %py_install |
44b0d135 | 145 | |
08981c9a JB |
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 | |
148 | done | |
149 | ||
1de419e4 | 150 | %py_postclean |
44b0d135 ER |
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 | |
08981c9a JB |
155 | %endif |
156 | ||
157 | %if %{with python3} | |
158 | %py3_install | |
159 | ||
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 | |
e1e76b6e | 162 | ln -sf ${p}-3 $RPM_BUILD_ROOT%{_bindir}/${p} |
08981c9a JB |
163 | done |
164 | ||
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 | |
169 | %endif | |
170 | ||
44b0d135 ER |
171 | %clean |
172 | rm -rf $RPM_BUILD_ROOT | |
173 | ||
08981c9a | 174 | %if %{with python2} |
44b0d135 ER |
175 | %files |
176 | %defattr(644,root,root,755) | |
e1e76b6e | 177 | %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO |
08981c9a JB |
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 | |
44b0d135 | 181 | %dir %{py_sitedir}/%{module} |
44b0d135 ER |
182 | %{py_sitedir}/%{module}/*.py[co] |
183 | %attr(755,root,root) %{py_sitedir}/%{module}/_*.so | |
b7a44a81 | 184 | %dir %{py_sitedir}/%{module}/contrib |
44b0d135 | 185 | %{py_sitedir}/%{module}/contrib/*.py[co] |
b7a44a81 | 186 | %{py_sitedir}/%{module}-%{version}-py*.egg-info |
08981c9a JB |
187 | %endif |
188 | ||
189 | %if %{with python3} | |
190 | %files -n python3-%{module} | |
191 | %defattr(644,root,root,755) | |
e1e76b6e | 192 | %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO |
08981c9a JB |
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 | |
08981c9a JB |
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 | |
08981c9a JB |
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 | |
207 | %endif | |
1de419e4 JB |
208 | |
209 | %if %{with doc} | |
210 | %files apidocs | |
211 | %defattr(644,root,root,755) | |
212 | %doc docs/build/html/{_static,tutorial,*.html,*.js} | |
213 | %endif |