File libstatgrab6.spec of Package libstatgrab

# norootforbuild

%define soname		6

%if %suse_version >= 1030
Name:				libstatgrab%{soname}
%else
Name:				libstatgrab
%endif
Version:			0.16
Release:			3.1
Summary:			Interface to System Statistics
URL:				http://www.i-scream.org/libstatgrab/
Source:			ftp://ftp.i-scream.org/pub/i-scream/libstatgrab/libstatgrab-%{version}.tar.gz
Source1:			statgrab.desktop
Source2:			saidar.desktop
Patch1:			libstatgrab-os-linux.diff
Patch2:			libstatgrab-link-ncurses.diff
Patch3:			libstatgrab-fix-include-ncurses.patch
Group:			Development/Libraries/C and C++
License:			GNU Library General Public License (LGPL)
BuildRoot:		%{_tmppath}/build-%{name}-%{version}
BuildRequires:	make gcc glibc-devel ncurses-devel
BuildRequires:	autoconf automake libtool update-desktop-files

%description
The libstatgrab library provides an easy-to-use interface for accessing system
statistics and information.
Available statistics include CPU, Load, Memory, Swap, Disk I/O, and Network
I/O. It was developed to work on Linux, FreeBSD, and Solaris.

The package also includes two tools: saidar provides a curses-based interface
for viewing live system statistics, and statgrab is a sysctl-like interface to
the statistics.

%package -n libstatgrab-devel
Summary:			Development Environment for %{name}
Requires:		%{name} = %{version}-%{release}
Group:			Development/Libraries/C and C++
License:			GNU Library General Public License (LGPL)

%description -n libstatgrab-devel
Development environment for %{name} (headers, library links, static library).

%package -n statgrab
Summary:			Portable System Statistics Tools
Requires:		%{name} = %{version}-%{release}
Group:			System/Monitoring
License:			GNU General Public License (GPL)

%description -n statgrab
This package includes a couple of useful tools that use the %{name} library.
- statgrab: gives a sysctl-style interface to the statistics gathered by libstatgrab
This extends the use of libstatgrab to people writing scripts or anything else
that can't easily make C function calls.
Included with this package is a script to generate an MRTG configuration file
to use statgrab.

%package -n saidar
Summary:			Portable System Statistics Tools
Requires:		%{name} = %{version}-%{release}
Group:			System/Monitoring
License:			GNU General Public License (GPL)

%description -n saidar
This package includes a couple of useful tools that use the %{name} library.
- saidar: provides a curses-based interface to viewing the current state of the system
This extends the use of libstatgrab to people writing scripts or anything else
that can't easily make C function calls.

%prep
%setup -q -n "libstatgrab-%{version}"
%patch1
%patch2
%patch3

%build
autoreconf -fiv

%configure \
	--with-ncurses \
	--disable-setuid-binaries \
	--disable-setgid-binaries \
	--disable-examples \
	--enable-statgrab \
	--enable-saidar \
	--enable-manpages

%__make %{?jobs:-j%{jobs}}

%install
%makeinstall

%__install -d  "%{buildroot}%{_datadir}/applications"
%__install -m 0644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/"
%__install -m 0644 "%{SOURCE2}" "%{buildroot}%{_datadir}/applications/"
%suse_update_desktop_file -r saidar System Monitor
%suse_update_desktop_file -r statgrab System Monitor

# prepare doc files
%__install -d "%{buildroot}%{_docdir}/%{name}"
echo "%doc %dir %{_docdir}/%{name}" > rpmdocfiles.lst
for f in AUTHORS ChangeLog COPYING* README NEWS PLATFORMS; do
	%__install -m0644 "$f" "%{buildroot}%{_docdir}/%{name}/"
	echo "%doc %{_docdir}/%{name}/${f}" >> rpmdocfiles.lst
done

%__rm -rf examples/Makefile* examples/.deps
%__mv examples "%{buildroot}%{_docdir}/%{name}/"

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

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

%files -f rpmdocfiles.lst
%defattr(-,root,root)
%{_libdir}/libstatgrab.so.%{soname}
%{_libdir}/libstatgrab.so.%{soname}.*

%files -n libstatgrab-devel
%defattr(-,root,root)
%doc %{_docdir}/%{name}/examples
%{_includedir}/statgrab.h
%{_includedir}/statgrab_deprecated.h
%{_libdir}/libstatgrab.so
%{_libdir}/libstatgrab.la
%{_libdir}/libstatgrab.a
%{_libdir}/pkgconfig/libstatgrab.pc
%doc %{_mandir}/man3/sg_*.3*
%doc %{_mandir}/man3/statgrab.3*

%files -n statgrab
%defattr(-,root,root)
%doc COPYING
%{_bindir}/statgrab
%{_bindir}/statgrab-make-mrtg-config
%{_bindir}/statgrab-make-mrtg-index
%doc %{_mandir}/man1/statgrab.1*
%doc %{_mandir}/man1/statgrab-make-mrtg-config.1*
%doc %{_mandir}/man1/statgrab-make-mrtg-index.1*
%{_datadir}/applications/statgrab.desktop

%files -n saidar
%defattr(-,root,root)
%doc COPYING
%{_bindir}/saidar
%doc %{_mandir}/man1/saidar.1*
%{_datadir}/applications/saidar.desktop

%changelog
* Sat Sep 26 2009 Klaus Kaempf <kkaempf@suse.de> 0.16
- Fix the build (rename spec to match package name)

* Wed Mar 19 2008 Pascal Bleser <guru@unixtech.be> 0.16
- new upstream version

* Sun Dec 30 2007 Pascal Bleser <guru@unixtech.be> 0.15
- new upstream version

* Wed Sep 12 2007 Pascal Bleser <guru@unixtech.be> 0.14
- shared library policy for 10.3
- moved to openSUSE Build Service

* Mon Jan  8 2007 Pascal Bleser <guru@unixtech.be> 0.14-1
- moved examples to -devel
- added binary stripping on SUSE < 9.3
- removed Packager and Distribution, injected by rpmmacros
- new upstream version

* Mon Mar 20 2006 Pascal Bleser <guru@unixtech.be> 0.13-1
- added -r flag to suse_update_desktop_file
- added release in Requires signature for subpackages
- removed explicit Requires
- added -j to make
- new upstream version

* Mon Dec 26 2005 Pascal Bleser <guru@unixtech.be> 0.12-3
- rewrote spec file

* Mon Sep 19 2005 Pascal Bleser <guru@unixtech.be> 0.12-1
- version 0.12

* Mon Jul 26 2004 Pascal Bleser <guru@unixtech.be> 0.10.1-1
- version 0.10.1

* Sat Mar 20 2004 Pascal Bleser <guru@unixtech.be> 0.9-1
- version 0.9

* Wed Jan 21 2004 Pascal Bleser <guru@unixtech.be> 0.8.1-1
- first RPM

# Local Variables:
# mode: rpm-spec
# tab-width: 3
# End:
openSUSE Build Service is sponsored by