@@ -43,24 +43,30 @@ Source: https://github.com/dogtagpki/pki/archive/v%{version}/pki-%{version}.tar.
43
43
# Python
44
44
################################################################################
45
45
46
+ # Python 2 packages
47
+ %if 0%{!?with_python2:1}
48
+ %if 0%{?rhel} && 0%{?rhel} <= 7 || 0%{?fedora} && 0%{?fedora} <= 28
49
+ %global with_python2 1
50
+ %else
51
+ %global with_python2 0
52
+ %endif
53
+ %endif
54
+
46
55
# Python 3 packages
47
56
%if 0%{!?with_python3:1}
48
- %if 0%{?fedora} || 0%{?rhel} > 7
49
- %global with_python3 1
50
- %else
57
+ %if 0%{?rhel} && 0%{?rhel} <= 7
51
58
%global with_python3 0
59
+ %else
60
+ %global with_python3 1
52
61
%endif
53
62
%endif
54
63
55
- # Python 2 packages
56
- %{!?with_python2:%global with_python2 1}
57
-
58
64
# Use Python 3 for all commands?
59
65
%if 0%{!?with_python3_default:1}
60
- %if 0%{?fedora} >= 28 || 0%{?rhel} > 7
61
- %global with_python3_default 1
62
- %else
66
+ %if 0%{?rhel} && 0%{?rhel} <= 7 || 0%{?fedora} && 0%{?fedora} <= 27
63
67
%global with_python3_default 0
68
+ %else
69
+ %global with_python3_default 1
64
70
%endif
65
71
%endif
66
72
@@ -141,13 +147,20 @@ BuildRequires: nuxwdog-client-java >= 1.0.3-13
141
147
BuildRequires: openldap-devel
142
148
BuildRequires: pkgconfig
143
149
BuildRequires: policycoreutils
150
+
144
151
%if 0%{?rhel} && 0%{?rhel} <= 7
145
152
BuildRequires: python-lxml
146
153
BuildRequires: python-sphinx
147
154
%else
155
+ %if 0%{?fedora} && 0%{?fedora} <= 28
148
156
BuildRequires: python2-lxml
149
157
BuildRequires: python2-sphinx
158
+ %else
159
+ BuildRequires: python3-lxml
160
+ BuildRequires: python3-sphinx
161
+ %endif
150
162
%endif
163
+
151
164
BuildRequires: velocity
152
165
BuildRequires: xalan-j2
153
166
BuildRequires: xerces-j2
@@ -173,50 +186,69 @@ BuildRequires: resteasy-core >= 3.0.17-1
173
186
BuildRequires: resteasy-jackson-provider >= 3.0.17-1
174
187
%endif
175
188
176
- %if 0%{?fedora} || 0%{?rhel} > 7
177
189
%if 0%{?with_python2}
178
- BuildRequires: pylint
179
- %if 0%{?fedora} >= 28
180
- BuildRequires: python2-flake8 >= 2.5.4
181
- # python-flake8 2.5.4 package should require pyflakes >= 1.2.3
182
- BuildRequires: python2-pyflakes >= 1.2.3
190
+ %if 0%{?rhel} && 0%{?rhel} <= 7
191
+ # no pylint
183
192
%else
193
+ BuildRequires: pylint
194
+ %if 0%{?fedora} && 0%{?fedora} <= 27
184
195
BuildRequires: python-flake8 >= 2.5.4
185
196
BuildRequires: pyflakes >= 1.2.3
197
+ %else
198
+ BuildRequires: python2-flake8 >= 2.5.4
199
+ BuildRequires: python2-pyflakes >= 1.2.3
200
+ %endif
186
201
%endif
187
202
%endif # with_python2
188
203
189
204
%if 0%{?with_python3}
190
205
BuildRequires: python3-pylint
191
- # python3-flake8 2.5.4 package should require python3-pyflakes >= 1.2.3
192
206
BuildRequires: python3-flake8 >= 2.5.4
193
207
BuildRequires: python3-pyflakes >= 1.2.3
194
208
%endif # with_python3
195
- %endif
196
209
197
210
%if 0%{?with_python2}
198
211
BuildRequires: python2
199
212
BuildRequires: python2-devel
200
213
BuildRequires: python2-cryptography
201
- %if 0%{?fedora} >= 28 || 0%{?rhel} > 7
202
- BuildRequires: python2-nss
203
- BuildRequires: python2-requests >= 2.6.0
204
- BuildRequires: python2-six
205
- BuildRequires: python2-libselinux
206
- BuildRequires: python2-policycoreutils
207
- BuildRequires: python2-ldap
208
- %else
214
+ %if 0%{?rhel} && 0%{?rhel} <= 7 || 0%{?fedora} && 0%{?fedora} <= 27
209
215
BuildRequires: python-nss
210
216
BuildRequires: python-requests >= 2.6.0
211
217
BuildRequires: python-six
212
218
BuildRequires: libselinux-python
213
219
BuildRequires: policycoreutils-python
214
220
BuildRequires: python-ldap
221
+ %else
222
+ BuildRequires: python2-nss
223
+ BuildRequires: python2-requests >= 2.6.0
224
+ BuildRequires: python2-six
225
+ BuildRequires: python2-libselinux
226
+ BuildRequires: python2-policycoreutils
227
+ BuildRequires: python2-ldap
215
228
%endif
216
- %if 0%{?fedora} || 0%{?rhel} > 7
229
+ %if 0%{?rhel} && 0%{?rhel} <= 7
230
+ # no policycoreutils-python-utils
231
+ %else
217
232
BuildRequires: policycoreutils-python-utils
218
233
%endif
219
234
%endif # with_python2
235
+
236
+ %if 0%{?with_python3}
237
+ BuildRequires: python3
238
+ BuildRequires: python3-devel
239
+ BuildRequires: python3-cryptography
240
+ BuildRequires: python3-lxml
241
+ %if 0%{?rhel} && 0%{?rhel} <= 7 || 0%{?fedora} && 0%{?fedora} <= 27
242
+ # no python3-libselinux
243
+ %else
244
+ BuildRequires: python3-libselinux
245
+ %endif
246
+ BuildRequires: python3-nss
247
+ BuildRequires: python3-pyldap
248
+ BuildRequires: python3-requests >= 2.6.0
249
+ BuildRequires: python3-six
250
+ %endif # with_python3
251
+
220
252
BuildRequires: junit
221
253
BuildRequires: jpackage-utils >= 0:1.7.5-10
222
254
%if 0%{?rhel} && 0%{?rhel} <= 7
@@ -242,17 +274,6 @@ BuildRequires: tomcat >= 1:9.0.7
242
274
%endif
243
275
%endif
244
276
245
- %if 0%{?with_python3}
246
- BuildRequires: python3
247
- BuildRequires: python3-devel
248
- BuildRequires: python3-cryptography
249
- BuildRequires: python3-lxml
250
- BuildRequires: python3-nss
251
- BuildRequires: python3-pyldap
252
- BuildRequires: python3-requests >= 2.6.0
253
- BuildRequires: python3-six
254
- %endif # with_python3
255
-
256
277
# additional build requirements needed to build native 'tpsclient'
257
278
# REMINDER: Revisit these once 'tpsclient' is rewritten as a Java app
258
279
BuildRequires: apr-devel
0 commit comments