cvsdist 28c7f6f
# Our /usr/bin/last is in the SysVInit packae
cvsdist 28c7f6f
%define with_last	0
cvsdist 46cc9b7
cvsdist ef51846
%define FHS_compliant 1
cvsdist ef51846
cvsdist ef51846
%if %{FHS_compliant}
cvsdist ef51846
%define accounting_logdir	/var/account
cvsdist ef51846
%else
cvsdist ef51846
%define accounting_logdir	/var/log
cvsdist ef51846
%endif
cvsdist ef51846
cvsdist 95d8b5f
Summary: Utilities for monitoring process activities.
cvsdist 95d8b5f
Name: psacct
cvsdist 95d8b5f
Version: 6.3.2
02a7e70
Release: 37.1
cvsdist 95d8b5f
License: GPL
cvsdist 95d8b5f
Group: Applications/System
cvsdist 95d8b5f
Source: ftp://ftp.gnu.org/pub/gnu/acct-6.3.2.tar.gz
cvsdist ef51846
Source1: psacct.init
cvsdist ef51846
# This dumb patch breaks FHS 2.2 compliance, so it is disabled now except
cvsdist ef51846
# in 7.x builds.  Do not use it in new products.
cvsdist 95d8b5f
Patch0: acct-6.3.2-config.patch
cvsdist 95d8b5f
Patch1: acct-6.3.2-exit.patch
cvsdist ef51846
# Fixes some broken calls to ctime() on 64bit arch's <mharris@redhat.com>
cvsdist ef51846
Patch2: psacct-6.3.2-64bit-fixes.patch
ccb 8ca6311
Patch3: psacct-6.3.2-hzval-fixes2.patch
cvsdist f55e500
Patch4: acct-6.3.2-pts.patch
ccb 8ca6311
Patch5: psacct-6.3.2-strictmatch.patch
Ivana Varekova 422266e
Patch6: psacct-6.3.2-sa-manfix.patch
cvsdist ef51846
cvsdist 95d8b5f
Buildroot: %{_tmppath}/%{name}-%{version}-root
cvsdist 95d8b5f
Prereq: /sbin/install-info
cvsdist 95d8b5f
BuildRequires: autoconf
cvsdist 95d8b5f
cvsdist ef51846
# This conflict is to avoid psacct being forced on by old initscripts now that
cvsdist ef51846
# we have a proper initscript in place. initscripts 6.55 and later are fixed.
cvsdist ef51846
Conflicts: initscripts < 6.55
cvsdist ef51846
cvsdist 95d8b5f
%description
cvsdist 95d8b5f
The psacct package contains several utilities for monitoring process
cvsdist 95d8b5f
activities, including ac, lastcomm, accton and sa. The ac command
cvsdist 95d8b5f
displays statistics about how long users have been logged on. The
cvsdist 95d8b5f
lastcomm command displays information about previous executed
cvsdist 95d8b5f
commands. The accton command turns process accounting on or off. The
cvsdist 95d8b5f
sa command summarizes information about previously executed
cvsdist 95d8b5f
commmands.
cvsdist 95d8b5f
cvsdist 95d8b5f
%prep
cvsdist 95d8b5f
%setup -q -n acct-%{version}
cvsdist ef51846
cvsdist ef51846
%if ! %{FHS_compliant}
cvsdist 95d8b5f
%patch0 -p0 -b .config
cvsdist ef51846
%endif
cvsdist ef51846
%patch1 -p1 -b .psacct-exit
cvsdist ef51846
%patch2 -p0 -b .64bit-fixes
cvsdist f55e500
%patch3 -p1 -b .hz
cvsdist f55e500
%patch4 -p1 -b .pts
ccb 8ca6311
%patch5 -p1 -b .strictmatch
Ivana Varekova 422266e
%patch6 -p1 -b .tio-avio
cvsdist 95d8b5f
cvsdist 95d8b5f
%build
cvsdist ef51846
%if ! %{FHS_compliant}
cvsdist 95d8b5f
autoconf
cvsdist ef51846
%endif
cvsdist ef51846
cvsdist 95d8b5f
%configure
cvsdist 95d8b5f
sed -e "s/\/\* #undef HAVE_LINUX_ACCT_H \*\//#define HAVE_LINUX_ACCT_H/" config.h > config.h.new
ccb 8ca6311
sed -e "s;#define HAVE_ACIO 1;/* #undef HAVE_ACIO */;" config.h.new > config.h
cvsdist 95d8b5f
touch texinfo.tex
cvsdist 95d8b5f
make
cvsdist 95d8b5f
cvsdist 95d8b5f
%install
cvsdist 95d8b5f
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
cvsdist ef51846
mkdir -p $RPM_BUILD_ROOT{/sbin,%{_bindir},%{_mandir},%{_sbindir}}
cvsdist 95d8b5f
%{makeinstall}
cvsdist 95d8b5f
cvsdist 95d8b5f
# move accton to /sbin -- leave historical symlink
cvsdist 95d8b5f
mv $RPM_BUILD_ROOT%{_sbindir}/accton $RPM_BUILD_ROOT/sbin/accton
cvsdist 95d8b5f
ln -s ../../sbin/accton $RPM_BUILD_ROOT%{_sbindir}/accton
cvsdist 95d8b5f
cvsdist 95d8b5f
gzip -9f $RPM_BUILD_ROOT%{_infodir}/*
cvsdist ef51846
mkdir -p $RPM_BUILD_ROOT%{accounting_logdir}
cvsdist ef51846
touch $RPM_BUILD_ROOT%{accounting_logdir}/pacct
cvsdist 95d8b5f
cvsdist ef51846
# Create logrotate config file
cvsdist 95d8b5f
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
cvsdist 95d8b5f
cat > $RPM_BUILD_ROOT/etc/logrotate.d/psacct <
cvsdist 95d8b5f
# Logrotate file for psacct RPM
cvsdist 95d8b5f
 
cvsdist ef51846
%{accounting_logdir}/pacct {
Ivana Varekova e22fdf2
#prerotate loses accounting records, let's no
Ivana Varekova e22fdf2
#   prerotate
Ivana Varekova e22fdf2
#       %{_sbindir}/accton
Ivana Varekova e22fdf2
#   endscript
Ivana Varekova e22fdf2
    compress
Ivana Varekova e22fdf2
    delaycompress
Ivana Varekova e22fdf2
    notifempty
Ivana Varekova e22fdf2
    daily
Ivana Varekova e22fdf2
    rotate 31
Ivana Varekova e22fdf2
    create 0600 root root
Ivana Varekova e22fdf2
    postrotate
Ivana Varekova e22fdf2
	%{_sbindir}/accton %{accounting_logdir}/pacct
Ivana Varekova e22fdf2
    endscript
cvsdist 95d8b5f
}     
cvsdist 95d8b5f
EOF
cvsdist 95d8b5f
cvsdist ef51846
# Install initscript
cvsdist ef51846
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
cvsdist ef51846
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/psacct
cvsdist ef51846
cvsdist 28c7f6f
%if ! %{with_last}
cvsdist 28c7f6f
rm -f $RPM_BUILD_ROOT%{_bindir}/last $RPM_BUILD_ROOT%{_mandir}/man1/last.1*
cvsdist 28c7f6f
%endif
cvsdist 95d8b5f
cvsdist 95d8b5f
%clean
cvsdist 95d8b5f
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
cvsdist 95d8b5f
cvsdist 95d8b5f
%post
cvsdist 46cc9b7
/sbin/chkconfig --add psacct
cvsdist 95d8b5f
# we need this hack to get rid of an old, incorrect accounting info entry.
cvsdist 95d8b5f
if [ $1 = 0 ]; then
cvsdist 28c7f6f
  test -f /etc/info-dir && {
cvsdist 28c7f6f
    grep -v '* accounting: (psacct)' < /etc/info-dir > /etc/info-dir.new
cvsdist 28c7f6f
    mv -f /etc/info-dir.new /etc/info-dir
cvsdist 28c7f6f
  }
cvsdist 95d8b5f
  /sbin/install-info %{_infodir}/accounting.info.gz %{_infodir}/dir --entry="* accounting: (accounting).            The GNU Process Accounting Suite."
cvsdist 95d8b5f
fi
cvsdist 95d8b5f
cvsdist 95d8b5f
%preun
cvsdist 95d8b5f
if [ $1 = 0 ]; then
cvsdist ef51846
  /sbin/install-info --delete %{_infodir}/accounting.info.gz %{_infodir}/dir --entry="* accounting: (accounting).            The GNU Process Accounting Suite." 2>/dev/null
ccb 8ca6311
  /sbin/service psacct stop > /dev/null 2>&1	
cvsdist ef51846
  /sbin/chkconfig --del psacct
cvsdist 95d8b5f
fi
cvsdist 95d8b5f
cvsdist 95d8b5f
%files
cvsdist 95d8b5f
%defattr(-,root,root)
cvsdist ef51846
%if %{FHS_compliant}
cvsdist ef51846
%dir /var/account
cvsdist ef51846
%endif
cvsdist ef51846
/etc/rc.d/init.d/psacct
cvsdist ef51846
%attr(0600,root,root)	%config %{accounting_logdir}/pacct
cvsdist 95d8b5f
%attr(0644,root,root)	%config(noreplace) /etc/logrotate.d/*
cvsdist 95d8b5f
/sbin/accton
cvsdist 95d8b5f
%{_sbindir}/accton
cvsdist 95d8b5f
%{_sbindir}/sa
cvsdist 95d8b5f
%{_sbindir}/dump-utmp
cvsdist 95d8b5f
%{_sbindir}/dump-acct
cvsdist 95d8b5f
%{_bindir}/ac
cvsdist 28c7f6f
%if %{with_last}
cvsdist 28c7f6f
%{_bindir}/last
cvsdist 28c7f6f
%endif
cvsdist 95d8b5f
%{_bindir}/lastcomm
cvsdist 95d8b5f
%{_mandir}/man1/ac.1*
cvsdist 28c7f6f
%if %{with_last}
cvsdist 28c7f6f
%{_mandir}/man1/last.1*
cvsdist 28c7f6f
%endif
cvsdist 95d8b5f
%{_mandir}/man1/lastcomm.1*
cvsdist 95d8b5f
%{_mandir}/man8/sa.8*
cvsdist 95d8b5f
%{_mandir}/man8/accton.8*
cvsdist 95d8b5f
%{_infodir}/accounting.info.gz
cvsdist 95d8b5f
cvsdist 95d8b5f
%changelog
02a7e70
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
02a7e70
- rebuilt
02a7e70
Ivana Varekova 38272b7
* Fri Mar  4 2005 Ivana Varekova <varekova@redhat.com> 6.3.2-37
Ivana Varekova 38272b7
- rebuilt
Ivana Varekova 38272b7
Ivana Varekova 422266e
* Tue Feb 15 2005 Ivana Varekova <varekova@redhat.com> 6.3.2-36
Ivana Varekova 422266e
- fix sa manpage - necessary becouse of bug #43294 and previous patch
Ivana Varekova 422266e
Ivana Varekova e22fdf2
* Tue Feb 15 2005 Ivana Varekova <varekova@redhat.com> 6.3.2-35
Ivana Varekova e22fdf2
- fix #147782 logrotate script error
Ivana Varekova e22fdf2
ccb 8ca6311
* Thu Feb  3 2005 Charles Bennett <ccb@redhat.com> 6.3.2-33.fc4
ccb 8ca6311
- rhbz 133077: logrotate fixed to continue accounting during rotate
ccb 8ca6311
- rhbz 141802: lastcomm was not handling all forms of --strict-match
ccb 8ca6311
- rhbz 141971: rpm -e no longer leaves /var/lock/subsys/psacct
ccb 8ca6311
- rhbz 43294: sa will never report any io because the kernel doesn't
ccb 8ca6311
   provide it.  Tweaked to ignore ac_io in acct.h
ccb 8ca6311
- integrate lastcomm hz patch from RH support
ccb 8ca6311
cvsdist f55e500
* Wed Sep  1 2004 root <ccb@redhat.com> - 6.3.2-31
cvsdist f55e500
- integrate JFenlason's hz patch, improve pts device reporting
cvsdist 305ee03
cvsdist 9a5ccf2
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
cvsdist 9a5ccf2
- rebuilt
cvsdist 9a5ccf2
cvsdist 9e2ba31
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
cvsdist 9e2ba31
- rebuilt
cvsdist 9e2ba31
cvsdist 28c7f6f
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
cvsdist 28c7f6f
- rebuilt
cvsdist 28c7f6f
cvsdist 28c7f6f
* Thu Dec 26 2002 Florian La Roche <Florian.LaRoche@redhat.de>
cvsdist 28c7f6f
- make /etc/info-dir an optional file
cvsdist 28c7f6f
cvsdist 28c7f6f
* Wed Nov 13 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-25
cvsdist 28c7f6f
- Added with_last conditional to disable /usr/bin/last because ours is in
cvsdist 28c7f6f
  the SysVInit package.  This fixes unpackaged files terminate build prob.
cvsdist 28c7f6f
cvsdist 7defba6
* Thu Aug 22 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-24
cvsdist 7defba6
- Fixed initscript reload/restart by creating start/stop functions and
cvsdist 7defba6
  making everything use them (#72261)
cvsdist 7defba6
cvsdist 46cc9b7
* Tue Aug  6 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-23
cvsdist 46cc9b7
- Fixed chkconfig issue in rpm scripts (#61191)
cvsdist 46cc9b7
- Excludearch ia64, not taking the time to debug/troubleshoot random
cvsdist 46cc9b7
  buildsystem failure due to higher priorities.
cvsdist 46cc9b7
cvsdist b603b35
* Mon Jul 08 2002 Elliot Lee <sopwith@redhat.com>
cvsdist b603b35
- Take the time to make sure things get through on all archs, by simply
cvsdist 46cc9b7
  running it through the build system.
cvsdist b603b35
cvsdist b603b35
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
cvsdist b603b35
- automated rebuild
cvsdist b603b35
cvsdist b603b35
* Thu May 23 2002 Tim Powers <timp@redhat.com>
cvsdist b603b35
- automated rebuild
cvsdist b603b35
cvsdist dffc79e
* Tue Mar 27 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-19
cvsdist dffc79e
- Made initscript touch/chmod accounting file if it is not present during
cvsdist dffc79e
  startup, to ensure accounting works properly when enabled.
cvsdist dffc79e
cvsdist ef51846
* Mon Mar 26 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-18
cvsdist ef51846
- Fixed duh in initscript pointing to wrong accounting file (#61939)
cvsdist ef51846
cvsdist ef51846
* Sun Mar 17 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-17
cvsdist ef51846
- Removed the files usracct and savacct, which are not used by psacct
cvsdist ef51846
  utilities at all, but by the sa program.  Our sa uses files in a different
cvsdist ef51846
  location, and so these files are unused and unnecessary.
cvsdist ef51846
cvsdist ef51846
* Sat Mar 16 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-16
cvsdist ef51846
- Added chkconfig to post and preun scripts for bug (#61191)
cvsdist ef51846
cvsdist ef51846
* Tue Mar 12 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-15
cvsdist ef51846
- Added new feature - psacct initscript now controls process accounting so
cvsdist ef51846
  that it is not just forced on if installed as was the previous behaviour
cvsdist ef51846
- Modified the initscripts package to not force psacct on anymore and made
cvsdist ef51846
  the new psacct-6.3.2-15 conflict with previous initscripts packages.
cvsdist ef51846
- Fixed logrotate config to set perms/owner of new log files, and closed
cvsdist ef51846
  bug (#54165)
cvsdist ef51846
cvsdist ef51846
* Thu Mar  7 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-14
cvsdist ef51846
- Fixed 64bit bug in calls to ctime() in lastcomm and dump-utmp (#60712)
cvsdist ef51846
cvsdist ef51846
* Wed Mar  6 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-13
cvsdist ef51846
- Removed Build_7x flag, added FHS_compliant flag, reworked specfile to use new
cvsdist ef51846
  flag, and fixed bug (#60716)
cvsdist ef51846
cvsdist ef51846
* Thu Feb 28 2002 Bill Nottingham <notting@redhat.com> 6.3.2-12
cvsdist ef51846
- rebuild in new environment for FHS correctness
cvsdist ef51846
cvsdist ef51846
* Thu Jan 31 2002 Mike A. Harris <mharris@redhat.com> 6.3.2-11
cvsdist ef51846
- Conditionalized acct-6.3.2-config.patch to only be applied for RHL 7.x
cvsdist ef51846
  builds, as it breaks FHS compliance by putting files in nonstandard
cvsdist ef51846
  locations.  Also fixed up other places in specfile for FHS 2.2.
cvsdist ef51846
- Added acct-6.3.2-I-HATE-GNU-AUTOCONK.patch because I hate GNU autoconk
cvsdist ef51846
  really really badly.
cvsdist ef51846
  
cvsdist ef51846
- Bumped to -11 to avoid buildsystem stupidness
cvsdist ef51846
cvsdist 904c018
* Thu Sep 06 2001 Mike A. Harris <mharris@redhat.com> 6.3.2-9
cvsdist 904c018
- Fixed bug (#53307) psacct is enabled by default, and the log files
cvsdist 904c018
  are huge, and will fill the disk up very quickly.  logrotate will
cvsdist 904c018
  now compress them daily.
cvsdist 904c018
cvsdist 904c018
* Sat Sep 01 2001 Florian La Roche <Florian.LaRoche@redhat.de> 6.3.2-8
cvsdist 95d8b5f
- do not fail for ENOSYS to silently support kernels without
cvsdist 95d8b5f
  process accounting
cvsdist 95d8b5f
cvsdist 95d8b5f
* Sun Aug 26 2001 Mike A. Harris <mharris@redhat.com> 6.3.2-7
cvsdist 95d8b5f
- Change spec tag Copyright -> License
cvsdist 95d8b5f
- change logrotate to rotate daily, and keep 1 month (31 days) of data
cvsdist 95d8b5f
cvsdist 95d8b5f
* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
cvsdist 95d8b5f
- Bump release + rebuild.
cvsdist 95d8b5f
cvsdist 95d8b5f
* Mon Feb 02 2001 Helge Deller <hdeller@redhat.de>
cvsdist 95d8b5f
- added logrotate file for /var/log/pacct (#24900)
cvsdist 95d8b5f
cvsdist 95d8b5f
* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
cvsdist 95d8b5f
- automatic rebuild
cvsdist 95d8b5f
cvsdist 95d8b5f
* Mon Jun  5 2000 Nalin Dahyabhai <nalin@redhat.com>
cvsdist 95d8b5f
- FHS fixes
cvsdist 95d8b5f
cvsdist 95d8b5f
* Sat May  6 2000 Bill Nottingham <notting@redhat.com>
cvsdist 95d8b5f
- fix for new patch
cvsdist 95d8b5f
cvsdist 95d8b5f
* Thu Feb 03 2000 Nalin Dahyabhai <nalin@redhat.com>
cvsdist 95d8b5f
- update to 6.3.2
cvsdist 95d8b5f
cvsdist 95d8b5f
* Mon Apr 05 1999 Preston Brown <pbrown@redhat.com>
cvsdist 95d8b5f
- wrap post script with reference count.
cvsdist 95d8b5f
cvsdist 95d8b5f
* Tue Mar 23 1999 Preston Brown <pbrown@redhat.com>
cvsdist 95d8b5f
- install-info sucks.  Still.
cvsdist 95d8b5f
cvsdist 95d8b5f
* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
cvsdist 95d8b5f
- auto rebuild in the new build environment (release 8)
cvsdist 95d8b5f
cvsdist 95d8b5f
* Thu Mar 18 1999 Bill Nottingham <notting@redhat.com>
cvsdist 95d8b5f
- #define HAVE_LINUX_ACCT_H too, so it works. :)
cvsdist 95d8b5f
cvsdist 95d8b5f
* Sun Aug 16 1998 Jeff Johnson <jbj@redhat.com>
cvsdist 95d8b5f
- accton needs to be accessible to /etc/rc.d/init.d/halt
cvsdist 95d8b5f
cvsdist 95d8b5f
* Fri May 08 1998 Erik Troan <ewt@redhat.com>
cvsdist 95d8b5f
- install-info sucks
cvsdist 95d8b5f
cvsdist 95d8b5f
* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
cvsdist 95d8b5f
- translations modified for de, fr, tr
cvsdist 95d8b5f
cvsdist 95d8b5f
* Thu Oct 23 1997 Donnie Barnes <djb@redhat.com>
cvsdist 95d8b5f
- updated from 6.2 to 6.3
cvsdist 95d8b5f
cvsdist 95d8b5f
* Mon Jul 21 1997 Erik Troan <ewt@redhat.com>
cvsdist 95d8b5f
- built against glibc