File coreboot-utils.spec of Package coreboot-utils

#
# spec file for package coreboot-utils
#
# Copyright (c) 2011 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/
#



Name:           coreboot-utils
Url:            http://coreboot.org/
Summary:        A universal flash programming utility
Version:        r6158
Release:        1
License:        GPL-2.0 ; GPL-2.0+
Group:          Development/Tools/Other
Source0:        coreboot-utils-%{version}.tar.bz2
Source23:       update-snapshots.sh
Patch0:         nvramtool-revision.diff
Patch1:         superiotool-revision.diff
Patch2:         k8resdump.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pciutils-devel zlib-devel
BuildRequires:  gcc-c++
ExclusiveArch:  %ix86 x86_64

%description
coreboot utilities are a comprehensive set of tools to work with coreboot.
Currently it includes: 
* nvramtool - a tool to set CMOS variables

%prep
%setup -q 
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
cd nvramtool
make %{?_smp_mflags} \
        CFLAGS="$RPM_OPT_FLAGS -Os -Wall" \
        LDFLAGS="-lpci -lz"
strip nvramtool
gzip nvramtool.8

cd ../inteltool
make inteltool \
        CFLAGS="$RPM_OPT_FLAGS -Os -Wall" \
        LDFLAGS="-lpci -lz" 
strip inteltool
gzip inteltool.8

cd ../superiotool
make %{?_smp_mflags} \
        CFLAGS="$RPM_OPT_FLAGS -Os -Wall -DPCI_SUPPORT" \
        LDFLAGS="-lpci -lz"
strip superiotool
gzip superiotool.8

cd ../ectool
make %{?_smp_mflags} \
        CFLAGS="$RPM_OPT_FLAGS -Os -Wall" \
        LDFLAGS="-lpci -lz"
strip ectool

cd ../msrtool
CFLAGS="$RPM_OPT_FLAGS" ./configure
make %{?_smp_mflags}
strip msrtool

cd ../k8resdump
make %{?_smp_mflags}
strip k8resdump

cd ../cbfstool
make %{?_smp_mflags} \
	CFLAGS="$RPM_OPT_FLAGS -Os -Wall" \
	CXXFLAGS="$RPM_OPT_FLAGS -Os -Wall -DCOMPACT"

cd ../

%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_sbindir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8

cd nvramtool
install -m 0755 nvramtool $RPM_BUILD_ROOT/%{_sbindir}
install -m 0644 nvramtool.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8
cp DISCLAIMER DISCLAIMER.nvramtool
cp README README.nvramtool
cp ChangeLog ChangeLog.nvramtool

cd ../inteltool
install -m 0755 inteltool $RPM_BUILD_ROOT/%{_sbindir}
install -m 0644 inteltool.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8

cd ../superiotool
install -m 0755 superiotool $RPM_BUILD_ROOT/%{_sbindir}
install -m 0644 superiotool.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8
cp README README.superiotool

cd ../ectool
install -m 0755 ectool $RPM_BUILD_ROOT/%{_sbindir}

cd ../msrtool
install -m 0755 msrtool $RPM_BUILD_ROOT/%{_sbindir}

cd ../k8resdump
install -m 0755 k8resdump $RPM_BUILD_ROOT/%{_sbindir}

cd ../amdtools
install -m 0755 k8-interpret-extended-memory-settings.pl \
	$RPM_BUILD_ROOT/%{_sbindir}/k8-interpret-extended-memory-settings.pl
install -m 0755 k8-compare-pci-space.pl \
	$RPM_BUILD_ROOT/%{_sbindir}/k8-compare-pci-space.pl
install -m 0755 k8-read-mem-settings.sh \
	$RPM_BUILD_ROOT/%{_sbindir}/k8-read-mem-settings.sh
install -m 0755 parse-bkdg.pl \
	$RPM_BUILD_ROOT/%{_sbindir}/parse-bkdg.pl
cp -a example_input example_input.amdtools
cp -a README README.amdtools

cd ../cbfstool
install -m 0755 cbfstool $RPM_BUILD_ROOT/%{_bindir}
cp EXAMPLE EXAMPLE.cbfstool

%files
%defattr(-,root,root)
%doc nvramtool/COPYING
%doc nvramtool/DISCLAIMER.nvramtool nvramtool/ChangeLog.nvramtool nvramtool/README.nvramtool
%doc superiotool/README.superiotool cbfstool/EXAMPLE.cbfstool
%doc amdtools/README.amdtools amdtools/example_input.amdtools
%{_sbindir}/nvramtool
%{_sbindir}/inteltool
%{_sbindir}/superiotool
%{_sbindir}/ectool
%{_sbindir}/msrtool
%{_sbindir}/k8resdump
%{_sbindir}/k8-interpret-extended-memory-settings.pl
%{_sbindir}/k8-compare-pci-space.pl
%{_sbindir}/k8-read-mem-settings.sh
%{_sbindir}/parse-bkdg.pl
%{_bindir}/cbfstool
%{_mandir}/man8/nvramtool.8.gz
%{_mandir}/man8/inteltool.8.gz
%{_mandir}/man8/superiotool.8.gz

%changelog