File latencytop.spec of Package latencytop

#
# spec file for package latencytop
#
# Copyright (c) 2012 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:           latencytop
BuildRequires:  gtk2-devel
BuildRequires:  ncurses-devel
BuildRequires:  pkgconfig
Summary:        Kernel latency measuring tool
License:        GPL-2.0
Group:          System/Monitoring
Version:        0.5
Release:        0
Source:         latencytop-%{version}.tar.bz2
Patch:          latencytop-warning-fixes.diff
Patch1:         latencytop-incremental-output.patch
Patch2:         latencytop-incremental-man.patch
Url:            http://www.latencytop.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
LatencyTOP is a Linux* tool for software developers (both kernel and
userspace), aimed at identifying where in the system latency is
happening, and what kind of operation/action is causing the latency to
happen so that the code can be changed to avoid the worst latency
hiccups. A version with graphic interface is available as xlatencytop.

%prep
%setup -q
%patch -p1
%patch1 -p2
%patch2 -p1

%build
export CFLAGS="$RPM_OPT_FLAGS"
make %{?jobs:-j %jobs}
mv latencytop xlatencytop
make clean
sed -i 's|HAS_GTK_GUI = 1|#HAS_GTK_GUI = 1|' Makefile
make %{?jobs:-j %jobs}

%install
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
make DESTDIR=$RPM_BUILD_ROOT install
install -m 0755 xlatencytop $RPM_BUILD_ROOT%{_sbindir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
install -c -m 0644 *.8 $RPM_BUILD_ROOT%{_mandir}/man8

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%doc %{_mandir}/man*/*
%{_sbindir}/*
%{_datadir}/latencytop

%changelog
openSUSE Build Service is sponsored by