]> git.pld-linux.org Git - packages/python-dulwich.git/blob - python-dulwich.spec
- rpm version for noarch subpackage
[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 # keep 0.19.x here for python2 support
13 Version:        0.19.16
14 Release:        1
15 License:        GPL v2+ or Apache 2.0+
16 Group:          Libraries/Python
17 Source0:        https://www.dulwich.io/releases/%{module}-%{version}.tar.gz
18 # Source0-md5:  0715a7cc669dd19416b4ddc797e84c1f
19 URL:            https://www.dulwich.io/
20 %if %{with python2}
21 BuildRequires:  python-devel >= 1:2.7
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-certifi
25 BuildRequires:  python-gevent
26 BuildRequires:  python-geventhttpclient
27 BuildRequires:  python-mock
28 BuildRequires:  python-setuptools >= 1:17.1
29 BuildRequires:  python-urllib3 >= 1.24.1
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-devel >= 1:3.4
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-certifi
37 BuildRequires:  python3-gevent
38 BuildRequires:  python3-geventhttpclient
39 BuildRequires:  python3-setuptools >= 1:17.1
40 BuildRequires:  python3-urllib3 >= 1.24.1
41 %endif
42 %endif
43 BuildRequires:  rpm-build >= 4.6
44 BuildRequires:  rpm-pythonprov
45 BuildRequires:  rpmbuild(macros) >= 1.714
46 %if %{with doc}
47 BuildRequires:  python3-docutils
48 BuildRequires:  sphinx-pdg-3
49 %endif
50 Requires:       python-modules >= 1:2.7
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
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.
62
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
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
77 Requires:       python3-modules >= 1:3.4
78 # default binaries
79 Conflicts:      python-dulwich < 0.19.14
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
101 %package apidocs
102 Summary:        Documentation for Python Dulwich module
103 Summary(pl.UTF-8):      Dokumentacja moduły Pythona Dulwich
104 Group:          Documentation
105 BuildArch:      noarch
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
113 %prep
114 %setup -q -n %{module}-%{version}
115
116 %{__rm} -r %{module}.egg-info
117
118 %build
119 %if %{with python2}
120 %py_build
121
122 %if %{with tests}
123 %{__python} -m unittest discover -t . -s dulwich/tests
124 %endif
125 %endif
126
127 %if %{with python3}
128 %py3_build
129
130 %if %{with tests}
131 %{__python3} -m unittest discover -t . -s dulwich/tests
132 %endif
133 %endif
134
135 %if %{with doc}
136 # sphinx fails with it from time to time with parallel build
137 %{__make} -C docs -j1 html \
138         SPHINXBUILD=sphinx-build-3
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143
144 %if %{with python2}
145 %py_install
146
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
151 %py_postclean
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
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
163         ln -sf ${p}-3 $RPM_BUILD_ROOT%{_bindir}/${p}
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
172 %clean
173 rm -rf $RPM_BUILD_ROOT
174
175 %if %{with python2}
176 %files
177 %defattr(644,root,root,755)
178 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
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
182 %dir %{py_sitedir}/%{module}
183 %{py_sitedir}/%{module}/*.py[co]
184 %attr(755,root,root) %{py_sitedir}/%{module}/_*.so
185 %dir %{py_sitedir}/%{module}/contrib
186 %{py_sitedir}/%{module}/contrib/*.py[co]
187 %{py_sitedir}/%{module}-%{version}-py*.egg-info
188 %endif
189
190 %if %{with python3}
191 %files -n python3-%{module}
192 %defattr(644,root,root,755)
193 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
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
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
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
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
This page took 0.079106 seconds and 3 git commands to generate.