2007-10-14 02:35:25 +00:00
|
|
|
#
|
2011-06-07 08:49:44 +00:00
|
|
|
# spec file for package kdump
|
2007-10-14 02:35:25 +00:00
|
|
|
#
|
2014-01-13 06:43:33 +00:00
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-10-14 02:35:25 +00:00
|
|
|
#
|
2008-08-05 23:49:42 +00:00
|
|
|
# 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.
|
|
|
|
|
2007-10-14 02:35:25 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2014-02-28 19:23:14 +00:00
|
|
|
%define dracutlibdir %{_prefix}/lib/dracut
|
2014-03-28 14:03:18 +00:00
|
|
|
|
|
|
|
%{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev)}
|
|
|
|
%if "%{_udevdir}" == ""
|
2014-03-28 13:51:14 +00:00
|
|
|
%if 0%{?suse_version} >= 1230
|
2014-03-28 14:03:18 +00:00
|
|
|
%global _udevdir /usr/lib/udev
|
2014-03-28 13:51:14 +00:00
|
|
|
%else
|
2014-03-28 14:03:18 +00:00
|
|
|
%global _udevdir /lib/udev
|
|
|
|
%endif
|
2014-03-28 13:51:14 +00:00
|
|
|
%endif
|
2014-03-28 14:03:18 +00:00
|
|
|
%define _udevrulesdir %{_udevdir}/rules.d
|
2014-02-28 19:23:14 +00:00
|
|
|
|
2014-05-16 17:54:17 +00:00
|
|
|
Url: https://github.com/ptesarik/kdump
|
2008-02-21 00:55:05 +00:00
|
|
|
|
2007-10-14 02:35:25 +00:00
|
|
|
Name: kdump
|
2014-07-04 11:34:59 +00:00
|
|
|
Version: 0.8.15
|
2012-03-21 10:42:35 +00:00
|
|
|
Release: 0
|
|
|
|
Requires: curl
|
|
|
|
Requires: makedumpfile
|
|
|
|
Requires: openssh
|
2007-10-14 02:35:25 +00:00
|
|
|
Summary: Script for kdump
|
2012-03-21 10:42:35 +00:00
|
|
|
License: GPL-2.0+
|
2007-10-14 02:35:25 +00:00
|
|
|
Group: System/Kernel
|
2012-03-21 10:42:35 +00:00
|
|
|
BuildRequires: asciidoc
|
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: libcurl-devel
|
2014-01-13 06:43:33 +00:00
|
|
|
BuildRequires: libelf-devel
|
2008-08-08 00:09:19 +00:00
|
|
|
BuildRequires: libesmtp-devel
|
2013-01-02 15:48:49 +00:00
|
|
|
BuildRequires: libopenssl-devel
|
2014-03-28 13:16:19 +00:00
|
|
|
BuildRequires: libssh2-devel
|
2012-03-21 10:42:35 +00:00
|
|
|
BuildRequires: libxslt
|
2014-03-28 13:23:57 +00:00
|
|
|
BuildRequires: pkg-config
|
2014-03-28 13:16:19 +00:00
|
|
|
BuildRequires: udev
|
2012-03-21 10:42:35 +00:00
|
|
|
BuildRequires: zlib-devel
|
2008-12-15 13:47:09 +00:00
|
|
|
#!BuildIgnore: fop
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
BuildRequires: systemd
|
|
|
|
%endif
|
2014-07-04 12:00:43 +00:00
|
|
|
PreReq: %insserv_prereq %fillup_prereq
|
|
|
|
%if 0%{?suse_version} > 1310
|
|
|
|
PreReq: dracut
|
|
|
|
%else
|
|
|
|
PreReq: mkinitrd
|
|
|
|
%endif
|
2007-10-14 02:35:25 +00:00
|
|
|
Source: %{name}-%{version}.tar.bz2
|
2014-06-16 10:59:01 +00:00
|
|
|
Source2: %{name}-rpmlintrc
|
2013-09-05 12:03:56 +00:00
|
|
|
Source3: kdump.service
|
2014-09-02 09:17:02 +00:00
|
|
|
Patch0: 0001-multipath-Write-proper-regex-into-multipath-conf.patch
|
2014-09-05 12:07:14 +00:00
|
|
|
Patch1: %{name}-use-fstab-device.patch
|
2007-10-14 02:35:25 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
# rename "kdump-helpers" (10.3) -> "kdump" (11.0/SP2)
|
2013-01-02 16:37:27 +00:00
|
|
|
Provides: kdump-helpers = %{version}
|
|
|
|
Obsoletes: kdump-helpers < %{version}
|
2007-10-14 02:35:25 +00:00
|
|
|
# update should detect the split-off from kexec-tools
|
|
|
|
Provides: kexec-tools:/etc/init.d/kdump
|
2008-01-10 00:55:43 +00:00
|
|
|
Requires: kexec-tools
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
%systemd_requires
|
|
|
|
%endif
|
2012-10-26 15:55:05 +00:00
|
|
|
Recommends: nfs-client cifs-utils
|
2007-11-06 21:27:49 +00:00
|
|
|
PreReq: coreutils sed
|
2014-02-13 15:48:18 +00:00
|
|
|
ExcludeArch: s390 ppc
|
2007-10-14 02:35:25 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
kdump is a package that includes several scripts for kdump, including
|
|
|
|
the init script /etc/init.d/kdump and the configuration file for kdump.
|
|
|
|
|
2011-06-07 08:49:31 +00:00
|
|
|
The kernel package and this package are all that are required for a
|
|
|
|
crash dump to occur. However, if you wish to debug the crash dump
|
|
|
|
yourself you will need several debugging packages installed for each
|
|
|
|
kernel flavor and release you wish to debug.
|
2007-10-14 02:35:25 +00:00
|
|
|
|
2011-06-07 08:49:31 +00:00
|
|
|
For example, if you are debugging kernel-default, you will need:
|
|
|
|
- kernel-default-debuginfo
|
|
|
|
- kernel-default-devel
|
|
|
|
- kernel-default-devel-debuginfo
|
|
|
|
|
|
|
|
These packages are not needed to create the dump and can be installed
|
|
|
|
after a crash dump has occured.
|
2007-10-14 02:35:25 +00:00
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Bernhard Walle <bwalle@suse.de>
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup
|
2014-09-02 09:17:02 +00:00
|
|
|
%patch0 -p1
|
2014-09-05 12:07:14 +00:00
|
|
|
%patch1 -p1
|
2014-02-14 16:18:09 +00:00
|
|
|
|
2007-10-14 02:35:25 +00:00
|
|
|
%build
|
2008-09-05 21:28:43 +00:00
|
|
|
export CFLAGS="%optflags"
|
|
|
|
export CXXFLAGS="%optflags"
|
2008-07-24 23:08:46 +00:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} ..
|
2008-10-13 21:23:44 +00:00
|
|
|
make
|
2008-07-24 23:08:46 +00:00
|
|
|
cd -
|
2007-10-14 02:35:25 +00:00
|
|
|
|
2014-03-27 16:04:52 +00:00
|
|
|
%check
|
|
|
|
cd build
|
|
|
|
make test
|
|
|
|
|
2007-10-14 02:35:25 +00:00
|
|
|
%install
|
2008-07-24 23:08:46 +00:00
|
|
|
cd build
|
2007-10-14 02:35:25 +00:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
2008-07-24 23:08:46 +00:00
|
|
|
cd -
|
2014-03-28 12:52:01 +00:00
|
|
|
# move udev rules
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_udevrulesdir}
|
|
|
|
mv $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/* $RPM_BUILD_ROOT/%{_udevrulesdir}/
|
2014-03-28 13:09:25 +00:00
|
|
|
# remove executable bit from non-binaries
|
|
|
|
chmod -x $RPM_BUILD_ROOT/lib/kdump/setup-kdump.functions
|
2007-10-14 02:35:25 +00:00
|
|
|
# symlink for init script
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/sbin
|
2008-08-15 22:14:11 +00:00
|
|
|
ln -s /etc/init.d/boot.kdump $RPM_BUILD_ROOT/sbin/rckdump
|
2008-08-22 22:48:34 +00:00
|
|
|
# empty directory
|
|
|
|
mkdir $RPM_BUILD_ROOT/var/crash
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1310
|
|
|
|
rm -r $RPM_BUILD_ROOT/lib/mkinitrd
|
|
|
|
%endif
|
2007-10-14 02:35:25 +00:00
|
|
|
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
|
|
|
install -m644 %{S:3} $RPM_BUILD_ROOT%{_unitdir}
|
|
|
|
%endif
|
|
|
|
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
%pre
|
|
|
|
%service_add_pre kdump.service
|
|
|
|
%endif
|
|
|
|
|
2007-10-14 02:35:25 +00:00
|
|
|
%post
|
2008-10-22 16:08:54 +00:00
|
|
|
# change only permission if the file exists before /etc/sysconfig/kdump
|
|
|
|
# has been created from /var/adm/fillup-templates/sysconfig.kdump
|
|
|
|
change_permission=0
|
|
|
|
if [ ! -f /etc/sysconfig/kdump ] ; then
|
|
|
|
change_permission=1
|
|
|
|
fi
|
2008-08-15 22:14:11 +00:00
|
|
|
%{fillup_and_insserv -n kdump boot.kdump}
|
2008-10-22 16:08:54 +00:00
|
|
|
if (( $change_permission )) ; then
|
|
|
|
chmod 0600 /etc/sysconfig/kdump
|
|
|
|
fi
|
2008-08-22 22:48:34 +00:00
|
|
|
# if /var/log/dump is empty, make it a symlink to /var/crash
|
|
|
|
if test -d /var/log/dump && rmdir /var/log/dump &>/dev/null ||
|
|
|
|
! test -d /var/log/dump ; then
|
2008-10-28 17:03:03 +00:00
|
|
|
ln -snf /var/crash /var/log/dump
|
2008-08-22 22:48:34 +00:00
|
|
|
fi
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
%service_add_post kdump.service
|
|
|
|
%endif
|
2007-10-14 02:35:25 +00:00
|
|
|
|
|
|
|
%preun
|
2008-11-11 15:10:10 +00:00
|
|
|
echo "Stopping kdump ..."
|
2008-08-15 22:14:11 +00:00
|
|
|
%stop_on_removal boot.kdump
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
%service_del_preun kdump.service
|
|
|
|
%endif
|
2007-10-14 02:35:25 +00:00
|
|
|
|
|
|
|
%postun
|
2008-11-20 15:45:01 +00:00
|
|
|
# force regeneration of kdumprd
|
|
|
|
touch /etc/sysconfig/kdump
|
2008-08-22 22:48:34 +00:00
|
|
|
# delete symbolic link
|
|
|
|
rm /var/log/dump &>/dev/null || true
|
2008-11-20 15:45:01 +00:00
|
|
|
%restart_on_update boot.kdump
|
|
|
|
%insserv_cleanup
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
%service_del_postun kdump.service
|
|
|
|
%endif
|
2007-10-14 02:35:25 +00:00
|
|
|
|
|
|
|
%clean
|
2008-10-28 17:03:03 +00:00
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2007-10-14 02:35:25 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2008-07-24 23:08:46 +00:00
|
|
|
%doc ChangeLog COPYING README NEWS
|
|
|
|
%{_sbindir}/kdumptool
|
|
|
|
%{_sbindir}/mkdumprd
|
2013-09-13 11:03:38 +00:00
|
|
|
%{_sbindir}/kdump-bootloader.pl
|
2008-07-24 23:08:46 +00:00
|
|
|
%{_mandir}/man5/kdump.5.gz
|
2008-08-09 23:22:19 +00:00
|
|
|
%{_mandir}/man7/kdump.7.gz
|
2008-07-24 23:08:46 +00:00
|
|
|
%{_mandir}/man8/kdumptool.8.gz
|
|
|
|
%{_mandir}/man8/mkdumprd.8.gz
|
2007-10-14 02:35:25 +00:00
|
|
|
/sbin/rckdump
|
2008-08-15 22:14:11 +00:00
|
|
|
%{_sysconfdir}/init.d/boot.kdump
|
2007-10-14 02:35:25 +00:00
|
|
|
/var/adm/fillup-templates/sysconfig.kdump
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} <= 1310
|
2008-07-24 23:08:46 +00:00
|
|
|
/lib/mkinitrd/scripts/*-kdump.sh
|
2013-01-02 15:48:49 +00:00
|
|
|
/lib/mkinitrd/scripts/setup-kdumpfs.sh
|
|
|
|
/lib/mkinitrd/scripts/setup-mkdumprd.sh
|
2014-07-04 12:00:43 +00:00
|
|
|
%endif
|
2014-02-28 19:28:53 +00:00
|
|
|
%dir %{dracutlibdir}
|
|
|
|
%dir %{dracutlibdir}/modules.d
|
2014-03-02 15:35:45 +00:00
|
|
|
%{dracutlibdir}/modules.d/99kdump/
|
2013-09-13 11:03:38 +00:00
|
|
|
%dir /lib/kdump
|
|
|
|
/lib/kdump/*
|
2014-03-28 12:52:01 +00:00
|
|
|
%{_udevrulesdir}/70-kdump.rules
|
2014-07-04 12:00:43 +00:00
|
|
|
%if 0%{?suse_version} > 1220
|
2013-09-05 12:03:56 +00:00
|
|
|
%{_unitdir}/kdump.service
|
|
|
|
%endif
|
2007-12-12 20:11:02 +00:00
|
|
|
|
2007-10-14 02:35:25 +00:00
|
|
|
%changelog
|