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