- upgrade to new upstream release

- remove obsolete patches
- remove FHS_compliant condition
- remove obsolete conflicts with initscripts
- info installation fix
- modified man-pages patch
- spec fixes
This commit is contained in:
Jan Görig 2010-11-09 17:30:13 +01:00
parent 123237a896
commit badd272687
9 changed files with 112 additions and 130 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
acct-6.5.4.tar.gz
/acct-6.5.5.tar.gz

View File

@ -1,29 +0,0 @@
--- configure.in.sopwith Tue Mar 10 13:09:45 1998
+++ configure.in Thu Feb 3 13:50:40 2000
@@ -167,7 +167,7 @@
#ifndef ACCT_FILE
# if defined(__FreeBSD__) || defined(__linux__)
-# define ACCT_FILE "/var/account/pacct"
+# define ACCT_FILE "/var/log/pacct"
# else
# if defined(__NetBSD__)
# define ACCT_FILE "/var/account/acct"
@@ -187,7 +187,7 @@
#ifndef SAVACCT_FILE
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
-# define SAVACCT_FILE "/var/account/savacct"
+# define SAVACCT_FILE "/var/log/savacct"
# else
# if defined(sun) || defined(AMIX)
# define SAVACCT_FILE "/var/adm/savacct"
@@ -203,7 +203,7 @@
#ifndef USRACCT_FILE
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
-# define USRACCT_FILE "/var/account/usracct"
+# define USRACCT_FILE "/var/log/usracct"
# else
# if defined(sun) || defined(AMIX)
# define USRACCT_FILE "/var/adm/usracct"

View File

@ -1,18 +0,0 @@
diff -up acct-6.5.4/accton.8.pom acct-6.5.4/accton.8
--- acct-6.5.4/accton.8.pom 2010-01-23 20:17:45.000000000 +0100
+++ acct-6.5.4/accton.8 2010-08-16 10:41:03.000000000 +0200
@@ -53,4 +53,4 @@ The GNU accounting utilities were writte
texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>.
.SH "SEE ALSO"
.BR acct (5),
-.BR ac (8)
+.BR ac (1)
diff -up acct-6.5.4/sa.8.pom acct-6.5.4/sa.8
--- acct-6.5.4/sa.8.pom 2010-08-16 10:33:59.000000000 +0200
+++ acct-6.5.4/sa.8 2010-08-16 10:40:37.000000000 +0200
@@ -422,4 +422,4 @@ The GNU accounting utilities were writte
texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>.
.SH "SEE ALSO"
.BR acct (5),
-.BR ac (8)
+.BR ac (1)

12
acct-6.5.5-direntry.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up ./acct-6.5.5/accounting.texi.direntry ./acct-6.5.5/accounting.texi
--- acct-6.5.5/accounting.texi.direntry 2010-10-23 13:33:27.000000000 +0200
+++ acct-6.5.5/accounting.texi 2010-11-09 16:33:58.369160001 +0100
@@ -5,7 +5,7 @@
@dircategory GNU Utilities
@direntry
-* acct: (acct). The GNU Accounting utilities for process and login accounting
+* acct: (accounting). The GNU Accounting utilities for process and login accounting
@end direntry

View File

