forked from rpm-software-management/dnf-plugins-extras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdnf-plugins-extras.spec
393 lines (345 loc) · 13.8 KB
/
dnf-plugins-extras.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
%{!?dnf_lowest_compatible: %global dnf_lowest_compatible 3.0.0}
%global dnf_plugins_extra_obsolete 2.0.0
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif
Name: dnf-plugins-extras
Version: 3.0.1
Release: 1%{?dist}
Summary: Extras Plugins for DNF
License: GPLv2+
URL: https://github.com/rpm-software-management/%{name}
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: cmake
BuildRequires: gettext
# py2
BuildRequires: python2-devel
BuildRequires: python2-dnf >= %{dnf_lowest_compatible}
BuildRequires: python2-nose
BuildRequires: python2-sphinx
%if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7)
BuildRequires: python-kickstart
%else
BuildRequires: python2-kickstart
%endif
# py3
BuildRequires: python3-devel
BuildRequires: python3-dnf >= %{dnf_lowest_compatible}
BuildRequires: python3-nose
BuildRequires: python3-sphinx
BuildRequires: python3-kickstart
%description
Extras Plugins for DNF.
%package -n python2-%{name}-common
Summary: Common files for Extras Plugins for DNF
Requires: python2-dnf >= %{dnf_lowest_compatible}
%{?python_provide:%python_provide python2-%{name}-common}
Provides: %{name}-common = %{version}-%{release}
Obsoletes: %{name}-common < %{version}-%{release}
Obsoletes: %{name} < %{version}-%{release}
Obsoletes: %{name}-common-data < %{version}-%{release}
Conflicts: python3-%{name}-common < %{version}-%{release}
%description -n python2-%{name}-common
Common files for Extras Plugins, Python 2 version.
%if %{with python3}
%package -n python3-%{name}-common
Summary: Common files for Extras Plugins for DNF
Requires: python3-dnf >= %{dnf_lowest_compatible}
%{?python_provide:%python_provide python3-%{name}-common}
Provides: %{name}-common = %{version}-%{release}
Obsoletes: %{name}-common < %{version}-%{release}
Obsoletes: python3-%{name}-common < %{version}-%{release}
Obsoletes: %{name} < %{version}-%{release}
Obsoletes: %{name}-common-data < %{version}-%{release}
Conflicts: python2-%{name}-common < %{version}-%{release}
%description -n python3-%{name}-common
Common files for Extras Plugins for DNF, Python 3 version.
%endif
%package -n python2-dnf-plugin-kickstart
Summary: Kickstart Plugin for DNF
Requires: python2-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python2-%{name}-kickstart}
%if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7)
BuildRequires: python-kickstart
Requires: python-kickstart
%else
BuildRequires: python2-kickstart
Requires: python2-kickstart
%endif
%if !%{with python3}
Provides: dnf-command(kickstart)
Provides: %{name}-kickstart = %{version}-%{release}
Provides: dnf-plugin-kickstart = %{version}-%{release}
%endif
Provides: python2-%{name}-kickstart = %{version}-%{release}
Conflicts: python3-dnf-plugin-kickstart < %{version}-%{release}
Obsoletes: python2-%{name}-kickstart < %{dnf_plugins_extra_obsolete}
%description -n python2-dnf-plugin-kickstart
Kickstart Plugin for DNF, Python 2 version. Install packages listed in a
Kickstart file.
%if %{with python3}
%package -n python3-dnf-plugin-kickstart
Summary: Kickstart Plugin for DNF
Requires: python3-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python3-%{name}-kickstart}
BuildRequires: python3-kickstart
Requires: python3-kickstart
Provides: dnf-command(kickstart)
Provides: %{name}-kickstart = %{version}-%{release}
Provides: dnf-plugin-kickstart = %{version}-%{release}
Provides: python3-%{name}-kickstart = %{version}-%{release}
Conflicts: python2-dnf-plugin-kickstart < %{version}-%{release}
Obsoletes: python3-%{name}-kickstart < %{dnf_plugins_extra_obsolete}
%description -n python3-dnf-plugin-kickstart
Kickstart Plugin for DNF, Python 3 version. Install packages listed in a
Kickstart file.
%endif
%if %{with python3}
%package -n python3-dnf-plugin-rpmconf
Summary: RpmConf Plugin for DNF
BuildRequires: python3-rpmconf
Requires: python3-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python3-%{name}-rpmconf}
Requires: python3-rpmconf
Provides: %{name}-rpmconf = %{version}-%{release}
Provides: dnf-plugin-rpmconf = %{version}-%{release}
Provides: python3-%{name}-rpmconf = %{version}-%{release}
Obsoletes: python3-%{name}-rpmconf < %{dnf_plugins_extra_obsolete}
%description -n python3-dnf-plugin-rpmconf
RpmConf Plugin for DNF, Python 3 version. Handles .rpmnew, .rpmsave every
transaction.
%endif
%package -n python2-dnf-plugin-snapper
Summary: Snapper Plugin for DNF
Requires: python2-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python2-%{name}-snapper}
%if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7)
Requires: dbus-python
%else
Requires: python2-dbus
%endif
Requires: snapper
%if !%{with python3}
Provides: %{name}-snapper = %{version}-%{release}
Provides: dnf-plugin-snapper = %{version}-%{release}
%endif
Provides: python2-%{name}-snapper = %{version}-%{release}
Conflicts: python3-dnf-plugin-snapper < %{version}-%{release}
Obsoletes: python2-%{name}-snapper < %{dnf_plugins_extra_obsolete}
%description -n python2-dnf-plugin-snapper
Snapper Plugin for DNF, Python 2 version. Creates snapshot every transaction.
%if %{with python3}
%package -n python3-dnf-plugin-snapper
Summary: Snapper Plugin for DNF
Requires: python3-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python3-%{name}-snapper}
Requires: python3-dbus
Requires: snapper
Provides: %{name}-snapper = %{version}-%{release}
Provides: dnf-plugin-snapper = %{version}-%{release}
Provides: python3-%{name}-snapper = %{version}-%{release}
Conflicts: python2-dnf-plugin-snapper < %{version}-%{release}
Obsoletes: python3-%{name}-snapper < %{dnf_plugins_extra_obsolete}
%description -n python3-dnf-plugin-snapper
Snapper Plugin for DNF, Python 3 version. Creates snapshot every transaction.
%endif
%package -n python2-dnf-plugin-system-upgrade
Summary: System Upgrade Plugin for DNF
Requires: python2-%{name}-common = %{version}-%{release}
Requires: python2-systemd
%{?python_provide:%python_provide python2-%{name}-system-upgrade}
%if !%{with python3}
Provides: dnf-command(system-upgrade)
Provides: %{name}-system-upgrade = %{version}-%{release}
Provides: system-upgrade = %{version}-%{release}
Provides: dnf-plugin-system-upgrade = %{version}-%{release}
Obsoletes: fedup < 0.9.4
Obsoletes: dnf-plugin-system-upgrade < 0.10
%endif
Provides: python2-%{name}-system-upgrade = %{version}-%{release}
Obsoletes: python2-dnf-plugin-system-upgrade < %{dnf_plugins_extra_obsolete}
Obsoletes: python2-%{name}-system-upgrade < %{dnf_plugins_extra_obsolete}
Conflicts: python3-dnf-plugin-system-upgrade < %{version}-%{release}
BuildRequires: pkgconfig(systemd)
BuildRequires: systemd
BuildRequires: python2-systemd
%{?system_requires}
%description -n python2-dnf-plugin-system-upgrade
System Upgrade Plugin for DNF, Python 2 version. Enables offline system upgrades
using the "dnf system-upgrade" command.
%if %{with python3}
%package -n python3-dnf-plugin-system-upgrade
Summary: System Upgrade Plugin for DNF
Requires: python3-%{name}-common = %{version}-%{release}
Requires: python3-systemd
%{?python_provide:%python_provide python3-%{name}-system-upgrade}
Provides: dnf-command(system-upgrade)
Provides: %{name}-system-upgrade = %{version}-%{release}
Provides: system-upgrade = %{version}-%{release}
Provides: dnf-plugin-system-upgrade = %{version}-%{release}
Provides: python3-%{name}-system-upgrade = %{version}-%{release}
Obsoletes: python3-%{name}-system-upgrade < %{dnf_plugins_extra_obsolete}
Obsoletes: fedup < 0.9.4
Obsoletes: dnf-plugin-system-upgrade < 0.10
Conflicts: python2-dnf-plugin-system-upgrade < %{version}-%{release}
BuildRequires: pkgconfig(systemd)
BuildRequires: systemd
BuildRequires: python3-systemd
%{?systemd_requires}
%description -n python3-dnf-plugin-system-upgrade
System Upgrade Plugin for DNF, Python 3 version. Enables offline system upgrades
using the "dnf system-upgrade" command.
%endif
%package -n python2-dnf-plugin-tracer
Summary: Tracer Plugin for DNF
Requires: python2-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python2-%{name}-tracer}
Requires: python2-tracer >= 0.6.12
%if !%{with python3}
Provides: dnf-plugin-tracer = %{version}-%{release}
Provides: %{name}-tracer = %{version}-%{release}
%endif
Provides: python2-%{name}-tracer = %{version}-%{release}
Conflicts: python3-dnf-plugin-tracer < %{version}-%{release}
Obsoletes: python2-%{name}-tracer < %{dnf_plugins_extra_obsolete}
%description -n python2-dnf-plugin-tracer
Tracer Plugin for DNF, Python 2 version. Finds outdated running applications in your system
every transaction.
%if %{with python3}
%package -n python3-dnf-plugin-tracer
Summary: Tracer Plugin for DNF
Requires: python3-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python3-%{name}-tracer}
Requires: python3-tracer >= 0.6.12
Provides: dnf-plugin-tracer = %{version}-%{release}
Provides: %{name}-tracer = %{version}-%{release}
Provides: python3-%{name}-tracer = %{version}-%{release}
Conflicts: python2-dnf-plugin-tracer < %{version}-%{release}
Obsoletes: python3-%{name}-tracer < %{dnf_plugins_extra_obsolete}
%description -n python3-dnf-plugin-tracer
Tracer Plugin for DNF, Python 3 version. Finds outdated running applications in
your system every transaction.
%endif
%if %{with python3}
%package -n python3-dnf-plugin-torproxy
Summary: Tor Proxy Plugin for DNF
Requires: python3-%{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python3-%{name}-torproxy}
Requires: python3-pycurl
Provides: dnf-plugin-torproxy = %{version}-%{release}
Provides: %{name}-torproxy = %{version}-%{release}
Provides: python3-%{name}-torproxy = %{version}-%{release}
Obsoletes: python3-%{name}-torproxy < %{dnf_plugins_extra_obsolete}
%description -n python3-dnf-plugin-torproxy
Tor proxy plugin forces DNF to use Tor to download packages. It makes sure that
Tor is working and avoids leaking the hostname by using the proper SOCKS5 interface.
%endif
%prep
%autosetup
mkdir python2
%if %{with python3}
mkdir python3
%endif
%build
pushd python2
%cmake .. -DPYTHON_DESIRED:FILEPATH=%{__python2}
%make_build
make doc-man
popd
%if %{with python3}
pushd python3
%cmake .. -DPYTHON_DESIRED:FILEPATH=%{__python3}
%make_build
make doc-man
popd
%endif
%install
pushd python2
%make_install
popd
%if %{with python3}
pushd python3
%make_install
popd
%endif
mkdir -p %{buildroot}%{_unitdir}/system-update.target.wants/
pushd %{buildroot}%{_unitdir}/system-update.target.wants/
ln -sr ../dnf-system-upgrade.service
popd
%find_lang %{name}
%check
PYTHONPATH="%{buildroot}%{python2_sitelib}:%{buildroot}%{python2_sitelib}/dnf-plugins/" nosetests-%{python2_version} -s tests/
%if %{with python3}
PYTHONPATH="%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib}/dnf-plugins/" nosetests-%{python3_version} -s tests/
%endif
%files -n python2-%{name}-common -f %{name}.lang
%{python2_sitelib}/dnfpluginsextras/
%license COPYING
%doc AUTHORS README.rst
%if %{with python3}
%files -n python3-%{name}-common -f %{name}.lang
%{python3_sitelib}/dnfpluginsextras/
%dir %{python3_sitelib}/dnf-plugins/__pycache__/
%license COPYING
%doc AUTHORS README.rst
%endif
%files -n python2-dnf-plugin-kickstart
%{python2_sitelib}/dnf-plugins/kickstart.*
%{_mandir}/man8/dnf.plugin.kickstart.*
%if %{with python3}
%files -n python3-dnf-plugin-kickstart
%{python3_sitelib}/dnf-plugins/kickstart.*
%{python3_sitelib}/dnf-plugins/__pycache__/kickstart.*
%{_mandir}/man8/dnf.plugin.kickstart.*
%endif
%if %{with python3}
%files -n python3-dnf-plugin-rpmconf
%config(noreplace) %{_sysconfdir}/dnf/plugins/rpmconf.conf
%{python3_sitelib}/dnf-plugins/rpm_conf.*
%{python3_sitelib}/dnf-plugins/__pycache__/rpm_conf.*
%{_mandir}/man8/dnf.plugin.rpmconf.*
%endif
%files -n python2-dnf-plugin-snapper
%{python2_sitelib}/dnf-plugins/snapper.*
%{_mandir}/man8/dnf.plugin.snapper.*
%if %{with python3}
%files -n python3-dnf-plugin-snapper
%{python3_sitelib}/dnf-plugins/snapper.*
%{python3_sitelib}/dnf-plugins/__pycache__/snapper.*
%{_mandir}/man8/dnf.plugin.snapper.*
%endif
%files -n python2-dnf-plugin-system-upgrade
%{_unitdir}/dnf-system-upgrade.service
%{_unitdir}/dnf-system-upgrade-cleanup.service
%{_unitdir}/system-update.target.wants/dnf-system-upgrade.service
%{python2_sitelib}/dnf-plugins/system_upgrade.*
%{_mandir}/man8/dnf.plugin.system-upgrade.*
%if %{with python3}
%files -n python3-dnf-plugin-system-upgrade
%{_unitdir}/dnf-system-upgrade.service
%{_unitdir}/dnf-system-upgrade-cleanup.service
%{_unitdir}/system-update.target.wants/dnf-system-upgrade.service
%{python3_sitelib}/dnf-plugins/system_upgrade.py
%{python3_sitelib}/dnf-plugins/__pycache__/system_upgrade.*
%{_mandir}/man8/dnf.plugin.system-upgrade.*
%endif
%files -n python2-dnf-plugin-tracer
%{python2_sitelib}/dnf-plugins/tracer.*
%{_mandir}/man8/dnf.plugin.tracer.*
%if %{with python3}
%files -n python3-dnf-plugin-tracer
%{python3_sitelib}/dnf-plugins/tracer.*
%{python3_sitelib}/dnf-plugins/__pycache__/tracer.*
%{_mandir}/man8/dnf.plugin.tracer.*
%endif
%if %{with python3}
%files -n python3-dnf-plugin-torproxy
%config(noreplace) %{_sysconfdir}/dnf/plugins/torproxy.conf
%{python3_sitelib}/dnf-plugins/torproxy.*
%{python3_sitelib}/dnf-plugins/__pycache__/torproxy.*
%{_mandir}/man8/dnf.plugin.torproxy.*
%endif
%changelog