Skip to content

Commit fbaff63

Browse files
martinpittstefwalter
authored andcommitted
tools/cockpit.spec: Adjust storaged/udisks2 dependency
Adjust the target OS specific dependencies of cockpit-storaged: * RHEL 7.4 and current CentOS 7 ship storaged and do not support Recommends:. * RHEL = 7.5 will only ship udisks2, which does (rightfully) not provide storaged. Still no support for Recommends:. * RHEL 8 will only ship udisks2, but does support Recommends: * Fedora 27 also moved to udisks2, earlier versions have storaged. All supported Fedora releases support Recommends:. Standard RPM macros do not allow us to differentiate between RHEL 7.4 and 7.5 (%rhel == 7), so check /etc/os-release for that. This works for "real-life" builds, but not for building on our test images as these use a CentOS 7 mock chroot for all RHEL builds. Thus do the os-release parsing in fedora.install and pass on the value as define. The udisks2 modules for lvm2 and iscsi are not yet available on RHEL 7.5, so skip these dependencies for now. Closes cockpit-project#7886 Reviewed-by: Stef Walter <[email protected]>
1 parent 58e857a commit fbaff63

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

bots/images/scripts/lib/fedora.install

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ fi
1212

1313
do_build=
1414
do_install=
15-
mock_opts=""
15+
# we build RHEL 7.x in a CentOS mock, thus we can't parse os-release in the .spec
16+
mock_opts="--define='os_version_id $(. /etc/os-release; echo $VERSION_ID)'"
1617
args=$(getopt -o "vqs:" -l "verbose,quick,skip:,build,install,rhel,HACK-no-bootstrap-chroot" -- "$@")
1718
eval set -- "$args"
1819
while [ $# -gt 0 ]; do

tools/cockpit.spec

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
%define rhel 0
2121
%endif
2222

23+
# for testing this already gets set in fedora.install, as we want the target
24+
# VERSION_ID, not the mock chroot's one
25+
%if "%{!?os_version_id:1}"
26+
%define os_version_id %(. /etc/os-release; echo $VERSION_ID)
27+
%endif
28+
2329
%define _hardened_build 1
2430

2531
# define to build the dashboard
@@ -406,18 +412,39 @@ fi
406412
%endif
407413
%endif
408414

415+
# storaged on RHEL 7.4 and Fedora < 27, udisks on newer ones
416+
# Recommends: not supported in RHEL < 8
409417
%package storaged
410418
Summary: Cockpit user interface for storage, using Storaged
411419
Requires: %{name}-shell >= %{required_base}
420+
%if (0%{?rhel} == 7 && "%{os_version_id}" == "7.4") || 0%{?centos} == 7
412421
Requires: storaged >= 2.1.1
413-
%if 0%{?fedora} >= 24 || 0%{?rhel} >= 8
414-
Recommends: storaged-lvm2 >= 2.1.1
415-
Recommends: storaged-iscsi >= 2.1.1
416-
Recommends: device-mapper-multipath
417-
%else
418422
Requires: storaged-lvm2 >= 2.1.1
419423
Requires: storaged-iscsi >= 2.1.1
420424
Requires: device-mapper-multipath
425+
%else
426+
%if 0%{?rhel} == 7
427+
Requires: udisks2 >= 2.6
428+
# FIXME: udisks2 modules not yet available on 7.5
429+
%if "%{os_version_id}" != "7.5"
430+
Requires: udisks2-lvm2 >= 2.6
431+
Requires: udisks2-iscsi >= 2.6
432+
%endif
433+
Requires: device-mapper-multipath
434+
%else
435+
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
436+
Requires: udisks2 >= 2.6
437+
Recommends: udisks2-lvm2 >= 2.6
438+
Recommends: udisks2-iscsi >= 2.6
439+
Recommends: device-mapper-multipath
440+
%else
441+
# Fedora < 27
442+
Requires: storaged >= 2.1.1
443+
Recommends: storaged-lvm2 >= 2.1.1
444+
Recommends: storaged-iscsi >= 2.1.1
445+
Recommends: device-mapper-multipath
446+
%endif
447+
%endif
421448
%endif
422449
BuildArch: noarch
423450

0 commit comments

Comments
 (0)