File kexec-tools.spec of Package kexec-tools

# spec file for package kexec-tools
# 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

Name:           kexec-tools
%ifarch ppc
BuildRequires:  gcc-64bit
BuildRequires:  glibc-devel-64bit
Requires:       perl-Bootloader
PreReq:         %fillup_prereq
Summary:        Tools for fast kernel loading
License:        GPL-2.0+
Group:          System/Kernel
Version:        2.0.5
Release:        0
Source1:        kexec-bootloader
Source2:        kexec-bootloader.8.txt
Source3:        kexec-load.service
Source4:        %{name}-rpmlintrc
Patch1:         %{name}-xen-static.patch
Patch2:         %{name}-xen-balloon-up.patch
Patch3:         %{name}-disable-test.patch
Patch4:         %{name}-enable-aarch64.patch
Patch5:         %{name}-xen-e820-redefinition.patch
Patch6:         %{name}-enable-aarch64-fixup.patch
Patch7:         %{name}-i386-bzimage_efi.patch
Patch8:         %{name}-ppc64-purgatory-disabling-gcc-stack-protection.patch
Patch9:         %{name}-zero-efi-info.patch
Patch10:        %{name}-fs2dt-fix-endianess-issue-with-initrd-base-and-size.patch
Patch11:        %{name}-ppc64-purgatory-device-tree-values-should-be-read-stored-in-big-endian.patch
Patch12:        %{name}-kdump-fix-elf-header-endianess.patch
# SLE12 ONLY patches
Patch100:       %{name}-set-mmconf-reserved.patch
Url:  {name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#!BuildIgnore:  fop
BuildRequires:  asciidoc
BuildRequires:  automake
BuildRequires:  libxslt
BuildRequires:  zlib-devel
%ifarch         x86_64
BuildRequires:  xen-devel
ExclusiveArch:  ppc64le aarch64 %ix86 x86_64 ia64 ppc ppc64 s390 s390x %arm sh mips mipsel

Kexec is a user space utility for loading another kernel and asking the
currently running kernel to do something with it. A currently running
kernel may be asked to start the loaded kernel on reboot, or to start
the loaded kernel after it panics.

%setup -q -n kexec-tools-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch100 -p1

# disable as-needed
%{?suse_update_config -f}
%ifarch ia64 ppc64le
RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-fstack-protector//')
autoreconf -f
%ifarch ppc
%configure --host=powerpc64-suse-linux --build=powerpc64-suse-linux 
a2x -D . -d manpage -f manpage %{S:2}

install -c -m 0644 kexec-bootloader.8 $RPM_BUILD_ROOT%{_mandir}/man8
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/kdump.8
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
install -m 0755 %{S:1} $RPM_BUILD_ROOT%{_sbindir}
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -m644 %{S:3} $RPM_BUILD_ROOT%{_unitdir}
mkdir -p $RPM_BUILD_ROOT/sbin
ln -s %{_sbindir}/kdump $RPM_BUILD_ROOT/sbin
ln -s %{_sbindir}/kexec $RPM_BUILD_ROOT/sbin

[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%service_add_post kexec-load.service

%service_del_postun kexec-load.service

%service_add_pre kexec-load.service

%service_del_preun kexec-load.service

%defattr(-, root, root)
%doc %{_mandir}/man*/*

openSUSE Build Service is sponsored by