File xosview.spec of Package xosview
#
# spec file for package xosview (Version 1.8.3)
#
# Copyright (c) 2009 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/
#
# norootforbuild
Name: xosview
BuildRequires: gcc-c++ linux-kernel-headers pkgconfig update-desktop-files xorg-x11-devel
License: BSD3c ; GPLv2+ ; MIT
Group: System/Monitoring
AutoReqProv: on
# 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.8.3
Release: 200
Summary: System Load Information
Url: http://sourceforge.net/projects/xosview/
Source: xosview-%{version}.tar.bz2
Source1: rc.config.xosview
Source2: xosview.png
Source3: xosview.desktop
Source4: xosview.sh
Patch: xosview-%{version}.dif
Patch1: xosview-1.8.3-serial.patch
Patch2: xosview-1.8.1-procsys.patch
Patch3: xosview-1.8.3-maxlimit.patch
Patch4: xosview-1.8.0-irda.patch
Patch6: xosview-%{version}-double.patch
Patch7: xosview-%{version}-longint.patch
Patch8: xosview-1.8.3-float-conv.patch
Patch9: xosview-1.8.2-configure.patch
Patch10: xosview-1.8.3-appdef.dif
Patch11: xosview-1.8.3-diskstat.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)}
%if "%_exec_prefix" == "/usr/X11R6"
%global _mandir %{_exec_prefix}/man
%global _includedir %{_exec_prefix}/include
%define _appdefdir %{_exec_prefix}/lib/X11/app-defaults
%else
%define _appdefdir %{_datadir}/X11/app-defaults
%endif
%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.
Authors:
--------
Mike Romberg <romberg@md.fsl.noaa.gov>
%prep
%setup -q
%patch1 -p0 -b ".serial"
%patch2 -p0 -b ".procsys"
%patch3 -p0 -b ".maxlimit"
%patch4 -p0 -b ".irda"
%patch6 -p0 -b ".double"
%patch7 -p0 -b ".ulong"
%patch8 -p0 -b ".float-conv"
%patch9 -p0 -b ".conf"
%patch10 -p0 -b ".appdef"
%patch11 -p0 -b ".diskstat"
%patch
%{?suse_update_config:%{suse_update_config -f config}}
%build
%ifarch ppc
export SYSTEM=powerpc-suse-linux
%else
export SYSTEM=%{_target_cpu}-suse-linux
%endif
CFLAGS="$RPM_OPT_FLAGS"
CXXFLAGS=""
CC=gcc
CXX=g++
case "$RPM_OPT_FLAGS" in
*-fno-const-strings*) ;;
*)
if $CXX $CFLAGS -fno-const-strings -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
CXXFLAGS="-fno-const-strings"
fi
esac
export CFLAGS CXXFLAGS CXX CC
(cd config/; autoconf; cp configure ../)
./configure $SYSTEM --with-x \
--x-includes=%{_includedir} \
--x-libraries=%{_libdir} \
--enable-auto-depend \
--enable-linux-syscalls \
--prefix=%{_prefix} \
--exec-prefix=%{_exec_prefix} \
--mandir=%{_mandir} \
--disable-linux-memstat
make clean
make
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_appdefdir}
make PREFIX_TO_USE=%{buildroot}%{_exec_prefix} \
MANDIR=%{buildroot}%{_mandir}/man1 \
XAPPLOADDIR=%{buildroot}%{_appdefdir} \
install install-man
mkdir -p %{buildroot}%{_docdir}/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 $RPM_BUILD_ROOT/usr/share/pixmaps
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/usr/share/pixmaps/
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/usr/share/applications/
%suse_update_desktop_file xosview
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_prefix}/share/pixmaps/xosview.png
%{_datadir}/applications/xosview.desktop
%{_bindir}/xosview
%{_bindir}/xosview.bin
%config %{_appdefdir}/XOsview
%doc %{_mandir}/man1/xosview.1.gz
%dir %{_docdir}/xosview/
%doc %{_docdir}/xosview/README
%doc %{_docdir}/xosview/README.linux
%changelog