From badd2726873888897cb493ed633adbeeb82de830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20G=C3=B6rig?= Date: Tue, 9 Nov 2010 17:30:13 +0100 Subject: [PATCH] - 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 --- .gitignore | 1 + acct-6.3.2-config.patch | 29 ------------- acct-6.5.4-mp.patch | 18 -------- acct-6.5.5-direntry.patch | 12 ++++++ psacct-6.3.2-man-pages.patch | 84 +++++++++++++++++++++++++++++------- psacct-6.5.4-hzval.patch | 12 ------ psacct-logrotate.in | 4 +- psacct.spec | 80 ++++++++++++---------------------- sources | 2 +- 9 files changed, 112 insertions(+), 130 deletions(-) delete mode 100644 acct-6.3.2-config.patch delete mode 100644 acct-6.5.4-mp.patch create mode 100644 acct-6.5.5-direntry.patch delete mode 100644 psacct-6.5.4-hzval.patch diff --git a/.gitignore b/.gitignore index 5a81b50..92f5529 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ acct-6.5.4.tar.gz +/acct-6.5.5.tar.gz diff --git a/acct-6.3.2-config.patch b/acct-6.3.2-config.patch deleted file mode 100644 index 257f9b0..0000000 --- a/acct-6.3.2-config.patch +++ /dev/null @@ -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" diff --git a/acct-6.5.4-mp.patch b/acct-6.5.4-mp.patch deleted file mode 100644 index ee57231..0000000 --- a/acct-6.5.4-mp.patch +++ /dev/null @@ -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 . - .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 . - .SH "SEE ALSO" - .BR acct (5), --.BR ac (8) -+.BR ac (1) diff --git a/acct-6.5.5-direntry.patch b/acct-6.5.5-direntry.patch new file mode 100644 index 0000000..c39df95 --- /dev/null +++ b/acct-6.5.5-direntry.patch @@ -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 + + diff --git a/psacct-6.3.2-man-pages.patch b/psacct-6.3.2-man-pages.patch index 63834db..fa7d7d9 100644 --- a/psacct-6.3.2-man-pages.patch +++ b/psacct-6.3.2-man-pages.patch @@ -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 +.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 . +-.PP +-This manual page was written by Ognyan Kulev and updated +-by Daniel Baumann for the Debian project (but may be used by +-others). +accton (8), lastcomm (1), utmp (5) diff --git a/psacct-6.5.4-hzval.patch b/psacct-6.5.4-hzval.patch deleted file mode 100644 index bd67852..0000000 --- a/psacct-6.5.4-hzval.patch +++ /dev/null @@ -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 */ diff --git a/psacct-logrotate.in b/psacct-logrotate.in index a24e64d..cb8cfc6 100644 --- a/psacct-logrotate.in +++ b/psacct-logrotate.in @@ -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 } diff --git a/psacct.spec b/psacct.spec index 0ad77e7..7d2c2fc 100644 --- a/psacct.spec +++ b/psacct.spec @@ -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 - 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 - 6.5.4-6 - fix two man-pages links diff --git a/sources b/sources index 9a6c75b..f474462 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a0e6cd4bd3ad744a434828f0b6de92df acct-6.5.4.tar.gz +554a9e9c6aa3482df07e80853eac0350 acct-6.5.5.tar.gz