makedumpfile/makedumpfile.spec

116 lines
3.1 KiB
RPMSpec
Raw Normal View History

#
# spec file for package makedumpfile
#
# 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/
#
%if 0%{!?have_snappy:1}
%if 0%{?suse_version} >= 1310
%define have_snappy 1
%else
%define have_snappy 0
%endif
%endif
Name: makedumpfile
BuildRequires: libdw-devel
BuildRequires: libebl-devel
BuildRequires: libelf-devel
BuildRequires: zlib-devel
%if 0%{?suse_version} >= 1140 || 0%{?sles_version} >= 11
BuildRequires: libbz2-devel
%else
BuildRequires: bzip2
%endif
BuildRequires: lzo-devel
%if %{have_snappy}
BuildRequires: snappy-devel
%endif
BuildRequires: xz-devel
Version: 1.5.5
Release: 0
Summary: Partial kernel dump
License: GPL-2.0
Group: System/Kernel
Url: https://sourceforge.net/projects/makedumpfile/
Source: %{name}-%{version}.tar.bz2
Source1: README.static
Patch0: %{name}-coptflags.diff
Patch1: %{name}-fix-sprintf-append.patch
Patch2: %{name}-kernel-3.12-supported.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64 ia64 ppc ppc64 ppc64le s390x %arm
%description
makedumpfile is a dump program to shorten the size of dump file. It
copies only the necessary pages for analysis with various dump levels,
and can compress the page data. The obtained dump file can by analyzed
via gdb or crash utility.
Authors:
--------
NEC Corporation
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
LIBS_STATIC=
LIBS_DYNAMIC=
if nm -u -f posix %{_libdir}/libdw.a | grep '^BZ2_bzDecompress U'; then
if [ -e %{_libdir}/libbz2.a ]; then
LIBS_STATIC="$LIBS_STATIC -lbz2"
else
LIBS_DYNAMIC="$LIBS_DYNAMIC -lbz2"
fi
fi
if nm -u -f posix %{_libdir}/libdw.a | grep '^lzma_code U'; then
if [ -e %{_libdir}/liblzma.a ]; then
LIBS_STATIC="$LIBS_STATIC -llzma"
else
LIBS_DYNAMIC="$LIBS_DYNAMIC -llzma"
fi
fi
export LIBS_STATIC LIBS_DYNAMIC
%if %{have_snappy}
export USESNAPPY=on
%endif
make COPTFLAGS="$RPM_OPT_FLAGS" USELZO=on
%install
mkdir -p $RPM_BUILD_ROOT/bin
install -c -m 0755 makedumpfile $RPM_BUILD_ROOT/bin
install -c -m 0755 makedumpfile-R.pl $RPM_BUILD_ROOT/bin
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man5
install -c -m 0644 makedumpfile.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -c -m 0644 makedumpfile.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README COPYING IMPLEMENTATION
%doc %{_mandir}/man?/*
/bin/*
%changelog