]>
Commit | Line | Data |
---|---|---|
44b0d135 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do not perform "make test" | |
91739a9d | 4 | %bcond_without doc # don't build doc |
44b0d135 ER |
5 | |
6 | %define module dulwich | |
e156b51f | 7 | Summary: A Python implementation of the Git file formats and protocols |
44b0d135 ER |
8 | Name: python-%{module} |
9 | Version: 0.11.2 | |
10 | Release: 1 | |
11 | License: GPLv2+ or ASL 2.0 | |
12 | Group: Libraries/Python | |
13 | Source0: https://pypi.python.org/packages/source/d/%{module}/%{module}-%{version}.tar.gz | |
14 | # Source0-md5: ef70dce05422015373ca2704ddf281e7 | |
2bf830f1 | 15 | URL: https://www.dulwich.io/ |
b7468a68 | 16 | BuildRequires: python-devel |
44b0d135 ER |
17 | BuildRequires: python-setuptools |
18 | BuildRequires: rpm-pythonprov | |
56eaeb62 | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
91739a9d ER |
20 | %if %{with tests} |
21 | BuildRequires: python-nose | |
22 | %endif | |
23 | %if %{with doc} | |
24 | BuildRequires: python-docutils | |
44b0d135 | 25 | BuildRequires: sphinx-pdg |
91739a9d | 26 | %endif |
44b0d135 ER |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
e156b51f ER |
30 | Dulwich is a Python implementation of the Git file formats and |
31 | protocols, which does not depend on Git itself. | |
32 | ||
33 | All functionality is available in pure Python. Optional C extensions | |
34 | can be built for improved performance. | |
35 | ||
36 | The project is named after the village in which Mr. and Mrs. Git live | |
37 | in the Monty Python sketch. | |
44b0d135 ER |
38 | |
39 | %prep | |
40 | %setup -q -n %{module}-%{version} | |
41 | rm -r %{module}.egg-info | |
42 | ||
43 | %build | |
44 | CC="%{__cc}" \ | |
45 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
2dfc2e3a | 46 | %py_build |
44b0d135 ER |
47 | |
48 | %if %{with tests} | |
49 | cd dulwich/tests | |
50 | nosetests-%{py_ver} test*.py | |
51 | %endif | |
52 | ||
91739a9d | 53 | %if %{with doc} |
44b0d135 ER |
54 | # sphinx fails with it from time to time with parallel build |
55 | %{__make} -C docs -j html | |
56 | rm -r docs/build/html/_sources | |
91739a9d ER |
57 | rm docs/build/html/{.buildinfo,objects.inv} |
58 | %endif | |
44b0d135 ER |
59 | |
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
2dfc2e3a | 62 | %py_install |
44b0d135 ER |
63 | |
64 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/*.[ch] | |
65 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/tests | |
66 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/contrib/test_*.py* | |
67 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/docs/tutorial | |
68 | ||
69 | %py_postclean | |
70 | ||
71 | %clean | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
74 | %files | |
75 | %defattr(644,root,root,755) | |
91739a9d | 76 | %doc AUTHORS COPYING %{?with_doc:docs/build/html} |
44b0d135 ER |
77 | %attr(755,root,root) %{_bindir}/dul-receive-pack |
78 | %attr(755,root,root) %{_bindir}/dul-upload-pack | |
79 | %attr(755,root,root) %{_bindir}/dulwich | |
80 | %dir %{py_sitedir}/%{module} | |
81 | %dir %{py_sitedir}/%{module}/contrib | |
82 | %{py_sitedir}/%{module}/*.py[co] | |
83 | %attr(755,root,root) %{py_sitedir}/%{module}/_*.so | |
84 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
85 | %{py_sitedir}/%{module}/contrib/*.py[co] |