diff --git a/acct-6.3.2-exit.patch b/acct-6.3.2-exit.patch new file mode 100644 index 0000000..d2023cc --- /dev/null +++ b/acct-6.3.2-exit.patch @@ -0,0 +1,11 @@ +--- acct-6.3.2/accton.c.exit Sat Sep 1 22:21:41 2001 ++++ acct-6.3.2/accton.c Sat Sep 1 22:23:36 2001 +@@ -108,7 +108,7 @@ + acct_file = argv[optind]; + } + +- if (acct (acct_file) == -1) ++ if (acct (acct_file) == -1 && errno != ENOSYS) + { + int err; + extern int errno; diff --git a/psacct.spec b/psacct.spec new file mode 100644 index 0000000..bf2b03e --- /dev/null +++ b/psacct.spec @@ -0,0 +1,156 @@ +#!/bin/bash +Summary: Utilities for monitoring process activities. +Name: psacct +Version: 6.3.2 +Release: 8 +License: GPL +Group: Applications/System +Source: ftp://ftp.gnu.org/pub/gnu/acct-6.3.2.tar.gz +Patch0: acct-6.3.2-config.patch +Patch1: acct-6.3.2-exit.patch +Buildroot: %{_tmppath}/%{name}-%{version}-root +Prereq: /sbin/install-info +BuildRequires: autoconf + +%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. + +%prep +%setup -q -n acct-%{version} +%patch0 -p0 -b .config +%patch1 -p1 + +%build +autoconf +%configure +sed -e "s/\/\* #undef HAVE_LINUX_ACCT_H \*\//#define HAVE_LINUX_ACCT_H/" config.h > config.h.new +mv -f config.h.new config.h +touch texinfo.tex +make + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT{/sbin,%{_bindir},%{_mandir},%{_sbindir},%{_var}/log} +%{makeinstall} + +# 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 + +gzip -9f $RPM_BUILD_ROOT%{_infodir}/* +touch $RPM_BUILD_ROOT%{_var}/log/pacct +touch $RPM_BUILD_ROOT%{_var}/log/usracct +touch $RPM_BUILD_ROOT%{_var}/log/savacct + +mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d +cat > $RPM_BUILD_ROOT/etc/logrotate.d/psacct < /etc/info-dir.new + mv -f /etc/info-dir.new /etc/info-dir + /sbin/install-info %{_infodir}/accounting.info.gz %{_infodir}/dir --entry="* accounting: (accounting). The GNU Process Accounting Suite." +fi + +%preun +if [ $1 = 0 ]; then + /sbin/install-info --delete %{_infodir}/accounting.info.gz %{_infodir}/dir --entry="* accounting: (accounting). The GNU Process Accounting Suite." 2>/dev/null +fi + +%files +%defattr(-,root,root) +%attr(0600,root,root) %config /var/log/pacct +%attr(0600,root,root) %config /var/log/usracct +%attr(0600,root,root) %config /var/log/savacct +%attr(0644,root,root) %config(noreplace) /etc/logrotate.d/* +/sbin/accton +%{_sbindir}/accton +%{_sbindir}/sa +%{_sbindir}/dump-utmp +%{_sbindir}/dump-acct +%{_bindir}/ac +%{_bindir}/lastcomm +%{_mandir}/man1/ac.1* +%{_mandir}/man1/lastcomm.1* +%{_mandir}/man8/sa.8* +%{_mandir}/man8/accton.8* +%{_infodir}/accounting.info.gz + +%changelog +* Sat Sep 01 2001 Florian La Roche +- do not fail for ENOSYS to silently support kernels without + process accounting + +* Sun Aug 26 2001 Mike A. Harris 6.3.2-7 +- Change spec tag Copyright -> License +- change logrotate to rotate daily, and keep 1 month (31 days) of data + +* Sun Jun 24 2001 Elliot Lee +- Bump release + rebuild. + +* Mon Feb 02 2001 Helge Deller +- added logrotate file for /var/log/pacct (#24900) + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Mon Jun 5 2000 Nalin Dahyabhai +- FHS fixes + +* Sat May 6 2000 Bill Nottingham +- fix for new patch + +* Thu Feb 03 2000 Nalin Dahyabhai +- update to 6.3.2 + +* Mon Apr 05 1999 Preston Brown +- wrap post script with reference count. + +* Tue Mar 23 1999 Preston Brown +- install-info sucks. Still. + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 8) + +* Thu Mar 18 1999 Bill Nottingham +- #define HAVE_LINUX_ACCT_H too, so it works. :) + +* Sun Aug 16 1998 Jeff Johnson +- accton needs to be accessible to /etc/rc.d/init.d/halt + +* Fri May 08 1998 Erik Troan +- install-info sucks + +* Mon Apr 27 1998 Prospector System +- translations modified for de, fr, tr + +* Thu Oct 23 1997 Donnie Barnes +- updated from 6.2 to 6.3 + +* Mon Jul 21 1997 Erik Troan +- built against glibc