diff --git a/bots/images/scripts/lib/fedora.install b/bots/images/scripts/lib/fedora.install index 27c950d1f09..f623d9b9e40 100755 --- a/bots/images/scripts/lib/fedora.install +++ b/bots/images/scripts/lib/fedora.install @@ -12,7 +12,8 @@ fi do_build= do_install= -mock_opts="" +# we build RHEL 7.x in a CentOS mock, thus we can't parse os-release in the .spec +mock_opts="--define='os_version_id $(. /etc/os-release; echo $VERSION_ID)'" args=$(getopt -o "vqs:" -l "verbose,quick,skip:,build,install,rhel,HACK-no-bootstrap-chroot" -- "$@") eval set -- "$args" while [ $# -gt 0 ]; do diff --git a/tools/cockpit.spec b/tools/cockpit.spec index de46a6f8ea0..4ae6e8fde0b 100644 --- a/tools/cockpit.spec +++ b/tools/cockpit.spec @@ -20,6 +20,12 @@ %define rhel 0 %endif +# for testing this already gets set in fedora.install, as we want the target +# VERSION_ID, not the mock chroot's one +%if "%{!?os_version_id:1}" +%define os_version_id %(. /etc/os-release; echo $VERSION_ID) +%endif + %define _hardened_build 1 # define to build the dashboard @@ -406,18 +412,39 @@ fi %endif %endif +# storaged on RHEL 7.4 and Fedora < 27, udisks on newer ones +# Recommends: not supported in RHEL < 8 %package storaged Summary: Cockpit user interface for storage, using Storaged Requires: %{name}-shell >= %{required_base} +%if (0%{?rhel} == 7 && "%{os_version_id}" == "7.4") || 0%{?centos} == 7 Requires: storaged >= 2.1.1 -%if 0%{?fedora} >= 24 || 0%{?rhel} >= 8 -Recommends: storaged-lvm2 >= 2.1.1 -Recommends: storaged-iscsi >= 2.1.1 -Recommends: device-mapper-multipath -%else Requires: storaged-lvm2 >= 2.1.1 Requires: storaged-iscsi >= 2.1.1 Requires: device-mapper-multipath +%else +%if 0%{?rhel} == 7 +Requires: udisks2 >= 2.6 +# FIXME: udisks2 modules not yet available on 7.5 +%if "%{os_version_id}" != "7.5" +Requires: udisks2-lvm2 >= 2.6 +Requires: udisks2-iscsi >= 2.6 +%endif +Requires: device-mapper-multipath +%else +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: udisks2 >= 2.6 +Recommends: udisks2-lvm2 >= 2.6 +Recommends: udisks2-iscsi >= 2.6 +Recommends: device-mapper-multipath +%else +# Fedora < 27 +Requires: storaged >= 2.1.1 +Recommends: storaged-lvm2 >= 2.1.1 +Recommends: storaged-iscsi >= 2.1.1 +Recommends: device-mapper-multipath +%endif +%endif %endif BuildArch: noarch