File kernel-livepatch-SLE15_Update_2.spec of Package kernel-livepatch-SLE15_Update_2.8541

#
# spec file for package Kernel live patch module
#
# Copyright (c) 2014 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

Name:           kernel-livepatch-SLE15_Update_2
Version:        3
Release:        1
%define module_num %(echo %version-%release | sed 'y/\./_/')
License:        GPL-2.0
Summary:        Kernel live patch module
Group:          System/Kernel
Source0:	uname_patch.tar.bz2
Source1:	Makefile
Source2:        livepatch_main.c
Source3:        config.sh
Source4:        source-timestamp
Source5:        shadow.h
Source6:        kallsyms_relocs.h
Source7:        kallsyms_relocs.c
# Auto expanded KLP_PATCHES_SOURCES:
Source8:	bsc1097108.tar.bz2
Source9:	bsc1099306.tar.bz2
Source10:	bsc1105026.tar.bz2
BuildRequires:  kernel-syms kernel-livepatch-tools-devel libelf-devel
ExclusiveArch:	ppc64le x86_64
%klp_module_package

%description
This is a live patch for SUSE Linux Enterprise Server kernel.

Source timestamp: 2018-08-23 11:33:28 +0000
GIT Revision: 26a55ed5c2dda84be50aef2083bffba2dee20f77
GIT Branch: SLE15_Update_2

%prep
%setup -c
# Auto expanded KLP_PATCHES_SETUP_SOURCES:
%setup -T -D -a 8 -a 9 -a 10
cp %_sourcedir/livepatch_main.c .
cp %_sourcedir/shadow.h .
cp %_sourcedir/kallsyms_relocs.h .
cp %_sourcedir/kallsyms_relocs.c .
cp %_sourcedir/Makefile .

%build
sed -i 's/@@RPMRELEASE@@/%module_num/g' Makefile
sed -i 's/@@RPMRELEASE@@/%module_num/g' livepatch_main.c
echo 'livepatch-%module_num' >Module.supported
set -- *

commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
sed -i "s/@@GITREV@@/${commit:0:7}/g" uname_patch/livepatch_uname.c

for flavor in %flavors_to_build; do
	mkdir -p "obj/$flavor"
	cp -r "$@" "obj/$flavor"
	make -C %{kernel_source $flavor} M="$PWD/obj/$flavor" modules
done

%install
export INSTALL_MOD_DIR=livepatch
export INSTALL_MOD_PATH=%buildroot
for flavor in %flavors_to_build; do
	make -C %{kernel_source $flavor} M="$PWD/obj/$flavor" modules_install
done

%changelog