File watsup.spec of Package watsup

# vim: set sw=4 ts=4 et:
# norootforbuild

%if 0%{?suse_version} <= 1140
%define number  1.9
%else
%define number  2.8
%endif
Name:           watsup
Version:        %{number}
Release:        1
Summary:        Lightweight System Resource and Process Monitor
Source:         watsup-%{version}.tar.bz2
Source1:        watsup.desktop
Patch1:         watsup-optflags.patch
URL:            http://www.kornelix.com/watsup.html
Group:          System/Monitoring
License:        GPL-3.0
BuildRoot:      %{_tmppath}/build-%{name}-%{version}
BuildRequires:  pkgconfig make gcc-c++ libstdc++-devel
%if 0%{suse_version} <=1140
BuildRequires:  gtk2-devel
%else
BuildRequires:  gtk3-devel xdg-utils
%endif
BuildRequires:  update-desktop-files

%description
Monitor system resources and the processes using those resources.

* Overhead is low, supporting a sample interval down to 0.1 seconds
* Overall system and top process resources are shown on one page
* CPU, memory, disk I/O, network I/O, and page faults are monitored
* Usage for N CPUs shown on a scale from zero to N x 100%
* The highest ranked processes fitting in the window are shown, with minimal
  jumping around between samples (easy to watch one or a few processes)
* Process rank is a weighted sum of CPU, hard page faults, and disk I/O over
  the last few samples (the weight of each sample declines over time)
* Filter processes by user, PID, executable
* Font can be made large or small (for display in monitor corner)
* Click on a process to kill the process (after confirmation)




Authors:
--------
    <kornelix@yahoo.de>    

%prep
%setup -q
%if 0%{suse_version} <=1140
%patch1
%endif

%build
%if 0%{suse_version} <=1140
%__make %{?jobs:-j%{jobs}} \
    PREFIX="%{_prefix}" \
    OPTFLAGS="%{optflags}" \
    DOCDIR="%{_docdir}/%{name}"
%else
%__make %{?jobs:-j%{jobs}} \
    DOCDIR="%{_docdir}/%{name}"
%endif    

%install
%makeinstall PREFIX="%{_prefix}" DOCDIR="%{_docdir}/%{name}"
%if 0%{suse_version} <=1140
%__install -D -m0644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/%{name}.desktop"
%endif   
%suse_update_desktop_file -r "%{name}" System Monitor

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{_bindir}/watsup
%{_datadir}/watsup
%{_datadir}/applications/%{name}.desktop
%if 0%{suse_version} >=1210
%{_datadir}/man/man1/%{name}.1.gz
%endif

%changelog