File kexec-tools.spec of Package kexec-tools

# spec file for package kexec-tools
# Copyright (c) 2012 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:         %insserv_prereq %fillup_prereq
Summary:        Tools for fast kernel loading
License:        GPL-2.0+
Group:          System/Kernel
Version:        2.0.2
Release:        0
Source:         %{name}-%{version}.tar.bz2
Source1:        kexec-bootloader
Source2:        kexec-bootloader.8.txt
Source3:        kexec.init
Source4:        %{name}-%{version}-rpmlintrc
Patch0:         %{name}-no-vga-output.diff
Patch1:         %{name}-xen-static.diff
Patch2:         gcc-no-undefined-flag-fix.patch
Patch3:         kexec-fix-strncat.patch
Patch4:         kexec-tools-xen-present.diff
Patch5:         kexec-tools-xen-balloon-up.patch
Url:  {name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#!BuildIgnore:  fop
BuildRequires:  automake
BuildRequires:  zlib-devel
%if 0%{?suse_version} >= 1110
BuildRequires:  asciidoc
BuildRequires:  libxslt
%ifarch         %ix86 x86_64
BuildRequires:  xen-devel
ExclusiveArch:  %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.

    Eric Biederman <>
    Albert Herranz
    Jesse Barnes <>
    Khalid Aziz <>
    Hariprasad Nellitheertha <>
    Tim Deegan <>

%setup -q -n kexec-tools-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

# disable as-needed
%{?suse_update_config -f}
%ifarch ia64
RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-fstack-protector//')
autoreconf -f
%configure \
%ifarch ppc
        --host=powerpc64-suse-linux \
        --build=powerpc64-suse-linux \
#	--libdir=/%_lib || true
# manpage
cp %{S:1} .
cp %{S:2} .
cp %{S:3} .
%if 0%{?suse_version} >= 1110
a2x -d manpage -f manpage kexec-bootloader.8.txt

mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
install -c -m 0644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8
%if 0%{?suse_version} >= 1110
install -c -m 0644 kexec-bootloader.8 $RPM_BUILD_ROOT%{_mandir}/man8
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
install -m 0755 kexec-bootloader $RPM_BUILD_ROOT%{_sbindir}
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
install -m 0755 kexec.init ${RPM_BUILD_ROOT}/etc/init.d/kexec
mkdir -p $RPM_BUILD_ROOT/sbin
%ifarch %ix86 x86_64
mkdir -p $RPM_BUILD_ROOT/%_lib
ln -s %{_libdir}/kexec-tools $RPM_BUILD_ROOT/%_lib
ln -s %{_sbindir}/kdump $RPM_BUILD_ROOT/sbin
ln -s %{_sbindir}/kexec $RPM_BUILD_ROOT/sbin

[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%if 0%{?suse_version} >= 1110

if [ -d /%_lib/kexec-tools ];then
    rm -rf /%_lib/kexec-tools

%{fillup_and_insserv -n kexec kexec}

%if 0%{?suse_version} >= 1110

%defattr(-, root, root)
%doc %{_mandir}/man*/*
%ifarch %ix86 x86_64
%if 0%{?suse_version} >= 1110
%config /etc/init.d/kexec
%ifarch %ix86 x86_64