%define version 6.3.2 %define release 16mdk Summary: Utilities for monitoring process activities Name: psacct Version: %{version} Release: %{release} License: GPL Group: Monitoring Url: ftp://ftp.gnu.org/pub/gnu/ Source: ftp://ftp.gnu.org/pub/gnu/acct/acct-%version.tar.bz2 Source1: psacct.logrotate Source2: psacct.initscript Patch0: psacct-log.patch.bz2 Patch1: psacct-6.3.2-info.patch.bz2 Patch2: psacct-6.3.2-biarch-utmp.patch.bz2 Buildroot: %{_tmppath}/%{name}-%{version}-root Prereq: /sbin/install-info Prereq: /sbin/chkconfig Prereq: rpm-helper BuildRequires: texinfo BuildRequires: autoconf2.1 >= 1:2.13-21mdk BuildRequires: automake1.4 %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 %setup -q -n acct-%version %patch0 -p0 -b .loglocation %patch1 -p1 -b .infoentry %patch2 -p1 -b .biarch-utmp # needed by patch0 ACLOCAL=aclocal-1.4 AUTOMAKE=automake-1.4 autoreconf --force %build %serverbuild %configure2_5x 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 %make #make SHELL="/bin/sh" accounting.info %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/{sbin,usr,var/log} %makeinstall_std # 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%{_bindir}/last $RPM_BUILD_ROOT%{_bindir}/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 install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/psacct install -D -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 %create_ghostfile /var/log/usracct root root 644 %create_ghostfile /var/log/savacct root root 644 %create_ghostfile /var/log/pacct root root 644 fi %_install_info accounting.info %_post_service %{name} %preun %_remove_install_info accounting.info %_preun_service %{name} %files %defattr(-,root,root) %doc README NEWS INSTALL AUTHORS ChangeLog COPYING /sbin/* %{_sbindir}/* %{_bindir}/* %{_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 * Wed Feb 09 2005 Abel Cheung <deaddog@mandrake.org> 6.3.2-16mdk - Rebuild with fixed auto* call * Sat May 22 2004 Abel Cheung <deaddog@deaddog.org> 6.3.2-15mdk - Fix logrotate script to avoid warning if psacct is not running (#1045) - Modify P1: Add a patch, then add another hack to change that patch !? WTF? - Fix rpmlint warnings * Fri May 14 2004 Nicolas Planel <nplanel@mandrakesoft.com> 6.3.2-14mdk - rebuild for cooker. * 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