Update to 0.91

This commit is contained in:
Christopher Meng 2015-09-15 12:46:54 +08:00
parent 65040cb730
commit b0ae833ad5
4 changed files with 133 additions and 58 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/libstatgrab-0.90.tar.gz
/libstatgrab-0.17.tar.gz
/libstatgrab-0.91.tar.gz

12
libstatgrab.pc.in Normal file
View File

@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libstatgrab
Description: A library that provides a useful interface to system statistics
Version: @VERSION@
Requires.private: log4cplus
Libs: -L${libdir} -lstatgrab
Libs.private: @LINKFLAGS@
Cflags: -I${includedir}

View File

@ -1,51 +1,56 @@
%global pkgname statgrab
%bcond_without log4cplus
%bcond_without examples
Name: libstatgrab
Version: 0.17
Release: 8%{?dist}.2
Epoch: 1
Summary: A library that provides cross platform access to statistics about the system
Epoch: 1
Version: 0.91
Release: 1%{?dist}
Summary: A library that provides cross platform access to statistics of the system
License: LGPLv2+
URL: http://www.i-scream.org/libstatgrab
Source0: http://ftp.i-scream.org/pub/i-scream/%{name}/%{name}-%{version}.tar.gz
Patch0: %{name}.nochmod.patch
BuildRequires: libtool ncurses-devel
# REJECTED due to Solaris or whatever linking issue,
# thus we cope with pkgconfig manually.
# See: https://github.com/i-scream/libstatgrab/pull/70
Source1: libstatgrab.pc.in
%if %{with log4cplus}
BuildRequires: log4cplus-devel
%endif
BuildRequires: ncurses-devel
# Tests.
BuildRequires: perl(Config)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Temp)
BuildRequires: perl(File::Basename)
BuildRequires: perl(FindBin)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(IPC::Cmd)
BuildRequires: perl(Pod::Usage)
BuildRequires: perl(strict)
BuildRequires: perl(Test::More)
BuildRequires: perl(vars)
BuildRequires: perl(warnings)
%description
Libstatgrab is a library that provides cross platform access to statistics
about the system on which it's run. It's written in C and presents a selection
of useful interfaces which can be used to access key system statistics. The
current list of statistics includes CPU usage, memory utilisation, disk usage,
process counts, network traffic, disk I/O, and more.
about the system on which it's running. It's written in C and presents a
selection of useful interfaces which can be used to access key system
statistics. The current list of statistics includes CPU usage, memory
utilisation, disk usage, process counts, network traffic, disk I/O, and more.
The current list of platforms is Solaris 2.x, Linux, and FreeBSD 4.x/5.x.
The aim is to extend this to include as many operating systems as possible.
The package also includes a couple of useful tools. The first, saidar,
provides a curses-based interface to viewing the current state of the
system. The second, 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 statgrab is a script to generate an MRTG
configuration file to use statgrab.
%package -n %{pkgname}-tools
Summary: Tools from %{name} to monitoring the system
License: GPLv2+
%description -n %{pkgname}-tools
This package contains a few tools shiped with libstatgrab.
Eg. A tool called saidar, which shows various system
information like top, but - of course - OTHER informations.
The current list of supported and tested platforms includes FreeBSD, Linux,
NetBSD, OpenBSD, Solaris, DragonFly BSD, HP-UX and AIX.
%package devel
Summary: The development files from %{name}
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description devel
This package contains header files and man pages for those
use to develop libstatgrab based applications.
This package contains libraries, header files and manpages for
developing applications that use libstatgrab.
%if %{with examples}
%package examples
Summary: The example files from %{name}
License: GPLv2+
@ -54,48 +59,94 @@ Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description examples
This package contains various examples used to show how
to develop libstatgrab based applications.
%endif
%package -n saidar
Summary: System information real-time monitor
License: GPLv2+
%description -n saidar
Saidar is a curses-based interface to viewing the current state of the
system.
%package -n statgrab
Summary: Sysctl-style interface to the statistics from libstatgrab
License: GPLv2+
%description -n statgrab
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 statgrab
is a script to generate an MRTG configuration file to use statgrab.
# TODO: F25 must drop -compat.
%package compat
Summary: Transition package for statgrab-tools
Obsoletes: statgrab-tools < 1:0.91-0
Requires: statgrab%{?_isa} = %{epoch}:%{version}-%{release}
Requires: saidar%{?_isa} = %{epoch}:%{version}-%{release}
%description compat
This package only exists to help transition statgrab-tools users to the new
package split. It will be removed after 2 distribution release cycles, please
do not reference it or depend on it in any way.
%prep
%setup -q
%patch0 -p0
# Instead of wasting several lines to install these programs, makefile hack
# will save the time.
sed -i 's|noinst_PROGRAMS|bin_PROGRAMS|g' examples/Makefile*
%build
%configure --with-ncurses --disable-static
# remove rpath from libtool
sed -i.rpath 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i.rpath 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
cp -pf %{S:1} .
autoreconf -fiv
# Changing to asciidoc --enable-man-build
%configure --with-ncurses \
%if %{with log4cplus}
--with-log4cplus \
%endif
%if %{with examples}
--enable-examples \
%endif
--disable-static
%make_build
%install
make install DESTDIR=%{buildroot}
cd examples/.libs
install -m 755 cpu_usage disk_traffic load_stats network_iface_stats \
network_traffic os_info page_stats process_snapshot \
process_stats user_list vm_stats %{buildroot}%{_bindir}
chmod 755 %{buildroot}%{_bindir}/statgrab-make-mrtg-config
chmod 755 %{buildroot}%{_bindir}/saidar
chmod 755 %{buildroot}%{_bindir}/statgrab
find %{buildroot} -name '*.la' -delete
%make_install
%if %{with examples}
%make_install -C examples/
%endif
# Use %%doc instead.
rm -frv %{buildroot}%{_docdir}
# Drop libtool archive.
find %{buildroot} -name '*.la' -delete -print
%check
make check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc AUTHORS README ChangeLog NEWS COPYING.LGPL
%license COPYING.LGPL
%{_libdir}/*.so.*
%files devel
%doc AUTHORS NEWS PLATFORMS README
%doc examples/*.c
%{_libdir}/*.so
%{_includedir}/*.h
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/*/sg_*
%if %{with examples}
%files examples
%doc COPYING
%license COPYING
%{_bindir}/cpu_usage
%{_bindir}/disk_traffic
%{_bindir}/filesys_snapshot
%{_bindir}/load_stats
%{_bindir}/network_iface_stats
%{_bindir}/network_traffic
@ -104,18 +155,30 @@ find %{buildroot} -name '*.la' -delete
%{_bindir}/process_snapshot
%{_bindir}/process_stats
%{_bindir}/user_list
%{_bindir}/valid_filesystems
%{_bindir}/vm_stats
%endif
%files -n %{pkgname}-tools
%doc COPYING
%files -n saidar
%license COPYING
%{_bindir}/saidar
%{_bindir}/statgrab
%{_bindir}/statgrab-make-mrtg-config
%{_bindir}/statgrab-make-mrtg-index
%{_mandir}/*/*statgrab*
%if %{with log4cplus}
%{_sysconfdir}/saidar.properties
%endif
%{_mandir}/*/saidar*
%files -n statgrab
%license COPYING
%{_bindir}/statgrab*
%if %{with log4cplus}
%{_sysconfdir}/statgrab.properties
%endif
%{_mandir}/*/*statgrab*
%changelog
* Sun Jul 26 2015 Christopher Meng <rpm@cicku.me> - 1:0.91-1
- Update to 0.91
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.17-8.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

View File

@ -1,2 +1 @@
b7c349c500fabc14d04c7c1ac7770d94 libstatgrab-0.90.tar.gz
58385c9392898be3b09ffc5e3ebe8717 libstatgrab-0.17.tar.gz
b906d312076ca9be3d5188edfe07f496 libstatgrab-0.91.tar.gz