From: Manuel Buil Date: Fri, 9 Feb 2018 16:04:39 +0000 (+0100) Subject: Add support for openSUSE in the RPM spec X-Git-Tag: 14.2.0~84 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=7e66f116e37fb96d2ec8e71930f9cf8d878f559e;p=integration%2Fpackaging.git Add support for openSUSE in the RPM spec openSUSE support is required to run ODL in XCI-OPNFV. RPM installs in openSUSE fail because the dependencies listed in the spec file have different names. Conditionally require the right names based on OS. Change-Id: Idafe9a3656820f96553c2e4d53c1c15c992d681c Signed-off-by: Manuel Buil --- diff --git a/packages/rpm/specs/opendaylight.spec b/packages/rpm/specs/opendaylight.spec index ecafdc3..c43e23b 100644 --- a/packages/rpm/specs/opendaylight.spec +++ b/packages/rpm/specs/opendaylight.spec @@ -17,10 +17,27 @@ URL: http://www.opendaylight.org Source0: %name-{{ version_major }}.{{ version_minor }}.{{ version_patch }}-{{ pkg_version }}.tar.gz Source1: %name-{{ sysd_commit }}.service.tar.gz Buildroot: /tmp + + +# This spec can be shared by Red Hat and SUSE based OS. The only difference is +# the name of the dependent packages. Depending on the distro, we use one name +# or another. For example, shadow-utils for RH and shadow for SUSE +%if 0%{?rhel} # Required for ODL at run time Requires: java >= 1:1.{{ java_version }}.0 # Required for creating odl group Requires(pre): shadow-utils +%else +%if 0%{?suse_version} +# Required for ODL at run time +Requires: java >= 1.{{ java_version }}.0 +# Required for creating odl group +Requires(pre): shadow +%else +echo "Your OS is not supported" +exit 1 +%endif% +%endif% # Required for configuring systemd BuildRequires: systemd