From 2993c443cd7d1b4a15e5dccc34c2043643c7e4be Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 15 Oct 2017 16:48:23 +0200 Subject: [PATCH] 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 #7886 --- bots/images/scripts/lib/fedora.install | 3 ++- tools/cockpit.spec | 37 ++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) 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