File cluster-network.spec of Package cluster-network.7558

#
# spec file for package cluster-network
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


# needssslcertforbuild

%ifarch x86_64
%define buildrt 1
%endif

Url:            http://www.kernel.org/

Name:           cluster-network
BuildRequires:  kernel-syms
BuildRequires:  module-init-tools
%if 0%{?buildrt} == 1
BuildRequires:  kernel-syms-rt
BuildRequires:  kernel-source-rt
%endif
BuildRequires:  kernel-source
Summary:        IP Virtual Server kernel modules
License:        GPL-2.0
Group:          System/Kernel
Version:        1.4
Release:        0
Source1:        Module.supported
Source2:        Makefile.ipt_CLUSTERIP
Source3:        Makefile.xt_ipvs
Source4:        preamble
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExcludeArch:    i586 s390
%kernel_module_package -p %_sourcedir/preamble

%description
This package contains kernel modules for IP Virtual Server and the
CLUSTERIP netfilter target module.



%prep
%setup -Tc

%build
for flavor in %flavors_to_build; do
    mkdir -p $flavor/ipvs
    source=/lib/modules/$(make -sC %{kernel_source $flavor} kernelrelease)/source
    ipvs_path=$source/net/ipv4/ipvs
    if ! test -d "$ipvs_path"; then
        ipvs_path=$source/net/netfilter/ipvs
    fi
    if ! test -d "$ipvs_path"; then
        echo "Cannot find ipvs source" >&2
        exit 1
    fi
    cp -a %_sourcedir/Module.supported "$ipvs_path"/* \
        $flavor/ipvs/
    make -C %{kernel_source $flavor} modules M=$PWD/$flavor/ipvs
    mkdir -p $flavor/netfilter
    cp -a %_sourcedir/Module.supported $source/net/ipv4/netfilter/* \
        $flavor/netfilter
    cp %_sourcedir/Makefile.ipt_CLUSTERIP $flavor/netfilter/Makefile
    make -C %{kernel_source $flavor} modules M=$PWD/$flavor/netfilter
    mkdir -p $flavor/net/netfilter
    cp -a %_sourcedir/Module.supported $source/net/netfilter/xt_ipvs.c \
        $flavor/net/netfilter
    cp %_sourcedir/Makefile.xt_ipvs $flavor/net/netfilter/Makefile
    make -C %{kernel_source $flavor} modules M=$PWD/$flavor/net/netfilter
done

%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
for flavor in %flavors_to_build; do
    export INSTALL_MOD_DIR=updates/ipvs
    make -C %{kernel_source $flavor} modules_install \
        M=$PWD/$flavor/ipvs
    export INSTALL_MOD_DIR=updates/netfilter
    make -C %{kernel_source $flavor} modules_install \
        M=$PWD/$flavor/netfilter
    make -C %{kernel_source $flavor} modules_install \
        M=$PWD/$flavor/net/netfilter
done

%changelog
openSUSE Build Service is sponsored by