File xosview.spec of Package xosview
#
# spec file for package xosview
#
# Copyright (c) 2015 SUSE LINUX 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: xosview
BuildRequires: autoconf
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xpm)
# NOTE: We don't want this dependency and desktop-data-SuSE is in all
# desktop selections.
#Requires: desktop-data-SuSE
# This because /usr/bin/xrdb is part of xorg-x11
Requires: xorg-x11
Version: 1.16
Release: 0
Summary: System Load Information
License: GPL-2.0+
Group: System/Monitoring
Url: https://github.com/hills/xosview
Source: http://www.pogo.org.uk/~mark/xosview/releases/xosview-%{version}.tar.gz
Source1: rc.config.xosview
Source2: xosview.png
Source3: xosview.desktop
Source4: xosview.sh
Source5: xosview-rpmlintrc
Patch0: xosview-%{version}.dif
Patch1: xosview-%{version}-serial.patch
Patch2: xosview-%{version}-coretemp.patch
Patch3: xosview-%{version}-coretemp2.patch
Patch10: xosview-%{version}-appdef.patch
Patch11: xosview-%{version}-diskstat.patch
# PATCH-FIX-UPSTREAM Replace the parsing of /proc/meminfo
Patch12: 0001-Replace-the-parsing-of-proc-meminfo.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define _appdefdir %{_datadir}/X11/app-defaults
%description
A small program which is mostly configurable using resources via
~/.Xresources. It shows actual CPU, swap, memory, active interrupts,
and, if desired, netpacket statistics in a graphical manner.
%prep
%setup -q
%patch1 -p0 -b .serial
%patch2 -p0 -b .coretemp
%patch3 -p0 -b .coretemp2
%patch10 -p0 -b .appdef
%patch11 -p0 -b .diskstat
%patch12 -p0 -b .memmeter
%patch0 -p0 -b .p0
%build
OPTFLAGS="$RPM_OPT_FLAGS"
CXX=g++
case "$RPM_OPT_FLAGS" in
*-fno-const-strings*) ;;
*)
if $CXX $OPTFLAGS -fno-const-strings -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
OPTFLAGS="$OPTFLAGS -fno-const-strings"
fi
esac
make clean
make PLATFORM=linux OPTFLAGS="$OPTFLAGS" PREFIX=%{_exec_prefix} USE_SYSCALLS=1
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_appdefdir}
mkdir -p %{buildroot}%{_docdir}/xosview
make PREFIX=%{_exec_prefix} \
MANDIR=%{_mandir} \
XAPPLOADDIR=%{_appdefdir} \
USE_SYSCALLS=1 \
DESTDIR=%{buildroot} \
install
install -m 0444 Xdefaults %{buildroot}%{_appdefdir}/XOsview
install -m 0444 README %{buildroot}%{_docdir}/xosview/
install -m 0444 README.linux %{buildroot}%{_docdir}/xosview/
mv %{buildroot}%{_bindir}/xosview %{buildroot}%{_bindir}/xosview.bin
sed 's|@@BINDIR@@|%{_bindir}|' < %{S:4} > %{buildroot}%{_bindir}/xosview
chmod 0755 %{buildroot}%{_bindir}/xosview
chmod 0755 %{buildroot}%{_bindir}/xosview.bin
mkdir -p %{buildroot}%{_datadir}/pixmaps
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/
mkdir -p %{buildroot}%{_datadir}/applications
install -m 644 %{SOURCE3} %{buildroot}%{_datadir}/applications
%files
%defattr(-,root,root)
%{_datadir}/pixmaps/xosview.png
%{_datadir}/applications/xosview.desktop
%{_bindir}/xosview
%{_bindir}/xosview.bin
%dir %{_appdefdir}
%config %{_appdefdir}/XOsview
%doc %{_mandir}/man1/xosview.1.gz
%dir %{_docdir}/xosview/
%doc %{_docdir}/xosview/README
%doc %{_docdir}/xosview/README.linux
%changelog