File xosview.spec of Package xosview

#
# spec file for package xosview (Version 1.8.3)
#
# Copyright (c) 2008 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:        BSD 3-Clause; GPL v2 or later; X11/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:        198
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.2-serial.patch
Patch2:         xosview-1.8.1-procsys.patch
Patch3:         xosview-1.8.2-maxlimit.patch
Patch4:         xosview-1.8.0-irda.patch
Patch6:         xosview-%{version}-double.patch
Patch7:         xosview-%{version}-longint.patch
Patch8:         xosview-1.8.2-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
* Tue Nov 25 2008 werner@suse.de
- xorg-11 is required as xrdb is required (bnc#448059)
* Thu May 15 2008 werner@suse.de
- The disk IO rates seems to be a factor 10 to large (bnc#390740)
* Fri Apr 25 2008 werner@suse.de
- There are kernels with more than 1024 IRQ lines (bnc#381758)
* Tue Dec 04 2007 werner@suse.de
- Use I/O block size for hd if lstat(8) has success (bug #342107)
* Mon Nov 26 2007 werner@suse.de
- Take ACPI and Xresources in account for battery option (#343806)
* Fri Sep 07 2007 werner@suse.de
- Count disks only once within diskmeter (bug #301665)
* Mon Aug 13 2007 schwab@suse.de
- Remove obsolete patch.
* Mon Aug 06 2007 werner@suse.de
- Fix BuildRequires
* Fri Mar 16 2007 werner@suse.de
- More one thin-skinned Gcc42
* Fri Mar 16 2007 werner@suse.de
- Gcc42 seems to be thin-skinned
* Fri Mar 09 2007 werner@suse.de
- Fix the last fix by re-adding g++
* Mon Feb 26 2007 stbinner@suse.de
- fix build by including icon and .desktop into package
* Mon Dec 11 2006 werner@suse.de
- Expand search path for app-defaults to /usr/share/X11 (#227401)
* Mon Jul 31 2006 werner@suse.de
- Correct mandir for the manual page
* Thu Jul 27 2006 werner@suse.de
- Update to xosview version 1.8.3
  * New sysfs support
- Make it build with X11R7
* Fri Jun 16 2006 schwab@suse.de
- Fix syntax error in configure script.
- Set mandir.
- Use RPM_OPT_FLAGS.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Dec 13 2005 werner@suse.de
- Avoid potential undefined code (bug #137124)
* Tue Nov 29 2005 sbrabec@suse.cz
- Don't package icon already present in desktop-data-SuSE.
  Cleans rpm -V output.
* Mon Nov 28 2005 od@suse.de
- Fix swap size calculation by using float numbers to calculate
  swap size > ~ 3GB (#135681)
* Mon Apr 18 2005 werner@suse.de
- Change disk IO fudgeFactor from 4 to 2 (bug #66537)
* Fri Jan 28 2005 werner@suse.de
- Update to xosview 1.8.2 (bug #49829)
* Wed Nov 17 2004 werner@suse.de
- Add log.png pixmap to file list
* Tue Aug 31 2004 werner@suse.de
- Disable the not used notify message
* Tue May 04 2004 werner@suse.de
- Fixes the inability of xosview to display interrupts
* Fri Mar 12 2004 werner@suse.de
- Fix boolean typo (bug #35803)
* Tue Mar 09 2004 werner@suse.de
- Just support ppc64
* Tue Mar 09 2004 werner@suse.de
- Make a real support of kernel 2.6 (bug #35474)
* Thu Jan 22 2004 werner@suse.de
- Support the broken ISO standard of C++ about templates and name
  spaces imported from a template class (or better not imported
  even if unique).
* Wed Jan 21 2004 werner@suse.de
- Force memmeter to use double by modding some classes to class
  templates for typenames (fix bug #33722)
* Tue Jan 20 2004 werner@suse.de
- Update to version 1.8.1
* Sat Jan 10 2004 adrian@suse.de
- build as user
* Tue Oct 21 2003 ja@suse.cz
- fixed xosview on 2.6.x kernels.
* Sat Aug 16 2003 adrian@suse.de
- install desktop file from kappfinder
* Wed May 28 2003 coolo@suse.de
- use BuildRoot
* Thu Apr 24 2003 garloff@suse.de
- Detect number of interrupts rather than hardcoding it per plat-
  form.
* Sat Mar 22 2003 schwab@suse.de
- Fix app-defaults to work with any resource name.
* Mon Jan 27 2003 ro@suse.de
- fix build with gcc-3.3 (strstream.h)
* Thu Sep 26 2002 froh@suse.de
- disable serialmeter like for sparc/ppc to make it build on s390/s390x
  and disable interrupt-meter on s390/s390x (#20207)
* Tue Sep 17 2002 ro@suse.de
- removed bogus self-provides
* Sat Aug 17 2002 schwab@suse.de
- Fix resources.
* Fri Jul 19 2002 werner@suse.de
- Fix irda (and other) scanning bug for /proc/net/dev (bug #16929)
* Wed Jul 03 2002 werner@suse.de
- Update to xosview 1.8.0
- Extend label width by one character (bug #16490) for more then
  9 CPUs systems
* Wed Feb 13 2002 werner@suse.de
- Full remove including %%if
* Wed Feb 13 2002 werner@suse.de
- Remove km_memst package
* Tue Feb 12 2002 werner@suse.de
- Fix bug #12749: do not install xosview.rc.config nor
  /etc/sysconfig/xosview because the memstat module does not work
  with 2.4.x kernels
- Fix bug #12756: increase buffer size
* Mon Jan 14 2002 schwab@suse.de
- Fix dependency generation.
* Wed Dec 12 2001 garloff@suse.de
- Restrict num. of IRQs to 64 on AXP if ridiculous numbers (>256)
  are detected. (We can't display them anyway ...)
* Wed Nov 14 2001 werner@suse.de
- Increase buffer size for reading /proc/stat because
  on PPC64 more than 1024 bytes is required (Bugzilla #12235).
* Wed Jun 27 2001 schwab@suse.de
- Fix for gcc 3.0.
* Fri Mar 16 2001 ro@suse.de
- don't build memstat module during build
  n/a for 2.4 kernels anyway
* Fri Jan 12 2001 werner@suse.de
- Enable /proc/net/dev usage of xosview
* Wed Dec 13 2000 ro@suse.de
- added rc.config snippet for variable LOAD_MEMSTAT_MODULE
* Thu Nov 30 2000 ro@suse.de
- don't try to compile memstat for 2.4
* Mon Aug 14 2000 schwab@suse.de
- Don't build memstat module on ia64.
- Fix intmeter for ia64.
- Add %%suse_update_config.
* Sun Aug 06 2000 kukuk@suse.de
- Add CFLAGS and CC variable for UltraSPARC
* Wed Jun 21 2000 werner@suse.de
- Add patch which allows kernels without CONFIG_SYSCTL
* Wed May 24 2000 uli@suse.de
- moved docs to %%{_docdir}
* Thu May 11 2000 ro@suse.de
- fixed intmeter for alpha
* Thu Mar 16 2000 kukuk@suse.de
- Remove SerialMeter for SPARC
* Thu Mar 09 2000 ro@suse.de
- removed k_deflt from neededforbuild
* Sun Mar 05 2000 kukuk@suse.de
- Fix handling of SMP configuration
- Don't include memstat module, create source package instead
* Fri Mar 03 2000 werner@suse.de
- Make pattern for DRVver to `1.*' to catch all 1.X drivers
* Fri Feb 25 2000 werner@suse.de
- Secure method to test if we have a *working* system battery (in
  the absolute most cases this means we are running on a notebook)
* Thu Feb 10 2000 ro@suse.de
- replaced kernmod by k_deflt
* Mon Feb 07 2000 kasal@suse.de
- app-defaults files should be %%config
* Thu Nov 25 1999 uli@suse.de
- disabled serial meter for PPC
* Wed Nov 24 1999 kettner@suse.de
- bug workaround for AXP /proc/stat problem
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Fri Aug 27 1999 ro@suse.de
- set kernel-version to 2.2.12
* Tue Aug 24 1999 ro@suse.de
- use .c instead of .$(FEXT) ... to make it compile on alpha
* Fri Jul 16 1999 ro@suse.de
- modified to contain own modules
* Thu Jul 08 1999 werner@suse.de
- Fix option handling in xosview script
* Wed Mar 10 1999 ro@suse.de
- adapted to old kernmod
* Fri Mar 05 1999 werner@suse.de
- Upgrade to 1.7.1
  * Fix XOsview to handle graphs in the old way
  * Change makefile of memstat to detect configuration
  at runtime (MODVERSIONS, SMP, RELEASE)
* Mon Dec 14 1998 ro@suse.de
- enable net if proc/net/ip_fwchains exists (or proc/net/ip_acct)
* Tue Nov 24 1998 ro@suse.de
- use gcc
* Wed Nov 11 1998 ro@suse.de
- detect kernel-version from UTS-Release (not from uname -r)
* Thu May 28 1998 werner@suse.de
- New version 1.6.0
	- Remove suid bit from binary
	- Add a message for sending after installation
* Wed Feb 11 1998 werner@suse.de
- New revision
* Tue Nov 04 1997 werner@suse.de
- New revision
  * with module support to count shared pages only once
  * Swap page in/out
openSUSE Build Service is sponsored by