File i7z.spec of Package i7z

# spec file for package i7z
# Copyright (c) 2012 Malcolm J Lewis <>
# 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

Name:           i7z
Version:        0.27.2+r112
Release:        0
Summary:        Reporting Tool for i3, i5 and i7 CPU's
License:        GPL-2.0 and GPL-3.0
Group:          System/Monitoring
Source0:        %{name}-%{version}.tar.bz2
#Source0 via svn checkout i7z-0.27.2+r112
# Then tar cvjf i7z-0.27.2+r112.tar.bz2 i7z-0.27.2+r112/
Source2:        i7z.1
Source3:        i7z_rw_registers.1
# PATCH-FIX-OPENSUSE i7z-add-optflags.patch -- Add additional CFLAGS for compiling to fix build check warning.
Patch0:         i7z-add-optflags.patch
BuildRequires:  ncurses-devel
Requires:       msr-tools
Requires:       ruby
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

A better i7 (and now i3, i5) reporting tool for Linux. This package also
provides a ncurces gui.

Includes a script to read/write to registers on Nehalems and Sandy Bridges
to change multipliers, turbo mode, check power and clock modulation.

%setup -q
%patch0 -p1

make clean
export OPT_FLAGS="%{optflags}"
make bin %{?_smp_mflags}

install -D -m 0755 %{name} %{buildroot}%{_sbindir}/%{name}
install -D -m 0644 %{S:1}  %{buildroot}%{_datadir}/%{name}/i7z_rw_registers.rb
cat > %{buildroot}%{_sbindir}/i7z_rw_registers <<EOF
ruby %{_datadir}/%{name}/i7z_rw_registers.rb
chmod 0755 %{buildroot}%{_sbindir}/i7z_rw_registers
mkdir -p %{buildroot}%{_mandir}/man1
install -D -m 0644 %{S:2} %{buildroot}%{_mandir}/man1/
install -D -m 0644 %{S:3} %{buildroot}%{_mandir}/man1/

%doc README.txt
%dir %{_datadir}/%{name}