Skip to content

Commit

Permalink
tools/cockpit.spec: Adjust storaged/udisks2 dependency
Browse files Browse the repository at this point in the history
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
Reviewed-by: Stef Walter <stefw@redhat.com>
  • Loading branch information
martinpitt authored and stefwalter committed Oct 16, 2017
1 parent 58e857a commit fbaff63
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
3 changes: 2 additions & 1 deletion bots/images/scripts/lib/fedora.install
Expand Up @@ -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
Expand Down
37 changes: 32 additions & 5 deletions tools/cockpit.spec
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit fbaff63

Please sign in to comment.