Summary: Utilities for monitoring process activities. Name: psacct Version: 6.3.2 Release: 13mdk License: GPL Group: Monitoring Url: ftp://prep.ai.mit.edu/pub/gnu/ Source: ftp://prep.ai.mit.edu/pub/gnu/acct-%version.tar.bz2 Source1: psacct Source2: psacct.initscript Patch0: psacct-log.patch.bz2 Patch1: psacct-info.patch.bz2 Patch2: psacct-6.3.2-biarch-utmp.patch.bz2 Buildroot: %{_tmppath}/%{name}-%{version}-root Prereq: /sbin/install-info /sbin/chkconfig BuildRequires: texinfo perl %description The psacct package contains several utilities for monitoring process activities, including ac, lastcomm, accton and sa. The ac command displays statistics about how long users have been logged on. The lastcomm command displays information about previous executed commands. The accton command turns process accounting on or off. The sa command summarizes information about previously executed commmands. Install the psacct package if you'd like to use its utilities for monitoring process activities on your system. %prep rm -rf $RPM_BUILD_ROOT %setup -q -n acct-%version %patch0 -p0 %patch1 -p0 %patch2 -p1 -b .biarch-utmp %build %serverbuild touch texinfo.tex export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %configure --prefix=/usr \ --mandir=$RPM_BUILD_ROOT/%{_mandir} --infodir=$RPM_BUILD_ROOT/%{_infodir} perl -p -i -e "s/\/\* #undef HAVE_LINUX_ACCT_H \*\//#define HAVE_LINUX_ACCT_H/" config.h perl -p -i -e "s@/var/account@/var/log@g" files.h %make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" SHELL="/bin/sh" %make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" SHELL="/bin/sh" accounting.info %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/{sbin,usr,var/log} %makeinstall prefix=$RPM_BUILD_ROOT/usr SHELL="/bin/sh" # move accton to /sbin -- leave historical symlink mv $RPM_BUILD_ROOT%{_sbindir}/accton $RPM_BUILD_ROOT/sbin/accton ln -s ../../sbin/accton $RPM_BUILD_ROOT%{_sbindir}/accton # Because of the last command conflicting with the one from SysVinit mv $RPM_BUILD_ROOT/usr/bin/last $RPM_BUILD_ROOT/usr/bin/last-psacct mv $RPM_BUILD_ROOT%{_mandir}/man1/last.1 $RPM_BUILD_ROOT%{_mandir}/man1/last-psacct.1 touch $RPM_BUILD_ROOT/var/log/pacct $RPM_BUILD_ROOT/var/log/usracct $RPM_BUILD_ROOT/var/log/savacct mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/psacct mkdir -p $RPM_BUILD_ROOT/%{_initrddir} install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/%{_initrddir}/psacct %clean rm -rf $RPM_BUILD_ROOT %post # Create initial log files so that logrotate doesn't complain if [ $1 = 1 ]; then # first install for i in usracct savacct pacct; do %create_ghostfile /var/log/$i root root 644 done fi # we need this hack to get rid of an old, incorrect accounting info entry. if [ $1 = 0 ]; then grep -v '* accounting: (psacct)' < /etc/info-dir > /etc/info-dir.new mv -f /etc/info-dir.new /etc/info-dir fi %{__install_info} %{_infodir}/accounting.info.bz2 %{_infodir}/dir --entry="* accounting: (accounting). The GNU Process Accounting Suite." %_post_service %{name} %preun if [ $1 = 0 ]; then %{__install_info} --delete %{_infodir}/accounting.info.bz2 %{_infodir}/dir #--entry="* accounting: (accounting). The GNU Process Accounting Suite." fi %_preun_service %{name} %files %defattr(-,root,root) %doc README NEWS INSTALL AUTHORS ChangeLog COPYING /sbin/* /usr/sbin/* /usr/bin/* %{_mandir}/*/* %{_infodir}/* %config(noreplace) /etc/logrotate.d/%{name} %config(noreplace) %{_initrddir}/%{name} %ghost /var/log/pacct %ghost /var/log/usracct %ghost /var/log/savacct %changelog * Tue Apr 8 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 6.3.2-13mdk - Patch2: Handle biarch struct utmp * Fri Jan 4 2002 Frederic Lepied <flepied@mandrakesoft.com> 6.3.2-12mdk - corrected log file creation * Fri Dec 21 2001 Warly <warly@mandrakesoft.com> 6.3.2-11mdk - include the initscript in package * Wed Nov 14 2001 Frederic Lepied <flepied@mandrakesoft.com> 6.3.2-10mdk - put accton on /sbin and keep symbolic link - start/stop is done in initscripts * Thu Oct 04 2001 Philippe Libat <philippe@mandrakesoft.com> 6.3.2-9mdk - fix ghost creation, psacct.init * Mon Sep 03 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 6.3.2-8mdk - Correct logrotate entry * Fri Mar 30 2001 Frederic Lepied <flepied@mandrakesoft.com> 6.3.2-7mdk - use new server macro * Tue Mar 13 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 6.3.2-6mdk - add logrotate entry * Thu Nov 2 2000 Frederic Lepied <flepied@mandrakesoft.com> 6.3.2-5mdk - use RPM_OPT_FLAGS. - force default dir to /var/log instead of /var/account (FHS). - added an initscript. - make /var/log/* ghost files. * Mon Sep 04 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> %version-4mdk - fix the conflict with SysVinit : - Rename the psacct provided 'last' command to 'last-psacct' - Rename the psacct provided 'last.1' manpage to 'last-psacct.1' - Specfile do not specify each binary but directory which contain them * Tue Aug 29 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> %version-3mdk - use %{_mandir} & noreplace - cleanup - logfile created in %post, removed in %preun * Thu Apr 13 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> %version-2mdk - Fix bad tag value. - usr /usr/sbin not /sbin. * Tue Mar 21 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> %version-1mdk - Update to 6.3.2 - User %version in tag. - Don't run autoconf, just the configure script. - Removed a not so usefull sleep 2 :-) - Removed no more needed patch. * Mon Nov 29 1999 Florent Villard <warly@mandrakesoft.com> - built in new environment * Wed May 05 1999 Bernhard Rosenkraenzer <bero@mandrakesoft.com> - Mandrake adaptions - handle RPM_OPT_FLAGS * Mon Apr 05 1999 Preston Brown <pbrown@redhat.com> - wrap post script with reference count. * Tue Mar 23 1999 Preston Brown <pbrown@redhat.com> - install-info sucks. Still. * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> - auto rebuild in the new build environment (release 8) * Thu Mar 18 1999 Bill Nottingham <notting@redhat.com> - #define HAVE_LINUX_ACCT_H too, so it works. :) * Sun Aug 16 1998 Jeff Johnson <jbj@redhat.com> - accton needs to be accessible to /etc/rc.d/init.d/halt * Fri May 08 1998 Erik Troan <ewt@redhat.com> - install-info sucks * Mon Apr 27 1998 Prospector System <bugs@redhat.com> - translations modified for de, fr, tr * Thu Oct 23 1997 Donnie Barnes <djb@redhat.com> - updated from 6.2 to 6.3 * Mon Jul 21 1997 Erik Troan <ewt@redhat.com> - built against glibc