@ -39,36 +39,90 @@ diff -up acct-6.3.2/dump-acct.8.orig acct-6.3.2/dump-acct.8
+.SH SEE ALSO
+accton (8), lastcomm (1)
+
diff -up acct-6.3.2/dump-utmp.8.orig acct-6.3.2/dump-utmp.8
--- acct-6.3.2/dump-utmp.8.orig 2009-12-02 13:57:05.000000000 +0100
+++ acct-6.3.2/dump-utmp.8 2009-12-02 13:57:05.000000000 +0100
@@ -0,0 +1,29 @@
diff -up ./acct-6.5.5/dump-utmp.8.orig ./acct-6.5.5/dump-utmp.8
--- acct-6.5.5/dump-utmp.8.orig 2010-10-23 13:33:27.000000000 +0200
+++ acct-6.5.5/dump-utmp.8 2010-11-09 17:08:53.000000000 +0100
@@ -1,65 +1,29 @@
-.TH DUMP-UTMP 8 "2006-04-22" "6.5.1" "GNU Accounting Utilities"
+.\" Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
+.\" Written by Ivana Hutarova Varekova <varekova@redhat.com>
+.TH DUMP_UTMP 8 "2009 December 2" "Linux accounting system"
+
+.SH NAME
.SH NAME
-dump-utmp \- print an utmp file in human-readable format.
+dump\-utmp \- print a utmp file in human-readable format
+
-.SH SYNOPSIS
-.B dump-acct
-.RB [\| \-r \||\| \-\-reverse \|]
-.RB [\| \-R \||\| \-\-raw \|]
-.RB [\| \-n \||\| \-\-num
-.IR recs \|]
-.RB [\| \-h \||\| \-\-help \|]
-.RB [\|
-.IR files \|]
-
-.SH DESCRIPTION
-.B dump-acct
-.I filename
-prints a list of all logins. This list is usually written in
-.IR /var/log/wtmp .
-.LP
-All fields are separated by vertical line. Fields are:
-.IR "user name" ,
-.IR tty ,
-.IR type ,
-.IR id ,
-.IR pid ,
-.IR hostaddr ,
-.IR host ,
-.IR time .
+.SH SYNOPSYS
+\fBdump-utmp\fR [\fB-hrR\fR] [\fB-n\fR <\fIrecs\fR>] <\fBfiles\fR>
+ [\fB--num\fR <\fIrecs\fR>] [\fB--raw\fR] [\fB--reverse\fR] [\fB--help\fR]
+
+.SH OPTIONS
.SH OPTIONS
+The following options are supported:
+.TP
.TP
-.B \-h, \-\-help
-Prints the usage string and default locations of system files to standard output
-and exits.
-.TP
-.B \-n, \-\-num recs
-Number of lines to print.
+.B -h, --help
+Print a help message and the default location of the process accounting file
+and exit.
+.TP
.TP
-.B \-r, \-\-reverse
-Start printing from last records.
+.B -r, --reverse
+Print the output in reverse order.
+.TP
.TP
-.B \-R, \-\-raw
-Print raw records, not human-readable.
-
-.SH FILES
+.B -R, --raw
+The records will be printed without any parsing.
+.TP
.TP
-.I wtmp
-The system wide login record file. See
-.BR wtmp (5)
-for further details.
+.B -n, --num NUMRECS
+Display only the first NUMRECS number of records.
+
+.SH SEE ALSO
.SH SEE ALSO
-.BR login (1),
-.BR wtmp (5),
-.BR init (8),
-.BR sa (8).
-
-.SH AUTHOR
-The GNU accounting utilities were written by Noel Cragg <noel@gnu.ai.mit.edu>.
-.PP
-This manual page was written by Ognyan Kulev <ogi@fmi.uni-sofia.bg> and updated
-by Daniel Baumann <daniel@debian.org> for the Debian project (but may be used by
-others).
+accton (8), lastcomm (1), utmp (5)

View File

