File mce-test.spec of Package mce-test

#
# spec file for package mce-test (Version 0.1)
#
# 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:           mce-test
BuildRequires:  glibc-devel 
License:        LGPL v2.1 or later
Group:          Development/Hardware
Summary:        Simulate/test Machine Check Exceptions (MCEs)
Version:        0.1.20091225
Release:        1
Url:            http://git.kernel.org/?p=utils/cpu/mce/mce-test.git;a=summary
Requires:       mce-inject
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define my_make_flags destdir=$RPM_BUILD_ROOT CFLAGS="$RPM_OPT_FLAGS -g"
Source0:        %{name}-%{version}.tar.bz2
Patch0:         fix_compiler_warnings.patch
Patch1:         fix_shebang.patch
ExclusiveArch:  %ix86 x86_64 ia64

%description
Offers the possibility to test Machine Check Exceptions(MCE)
for debugging and testing purposes of MCEs.
Related packages: mce-inject and mcelog

Authors:
--------
   Andi Kleen
   Ying Huang
    

%prep
%setup %name
%patch0 -p1
%patch1 -p1

%build
%{my_make_flags} make
%{my_make_flags} make -C tools/simple_process

%install

inst_dir=$RPM_BUILD_ROOT/usr/share/%name
mkdir -p ${inst_dir}
mkdir -p ${inst_dir}/results
mkdir -p ${inst_dir}/stress
mkdir -p ${inst_dir}/tools
mkdir -p ${inst_dir}/hwpoison
mkdir -p $RPM_BUILD_ROOT/%{_sbindir}

install -d cases ${inst_dir}

cp -r config ${inst_dir}
cp -r cases ${inst_dir}
cp -r doc ${inst_dir}
cp -r drivers ${inst_dir}
cp -r lib ${inst_dir}

mkdir -p $RPM_BUILD_ROOT/usr/bin
install -m755 stress/bin/* $RPM_BUILD_ROOT/usr/bin

install stress/hwpoison.sh stress/README ${inst_dir}/stress
install stress/tools/page-poisoning/README ${inst_dir}/stress/README.page-poisoning
install stress/tools/fs-metadata/README ${inst_dir}/stress/README.fs-metadata
install tools/{gcov_merge.py,grep_result.sh,loop-mce-test.sh,mce_shell.sh,scov_merge.py} ${inst_dir}/tools
install hwpoison/README ${inst_dir}/hwpoison

# Arch-dependent Executables, must not be in /usr/share/mce-test
install tools/simple_process/simple_process hwpoison/{tinjpage,tsimpleinj,tkillpoison,tprctl} $RPM_BUILD_ROOT/%{_sbindir}

chmod 644 $RPM_BUILD_ROOT/usr/share/mce-test/hwpoison/README
chmod 644 $RPM_BUILD_ROOT/usr/share/mce-test/stress/README
chmod 644 $RPM_BUILD_ROOT/usr/share/mce-test/stress/README.fs-metadata
chmod 644 $RPM_BUILD_ROOT/usr/share/mce-test/stress/README.page-poisoning

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
/usr/share/%name
/usr/bin/*
%{_sbindir}/*

%changelog
* Mon Dec 14 2009 - trenn@suse.de
- Initial check-in from git
openSUSE Build Service is sponsored by