Sisyphus repository
Last update: 23 september 2022 | SRPMs: 17652 | Visits: 25026145
en ru br
ALT Linux repos
S:12.6.0-alt1
5.0: 8.1.6-alt1
4.1: 8.1.2-alt1
4.0: 7.1.4-alt1
3.0: 6.0.0-alt1

Group :: Monitoring
RPM: sysstat

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define _unpackaged_files_terminate_build 1
Name: sysstat
Version: 12.5.1
Release: alt2

Summary: The sar and iostat system monitoring commands
License: GPLv2+
Group: System/Base

URL: http://sebastien.godard.pagesperso-orange.fr/
# https://github.com/sysstat/sysstat.git
Source: %name-%version.tar
Source1: sysstat.init

# https://github.com/sysstat/sysstat/pull/281

Patch1: %name-%version-alt-32bit-fix.patch

# Automatically added by buildreq on Wed Aug 04 2010

BuildRequires: libsensors3-devel

%description
This package provides the sar and iostat commands for the Linux operating
system, similar to their traditional UNIX counterparts. They enable system
monitoring of disk, network, and other IO activity.

%package isag
Summary: Interactive System Activity Graph
License: GPLv2+
Group: System/Base
Requires: gnuplot, sysstat = %version

BuildArch: noarch

%description isag
isag is a command that enables you to plot data stored in a daily data file
by a previous sar run.

%prep
%setup
%patch1 -p1

%build
export CFLAGS="%optflags"
export sa_lib_dir=%_libdir/sa
# we build script for daily summary that takes yesterday's data and will
# run it by cron after midnight
%configure \
--enable-yesterday \
--enable-sensors \
--disable-file-attr \
--disable-compress-manpg

sed -i 's/SADC_OPTIONS=""/SADC_OPTIONS="-S DISK"/' sysstat.sysconfig

%make_build SA_LIB_DIR="%_libdir/sa" LFLAGS="-lsensors"

%install
%makeinstall_std IGNORE_MAN_GROUP=y

install -p -m644 -D sysstat.ioconf %buildroot%_sysconfdir/sysconfig/
install -p -m644 -D sysstat.sysconfig %buildroot/etc/sysconfig/sysstat
install ./contrib/isag/isag %buildroot%_bindir
install ./contrib/isag/isag.1  %buildroot%_man1dir

install -d %buildroot%_sysconfdir/cron.d/
# Create cronjob file inline. We can easily use here rpm macros for libdir and
# thus allows for multiarch build.
cat > %buildroot%_sysconfdir/cron.d/%name <<EOF
# run system activity accounting tool every 10 minutes
*/10 * * * * root %_libdir/sa/sa1 -S DISK 1 1
# generate a daily summary of process accounting
0 2 * * * root %_libdir/sa/sa2 -A
EOF

install -pD -m755 %_sourcedir/sysstat.init %buildroot%_initrddir/sysstat
subst 's at LIBDIR at %_libdir at ' %buildroot%_initrddir/sysstat

# Install service file

mkdir -p %buildroot%_unitdir
install -m 0644 sysstat.service %buildroot%_unitdir/

# Install timer units

install -m 0644 cron/sysstat-{collect,summary}.{service,timer} %buildroot%_unitdir/

# sysstat makefiles install the docs, blow them away

rm -rf %buildroot/usr/doc

%find_lang %name

%post
%post_service sysstat

%preun
%preun_service sysstat
if [[ $1 -eq 0 ]]; then
 # Remove sa logs if removing sysstat completely
 rm -f %_logdir/sa/*
fi

%files -f %name.lang
%config(noreplace) %attr(644,root,root) %_sysconfdir/cron.d/%name
%config(noreplace) %_sysconfdir/sysconfig/%name
%config %_sysconfdir/sysconfig/sysstat.ioconf
%_bindir/*
%exclude %_bindir/isag
%_libdir/sa
%_initrddir/*
%_unitdir/*
%_man1dir/*
%exclude %_man1dir/isag.*
%_man5dir/*
%_man8dir/*
%attr(750,root,adm) %_logdir/sa
%doc CHANGES CREDITS FAQ.md

%files isag
%_bindir/isag
%_man1dir/isag.*

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin