File kexec-tools.spec of Package kexec-tools

#
# spec file for package kexec-tools (Version 2.0.0)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           kexec-tools
%ifarch ppc
BuildRequires:  gcc-64bit glibc-devel-64bit
%endif
License:        GPL v2 or later
Group:          System/Kernel
Requires:       perl-Bootloader
PreReq:         %insserv_prereq %fillup_prereq
AutoReqProv:    on
Summary:        Tools for fast kernel loading
Version:        2.0.0
Release:        56
Source:         %{name}-%{version}.tar.bz2
Source1:        kexec-bootloader
Source2:        kexec-bootloader.8.txt
Source3:        kexec.init
Source4:        %{name}-%{version}-rpmlintrc
Patch0:         %{name}-ia64-uncached-memory.diff
Patch1:         %{name}-ia64-PA.diff
Patch2:         %{name}-build-warnings.diff
Patch3:         %{name}-ppc64-build-warnings.diff
Patch4:         %{name}-ppc64-IBM-QS2x-blades.diff
Patch5:         %{name}-ia64-kdump-PT_LOAD-order.diff
Patch6:         %{name}-crash-memory-ranges-drconf.diff
Patch7:         %{name}-add-usable-drconf-memory-node-to-device-tree.diff
Patch8:         %{name}-get-details-dynamic-reconfiguration-memory-node.diff
Patch9:         %{name}-device-tree-return.diff
Patch10:        %{name}-ppc-check-flags.diff
Patch11:        %{name}-no-vga-output.diff
Patch12:        %{name}-spell.diff
Patch13:        %{name}-xen-static.diff
Patch14:        %{name}-proc-iomem-xen.diff
Patch15:        %{name}-parse-iomem-single-warning.diff
Patch16:        %{name}-exclude-gart.diff
Patch17:        %{name}-ppc64-memory-ranges-dynamic.diff
Patch18:        %{name}-ppc64-dynamic-fix-1.diff
Patch19:        %{name}-ppc64-dynamic-fix-2.diff
Patch20:        %{name}-ppc64-dynamic-fix-3.diff
Patch21:        %{name}-ppc64-reinit.diff
Patch22:        %{name}-increase-kernel-text-size.diff
Url:            http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#!BuildIgnore:  fop
BuildRequires:  zlib-devel
%if 0%{?suse_version} >= 1110
BuildRequires:  asciidoc libxslt
%endif
%ifarch         %ix86 x86_64
BuildRequires:  xen-devel
%endif

%description
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.



Authors:
--------
    Eric Biederman <ebiederm@xmission.com>
    Albert Herranz
    Jesse Barnes <jbarnes@sgi.com>
    Khalid Aziz <khalid.aziz@hp.com>
    Hariprasad Nellitheertha <hari@in.ibm.com>
    Tim Deegan <tjd21@cl.cam.ac.uk>

%prep
%setup -q -n kexec-tools-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1

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

%install
make DESTDIR=$RPM_BUILD_ROOT install
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
%endif

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

%post
%{fillup_and_insserv -n kexec kexec}
%endif
#
#%preun

%postun
%if 0%{?suse_version} >= 1110
%insserv_cleanup
%endif

%files
%defattr(-, root, root)
%doc AUTHORS COPYING News TODO doc
%doc %{_mandir}/man*/*
/sbin/*
%if 0%{?suse_version} >= 1110
%{_sbindir}/kexec-bootloader
/etc/init.d/kexec
%config /etc/init.d/kexec
%endif
%ifarch %ix86 x86_64
/%_lib/kexec-tools*
%endif

%changelog
openSUSE Build Service is sponsored by