forked from rpm-software-management/dnf5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdnf5.spec
534 lines (424 loc) · 14 KB
/
dnf5.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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
%global project_version_major 5
%global project_version_minor 0
%global project_version_patch 0
Name: dnf5
Version: %{project_version_major}.%{project_version_minor}.%{project_version_patch}
Release: 0~pre%{?dist}
Summary: Command-line package manager
License: GPLv2+
URL: https://github.com/rpm-software-management/dnf5
Source0: %{url}/archive/%{version}/dnf5-%{version}.tar.gz
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: dnf-data
Recommends: bash-completion
BuildRequires: bash-completion
# ========== build options ==========
%bcond_without dnf5daemon_client
%bcond_without dnf5daemon_server
%bcond_without libdnf_cli
%bcond_without dnf5
%bcond_without dnf5_plugins
%bcond_without plugin_actions
%bcond_without python_plugins_loader
%bcond_without comps
%bcond_without modulemd
%bcond_without zchunk
%bcond_with html
%if 0%{?rhel} == 8
%bcond_with man
%else
%bcond_without man
%endif
# TODO Go bindings fail to build, disable for now
%bcond_with go
%bcond_without perl5
%bcond_without python3
%bcond_without ruby
%bcond_with clang
%bcond_with sanitizers
%bcond_without tests
%bcond_with performance_tests
%bcond_with dnf5daemon_tests
%if %{with clang}
%global toolchain clang
%endif
# ========== versions of dependencies ==========
%global libmodulemd_version 2.5.0
%global librepo_version 1.13.0
%global libsolv_version 0.7.21
%global swig_version 4
%global zchunk_version 0.9.11
# ========== build requires ==========
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gettext
%if %{with clang}
BuildRequires: clang
%else
BuildRequires: gcc-c++
%endif
BuildRequires: toml11-devel
BuildRequires: pkgconfig(check)
%if %{with tests}
BuildRequires: pkgconfig(cppunit)
%endif
BuildRequires: pkgconfig(fmt)
BuildRequires: (pkgconfig(gpgme) or gpgme-devel)
BuildRequires: pkgconfig(json-c)
%if %{with comps}
BuildRequires: pkgconfig(libcomps)
%endif
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(librepo) >= %{librepo_version}
BuildRequires: pkgconfig(libsolv) >= %{libsolv_version}
BuildRequires: pkgconfig(libsolvext) >= %{libsolv_version}
%if %{with modulemd}
BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version}
%endif
BuildRequires: pkgconfig(rpm) >= 4.17.0
BuildRequires: pkgconfig(sqlite3)
%if %{with zchunk}
BuildRequires: pkgconfig(zck) >= %{zchunk_version}
%endif
%if %{with html} || %{with man}
BuildRequires: python3dist(breathe)
BuildRequires: python3dist(sphinx) >= 4.1.2
BuildRequires: python3dist(sphinx-rtd-theme)
%endif
%if %{with tests}
BuildRequires: rpm-build
BuildRequires: createrepo_c
%endif
%if %{with sanitizers}
# compiler-rt is required by sanitizers in clang
BuildRequires: compiler-rt
BuildRequires: libasan
BuildRequires: liblsan
BuildRequires: libubsan
%endif
%description
DNF5 is a command-line package manager that automates the process of installing,
upgrading, configuring, and removing computer programs in a consistent manner.
It supports RPM packages, modulemd modules, and comps groups & environments.
%files
%{_bindir}/dnf5
%dir %{_libdir}/dnf5/
%dir %{_libdir}/dnf5/plugins/
%{_libdir}/dnf5/plugins/README
%dir %{_datadir}/bash-completion/
%dir %{_datadir}/bash-completion/completions/
%{_datadir}/bash-completion/completions/dnf5
%license COPYING.md
%license gpl-2.0.txt
%{_mandir}/man8/dnf5.8.gz
# ========== libdnf5 ==========
%package -n libdnf5
Summary: Package management library
License: LGPLv2.1+
#Requires: libmodulemd{?_isa} >= {libmodulemd_version}
Requires: libsolv%{?_isa} >= %{libsolv_version}
Requires: librepo%{?_isa} >= %{librepo_version}
%description -n libdnf5
Package management library
%files -n libdnf5
%{_libdir}/libdnf5.so.*
%license lgpl-2.1.txt
%{_var}/cache/libdnf/
# ========== libdnf5-cli ==========
%if %{with libdnf_cli}
%package -n libdnf5-cli
Summary: Library for working with a terminal in a command-line package manager
License: LGPLv2.1+
BuildRequires: pkgconfig(smartcols)
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n libdnf5-cli
Library for working with a terminal in a command-line package manager.
%files -n libdnf5-cli
%{_libdir}/libdnf-cli.so.*
%license COPYING.md
%license lgpl-2.1.txt
%endif
# ========== libdnf5-devel ==========
%package -n libdnf5-devel
Summary: Development files for libdnf
License: LGPLv2.1+
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libsolv-devel%{?_isa} >= %{libsolv_version}
Conflicts: libdnf-devel < 5
%description -n libdnf5-devel
Development files for libdnf.
%files -n libdnf5-devel
%{_includedir}/libdnf/
%{_libdir}/libdnf5.so
%{_libdir}/pkgconfig/libdnf.pc
%license COPYING.md
%license lgpl-2.1.txt
# ========== libdnf5-cli-devel ==========
%package -n libdnf5-cli-devel
Summary: Development files for libdnf5-cli
License: LGPLv2.1+
Requires: libdnf5-cli%{?_isa} = %{version}-%{release}
%description -n libdnf5-cli-devel
Development files for libdnf5-cli.
%files -n libdnf5-cli-devel
%{_includedir}/libdnf-cli/
%{_libdir}/libdnf-cli.so
%{_libdir}/pkgconfig/libdnf-cli.pc
%license COPYING.md
%license lgpl-2.1.txt
# ========== perl5-libdnf ==========
%if %{with perl5}
%package -n perl5-libdnf5
Summary: Perl 5 bindings for the libdnf library.
License: LGPLv2.1+
Provides: perl(libdnf) = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: perl-devel
BuildRequires: perl-macros
BuildRequires: swig >= %{swig_version}
%if %{with tests}
BuildRequires: perl(strict)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Exception)
BuildRequires: perl(warnings)
%endif
%description -n perl5-libdnf5
Perl 5 bindings for the libdnf library.
%files -n perl5-libdnf5
%{perl_vendorarch}/libdnf5
%{perl_vendorarch}/auto/libdnf5
%license COPYING.md
%license lgpl-2.1.txt
%endif
# ========== perl5-libdnf5-cli ==========
%if %{with perl5} && %{with libdnf_cli}
%package -n perl5-libdnf5-cli
Summary: Perl 5 bindings for the libdnf5-cli library.
License: LGPLv2.1+
Provides: perl(libdnf_cli) = %{version}-%{release}
Requires: libdnf5-cli%{?_isa} = %{version}-%{release}
BuildRequires: perl-devel
BuildRequires: perl-macros
BuildRequires: swig >= %{swig_version}
%if %{with tests}
BuildRequires: perl(strict)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Exception)
BuildRequires: perl(warnings)
%endif
%description -n perl5-libdnf5-cli
Perl 5 bindings for the libdnf5-cli library.
%files -n perl5-libdnf5-cli
%{perl_vendorarch}/libdnf5_cli
%{perl_vendorarch}/auto/libdnf5_cli
%license COPYING.md
%license lgpl-2.1.txt
%endif
# ========== python3-libdnf5 ==========
%if %{with python3}
%package -n python3-libdnf5
%{?python_provide:%python_provide python3-libdnf}
Summary: Python 3 bindings for the libdnf library.
License: LGPLv2.1+
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: swig >= %{swig_version}
%description -n python3-libdnf5
Python 3 bindings for the libdnf library.
%files -n python3-libdnf5
%{python3_sitearch}/libdnf5/
%license COPYING.md
%license lgpl-2.1.txt
%endif
# ========== python3-libdnf5-cli ==========
%if %{with python3} && %{with libdnf_cli}
%package -n python3-libdnf5-cli
%{?python_provide:%python_provide python3-libdnf5-cli}
Summary: Python 3 bindings for the libdnf5-cli library.
License: LGPLv2.1+
Requires: libdnf5-cli%{?_isa} = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: swig >= %{swig_version}
%description -n python3-libdnf5-cli
Python 3 bindings for the libdnf5-cli library.
%files -n python3-libdnf5-cli
%{python3_sitearch}/libdnf5_cli/
%license COPYING.md
%license lgpl-2.1.txt
%endif
# ========== ruby-libdnf5 ==========
%if %{with ruby}
%package -n ruby-libdnf5
Summary: Ruby bindings for the libdnf library.
License: LGPLv2.1+
Provides: ruby(libdnf) = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: ruby(release)
BuildRequires: pkgconfig(ruby)
BuildRequires: swig >= %{swig_version}
%if %{with tests}
BuildRequires: rubygem-test-unit
%endif
%description -n ruby-libdnf5
Ruby bindings for the libdnf library.
%files -n ruby-libdnf5
%{ruby_vendorarchdir}/libdnf5/
%license COPYING.md
%license lgpl-2.1.txt
%endif
# ========== ruby-libdnf5-cli ==========
%if %{with ruby} && %{with libdnf_cli}
%package -n ruby-libdnf5-cli
Summary: Ruby bindings for the libdnf5-cli library.
License: LGPLv2.1+
Provides: ruby(libdnf_cli) = %{version}-%{release}
Requires: libdnf5-cli%{?_isa} = %{version}-%{release}
BuildRequires: pkgconfig(ruby)
BuildRequires: swig >= %{swig_version}
%if %{with tests}
BuildRequires: rubygem-test-unit
%endif
%description -n ruby-libdnf5-cli
Ruby bindings for the libdnf5-cli library.
%files -n ruby-libdnf5-cli
%{ruby_vendorarchdir}/libdnf5_cli/
%license COPYING.md
%license lgpl-2.1.txt
%endif
# ========== libdnf5-plugin-actions ==========
%if %{with plugin_actions}
%package -n libdnf5-plugin-actions
Summary: Libdnf plugin that allows to run actions (external executables) on hooks
License: LGPLv2.1+
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n libdnf5-plugin-actions
Libdnf plugin that allows to run actions (external executables) on hooks.
%files -n libdnf5-plugin-actions
%{_libdir}/libdnf5/plugins/actions.*
%endif
# ========== python3-libdnf5-plugins-loader ==========
%if %{with python_plugins_loader}
%package -n python3-libdnf5-python-plugins-loader
Summary: Libdnf plugin that allows loading Python plugins
License: LGPLv2.1+
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-libdnf5%{?_isa} = %{version}-%{release}
%description -n python3-libdnf5-python-plugins-loader
Libdnf plugin that allows loading Python plugins
%files -n python3-libdnf5-python-plugins-loader
%{_libdir}/libdnf5/plugins/python_plugins_loader.*
%{python3_sitelib}/libdnf_plugins/
%{python3_sitelib}/libdnf_plugins/README
%endif
# ========== dnf5daemon-client ==========
%if %{with dnf5daemon_client}
%package -n dnf5daemon-client
Summary: Command-line interface for dnf5daemon-server
License: GPLv2+
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libdnf5-cli%{?_isa} = %{version}-%{release}
Requires: dnf5daemon-server
%description -n dnf5daemon-client
Command-line interface for dnf5daemon-server
%files -n dnf5daemon-client
%{_bindir}/dnf5daemon-client
%license COPYING.md
%license gpl-2.0.txt
%{_mandir}/man8/dnf5daemon-client.8.gz
%endif
# ========== dnf5daemon-server ==========
%if %{with dnf5daemon_server}
%package -n dnf5daemon-server
Summary: Package management service with a DBus interface
License: GPLv2+
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libdnf5-cli%{?_isa} = %{version}-%{release}
Requires: dnf-data
%{?systemd_requires}
BuildRequires: pkgconfig(sdbus-c++) >= 0.8.1
BuildRequires: systemd-rpm-macros
%if %{with dnf5daemon_tests}
BuildRequires: dbus-daemon
BuildRequires: polkit
BuildRequires: python3-devel
BuildRequires: python3dist(dbus-python)
%endif
%description -n dnf5daemon-server
Package management service with a DBus interface
%post -n dnf5daemon-server
%systemd_post dnf5daemon-server.service
%preun -n dnf5daemon-server
%systemd_preun dnf5daemon-server.service
%postun -n dnf5daemon-server
%systemd_postun_with_restart dnf5daemon-server.service
%files -n dnf5daemon-server
%{_bindir}/dnf5daemon-server
%{_unitdir}/dnf5daemon-server.service
%{_sysconfdir}/dbus-1/system.d/org.rpm.dnf.v0.conf
%{_datadir}/dbus-1/system-services/org.rpm.dnf.v0.service
%{_datadir}/dbus-1/interfaces/org.rpm.dnf.v0.*.xml
%{_datadir}/polkit-1/actions/org.rpm.dnf.v0.policy
%license COPYING.md
%license gpl-2.0.txt
%{_mandir}/man8/dnf5daemon-server.8.gz
%{_mandir}/man8/dnf5daemon-dbus-api.8.gz
%endif
# ========== dnf5-plugins ==========
%if %{with dnf5_plugins}
%package -n dnf5-plugins
Summary: dnf5 plugins
License: LGPLv2.1+
Requires: dnf5%{?_isa} = %{version}-%{release}
%description -n dnf5-plugins
DNF5 plugins
%files -n dnf5-plugins
%{_libdir}/dnf5/plugins/*.so
%endif
# ========== unpack, build, check & install ==========
%prep
%autosetup -p1 -n dnf5-%{version}
%build
%cmake \
-DPACKAGE_VERSION=%{version} \
-DPERL_INSTALLDIRS=vendor \
\
-DWITH_DNF5DAEMON_CLIENT=%{?with_dnf5daemon_client:ON}%{!?with_dnf5daemon_client:OFF} \
-DWITH_DNF5DAEMON_SERVER=%{?with_dnf5daemon_server:ON}%{!?with_dnf5daemon_server:OFF} \
-DWITH_LIBDNF5_CLI=%{?with_libdnf_cli:ON}%{!?with_libdnf_cli:OFF} \
-DWITH_DNF5=%{?with_dnf5:ON}%{!?with_dnf5:OFF} \
-DWITH_PLUGIN_ACTIONS=%{?with_plugin_actions:ON}%{!?with_plugin_actions:OFF} \
-DWITH_PYTHON_PLUGINS_LOADER=%{?with_python_plugins_loader:ON}%{!?with_python_plugins_loader:OFF} \
\
-DWITH_COMPS=%{?with_comps:ON}%{!?with_comps:OFF} \
-DWITH_MODULEMD=%{?with_modulemd:ON}%{!?with_modulemd:OFF} \
-DWITH_ZCHUNK=%{?with_zchunk:ON}%{!?with_zchunk:OFF} \
\
-DWITH_HTML=%{?with_html:ON}%{!?with_html:OFF} \
-DWITH_MAN=%{?with_man:ON}%{!?with_man:OFF} \
\
-DWITH_GO=%{?with_go:ON}%{!?with_go:OFF} \
-DWITH_PERL5=%{?with_perl5:ON}%{!?with_perl5:OFF} \
-DWITH_PYTHON3=%{?with_python3:ON}%{!?with_python3:OFF} \
-DWITH_RUBY=%{?with_ruby:ON}%{!?with_ruby:OFF} \
\
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} \
-DWITH_TESTS=%{?with_tests:ON}%{!?with_tests:OFF} \
-DWITH_PERFORMANCE_TESTS=%{?with_performance_tests:ON}%{!?with_performance_tests:OFF} \
-DWITH_DNF5DAEMON_TESTS=%{?with_dnf5daemon_tests:ON}%{!?with_dnf5daemon_tests:OFF} \
\
-DPROJECT_VERSION_MAJOR=%{project_version_major} \
-DPROJECT_VERSION_MINOR=%{project_version_minor} \
-DPROJECT_VERSION_PATCH=%{project_version_patch}
%cmake_build
%if %{with man}
%cmake_build --target doc-man
%endif
%check
%if %{with tests}
%ctest
%endif
%install
%cmake_install
#find_lang {name}
%ldconfig_scriptlets
%changelog