]> git.pld-linux.org Git - packages/python-dulwich.git/blob - python-dulwich.spec
- updated to 0.19.16
[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-pythonprov
44 BuildRequires:  rpmbuild(macros) >= 1.714
45 %if %{with doc}
46 BuildRequires:  python3-docutils
47 BuildRequires:  sphinx-pdg-3
48 %endif
49 Requires:       python-modules >= 1:2.7
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %description
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.
61
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
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
76 Requires:       python3-modules >= 1:3.4
77 # default binaries
78 Conflicts:      python-dulwich < 0.19.14
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
100 %package apidocs
101 Summary:        Documentation for Python Dulwich module
102 Summary(pl.UTF-8):      Dokumentacja moduły Pythona Dulwich
103 Group:          Documentation
104 BuildArch:      noarch
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
112 %prep
113 %setup -q -n %{module}-%{version}
114
115 %{__rm} -r %{module}.egg-info
116
117 %build
118 %if %{with python2}
119 %py_build
120
121 %if %{with tests}
122 %{__python} -m unittest discover -t . -s dulwich/tests
123 %endif
124 %endif
125
126 %if %{with python3}
127 %py3_build
128
129 %if %{with tests}
130 %{__python3} -m unittest discover -t . -s dulwich/tests
131 %endif
132 %endif
133
134 %if %{with doc}
135 # sphinx fails with it from time to time with parallel build
136 %{__make} -C docs -j1 html \
137         SPHINXBUILD=sphinx-build-3
138 %endif
139
140 %install
141 rm -rf $RPM_BUILD_ROOT
142
143 %if %{with python2}
144 %py_install
145
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
150 %py_postclean
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
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
162         ln -sf ${p}-3 $RPM_BUILD_ROOT%{_bindir}/${p}
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
171 %clean
172 rm -rf $RPM_BUILD_ROOT
173
174 %if %{with python2}
175 %files
176 %defattr(644,root,root,755)
177 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
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
181 %dir %{py_sitedir}/%{module}
182 %{py_sitedir}/%{module}/*.py[co]
183 %attr(755,root,root) %{py_sitedir}/%{module}/_*.so
184 %dir %{py_sitedir}/%{module}/contrib
185 %{py_sitedir}/%{module}/contrib/*.py[co]
186 %{py_sitedir}/%{module}-%{version}-py*.egg-info
187 %endif
188
189 %if %{with python3}
190 %files -n python3-%{module}
191 %defattr(644,root,root,755)
192 %doc AUTHORS COPYING NEWS README.rst README.swift.rst TODO
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
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
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
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
This page took 0.091073 seconds and 3 git commands to generate.