@ -1,12 +0,0 @@
diff -up acct-6.5.4/sa.c.pom acct-6.5.4/sa.c
--- acct-6.5.4/sa.c.pom 2010-02-12 02:24:11.000000000 +0100
+++ acct-6.5.4/sa.c 2010-06-25 12:32:18.000000000 +0200
@@ -280,7 +280,7 @@ int main(int argc, char *argv[])
{
int c;
- static unsigned int hzval;
+ hzval = sysconf(_SC_CLK_TCK);
program_name = argv[0];
/* Cache the page size of the machine for the PAGES_TO_KB macro */

View File

@ -1,6 +1,6 @@
# Logrotate file for psacct RPM
%{accounting_logdir}/pacct {
/var/account/pacct {
compress
delaycompress
notifempty
@ -9,7 +9,7 @@
create 0600 root root
postrotate
if /etc/init.d/psacct status >/dev/null 2>&1; then
%{_sbindir}/accton %{accounting_logdir}/pacct
%{_sbindir}/accton /var/account/pacct
fi
endscript
}

View File

@ -1,42 +1,26 @@
# Our /usr/bin/last is in the SysVInit packae
%define with_last 0
%define FHS_compliant 1
%if %{FHS_compliant}
%define accounting_logdir /var/account
%else
%define accounting_logdir /var/log
%endif
Summary: Utilities for monitoring process activities
Name: psacct
Version: 6.5.4
Release: 6%{?dist}
Version: 6.5.5
Release: 1%{?dist}
License: GPLv3+
Group: Applications/System
URL: ftp://ftp.gnu.org/pub/gnu/acct/
Source: ftp://ftp.gnu.org/pub/gnu/acct/acct-%{version}.tar.gz
Source1: psacct.init
Source2: psacct-logrotate.in
# This dumb patch breaks FHS 2.2 compliance, so it is disabled now except
# in 7.x builds. Do not use it in new products.
Patch0: acct-6.3.2-config.patch
Patch8: psacct-6.3.2-lastcomm_man.patch
Patch9: acct-6.3.2-sa_manpage.patch
Patch11: psacct-6.3.2-man-pages.patch
Patch12: psacct-6.5.4-hzval.patch
Patch13: acct-6.5.4-mp.patch
Patch1: psacct-6.3.2-lastcomm_man.patch
Patch2: acct-6.3.2-sa_manpage.patch
Patch3: psacct-6.3.2-man-pages.patch
Patch4: acct-6.5.5-direntry.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: /sbin/chkconfig /sbin/install-info
BuildRequires: autoconf
Requires: coreutils
# This conflict is to avoid psacct being forced on by old initscripts now that
# we have a proper initscript in place. initscripts 6.55 and later are fixed.
Conflicts: initscripts < 6.55
%description
The psacct package contains several utilities for monitoring process
activities, including ac, lastcomm, accton and sa. The ac command
@ -49,22 +33,13 @@ commands.
%prep
%setup -q -n acct-%{version}
%if ! %{FHS_compliant}
%patch0 -p0 -b .config
%endif
%patch8 -p1 -b .man
%patch9 -p1 -b .pct
%patch11 -p1 -b .new
%patch12 -p1 -b .hzval
%patch13 -p1 -b .mp
%patch1 -p1 -b .man
%patch2 -p1 -b .pct
%patch3 -p1 -b .new
%patch4 -p1 -b .direntry
%build
%if ! %{FHS_compliant}
autoconf
%endif
%configure --enable-linux-multiformat
touch texinfo.tex
make
%install
@ -73,7 +48,7 @@ mkdir -p $RPM_BUILD_ROOT{/sbin,%{_bindir},%{_mandir},%{_sbindir}}
make install prefix=$RPM_BUILD_ROOT%{_prefix} \
bindir=$RPM_BUILD_ROOT%{_bindir} sbindir=$RPM_BUILD_ROOT%{_sbindir} \
infodir=$RPM_BUILD_ROOT%{_datadir}/info mandir=$RPM_BUILD_ROOT%{_mandir}
cp dump-acct.8 dump-utmp.8 $RPM_BUILD_ROOT%{_mandir}/man8/
cp dump-acct.8 $RPM_BUILD_ROOT%{_mandir}/man8/
# move accton to /sbin -- leave historical symlink
mv $RPM_BUILD_ROOT%{_sbindir}/accton $RPM_BUILD_ROOT/sbin/accton
@ -82,13 +57,12 @@ ln -s ../../sbin/accton $RPM_BUILD_ROOT%{_sbindir}/accton
# remove unwanted file
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
gzip -9f $RPM_BUILD_ROOT%{_infodir}/*
mkdir -p $RPM_BUILD_ROOT%{accounting_logdir}
touch $RPM_BUILD_ROOT%{accounting_logdir}/pacct
mkdir -p $RPM_BUILD_ROOT/var/account
touch $RPM_BUILD_ROOT/var/account/pacct
# Create logrotate config file
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
sed -e 's|%%{accounting_logdir}|%{accounting_logdir}|g;s|%%{_sbindir}|%{_sbindir}|g' %{SOURCE2} > $RPM_BUILD_ROOT/etc/logrotate.d/psacct
sed -e 's|%%{_sbindir}|%{_sbindir}|g' %{SOURCE2} > $RPM_BUILD_ROOT/etc/logrotate.d/psacct
# Install initscript
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
@ -103,19 +77,12 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/last $RPM_BUILD_ROOT%{_mandir}/man1/last.1*
%post
/sbin/chkconfig --add psacct
# we need this hack to get rid of an old, incorrect accounting info entry.
if [ $1 = 0 ]; then
test -f /etc/info-dir && {
grep -v '* accounting: (psacct)' < /etc/info-dir > /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
touch %{accounting_logdir}/pacct
/sbin/install-info %{_infodir}/accounting.info %{_infodir}/dir || :
touch /var/account/pacct
%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
/sbin/install-info --delete %{_infodir}/accounting.info %{_infodir}/dir || :
/sbin/service psacct stop > /dev/null 2>&1
/sbin/chkconfig --del psacct
fi
@ -123,11 +90,9 @@ fi
%files
%defattr(-,root,root,-)
%doc README COPYING
%if %{FHS_compliant}
%dir /var/account
%endif
/etc/rc.d/init.d/psacct
%attr(0600,root,root) %ghost %config %{accounting_logdir}/pacct
%attr(0600,root,root) %ghost %config /var/account/pacct
%attr(0644,root,root) %config(noreplace) /etc/logrotate.d/*
/sbin/accton
%{_sbindir}/accton
@ -151,6 +116,15 @@ fi
%{_infodir}/accounting.info.gz
%changelog
* Tue Nov 09 2010 Jan Görig <jgorig@redhat.com> - 6.5.5-1
- upgrade to new upstream release
- remove obsolete patches
- remove FHS_compliant condition
- remove obsolete conflicts with initscripts
- info installation fix
- modified man-pages patch
- spec fixes
* Mon Aug 16 2010 Ivana Hutarova Varekova <varekova@redhat.com> - 6.5.4-6
- fix two man-pages links

View File

@ -1 +1 @@
a0e6cd4bd3ad744a434828f0b6de92df acct-6.5.4.tar.gz
554a9e9c6aa3482df07e80853eac0350 acct-6.5.5.tar.gz