-diff -ur amavis-stats-0.1.10.orig/amavis-stats amavis-stats-0.1.10/amavis-stats
---- amavis-stats-0.1.10.orig/amavis-stats 2004-02-08 19:43:59.000000000 +0100
-+++ amavis-stats-0.1.10/amavis-stats 2004-03-15 15:41:44.000000000 +0100
+--- amavis-stats-0.1.13-rc6/amavis-stats.orig 2004-05-17 08:07:51.000000000 +0000
++++ amavis-stats-0.1.13-rc6/amavis-stats 2004-08-06 07:27:08.849931336 +0000
@@ -35,6 +35,7 @@
use Fcntl ':flock';
use POSIX qw(strftime);
# ########################################################################
-@@ -556,6 +557,59 @@
+@@ -698,6 +699,59 @@
#
# Find the previous (rotated) log file and parse that according to
# our last position
#
-@@ -578,18 +632,63 @@
+@@ -720,18 +774,63 @@
if (-f "$logfile.0") {
$rotlogfile = $logfile . ".0";
+ } elsif (-f "$logfile-$yesterday.gz") {
+ $rotlogfile = $logfile . "-$yesterday.gz";
+ } else {
-+ $rotlogfile = $logfile;
-+# $rotlogfile =~ s/(.*)\/([a-z]*)/$1\/archiv\/$2/g;
-+ $rotlogfile =~ s/\/var\/log\/(.*)/\/var\/log\/archiv\/$1/g;
-+ if ($rotlogfile eq $logfile) {
-+ $rotlogfile = "archiv/$logfile";
-+ }
-+ if (-f "$rotlogfile.0") {
-+ $rotlogfile = $rotlogfile . ".0";
-+ } elsif (-f "$rotlogfile.0.gz") {
-+ $rotlogfile = $rotlogfile . ".0.gz";
-+ } elsif (-f "$rotlogfile.1") {
-+ $rotlogfile = $rotlogfile . ".1";
-+ } elsif (-f "$rotlogfile.1.gz") {
-+ $rotlogfile = $rotlogfile . ".1.gz";
-+ } elsif (-f "$rotlogfile.01") {
-+ $rotlogfile = $rotlogfile . ".01";
-+ } elsif (-f "$rotlogfile.01.gz") {
-+ $rotlogfile = $rotlogfile . ".01.gz";
-+ } elsif (-f "$rotlogfile-$today") {
-+ $rotlogfile = $rotlogfile . "-$today";
-+ } elsif (-f "$rotlogfile-$today.gz") {
-+ $rotlogfile = $rotlogfile . "-$today.gz";
-+ } elsif (-f "$rotlogfile-$yesterday") {
-+ $rotlogfile = $rotlogfile . "-$yesterday";
-+ } elsif (-f "$rotlogfile-$yesterday.gz") {
-+ $rotlogfile = $rotlogfile . "-$yesterday.gz";
-+ }
-+ if (! -f $rotlogfile) {
-+ $rotlogfile = undef;
-+ }
++ $rotlogfile = $logfile;
++# $rotlogfile =~ s/(.*)\/([a-z]*)/$1\/archiv\/$2/g;
++ $rotlogfile =~ s/\/var\/log\/(.*)/\/var\/log\/archiv\/$1/g;
++ if ($rotlogfile eq $logfile) {
++ $rotlogfile = "archiv/$logfile";
++ }
++ if (-f "$rotlogfile.0") {
++ $rotlogfile = $rotlogfile . ".0";
++ } elsif (-f "$rotlogfile.0.gz") {
++ $rotlogfile = $rotlogfile . ".0.gz";
++ } elsif (-f "$rotlogfile.1") {
++ $rotlogfile = $rotlogfile . ".1";
++ } elsif (-f "$rotlogfile.1.gz") {
++ $rotlogfile = $rotlogfile . ".1.gz";
++ } elsif (-f "$rotlogfile.01") {
++ $rotlogfile = $rotlogfile . ".01";
++ } elsif (-f "$rotlogfile.01.gz") {
++ $rotlogfile = $rotlogfile . ".01.gz";
++ } elsif (-f "$rotlogfile-$today") {
++ $rotlogfile = $rotlogfile . "-$today";
++ } elsif (-f "$rotlogfile-$today.gz") {
++ $rotlogfile = $rotlogfile . "-$today.gz";
++ } elsif (-f "$rotlogfile-$yesterday") {
++ $rotlogfile = $rotlogfile . "-$yesterday";
++ } elsif (-f "$rotlogfile-$yesterday.gz") {
++ $rotlogfile = $rotlogfile . "-$yesterday.gz";
++ }
++ if (! -f $rotlogfile) {
++ $rotlogfile = undef;
++ }
}
- if (defined($rotlogfile)) {
+ if (defined $rotlogfile) {
- parseFile ($rotlogfile, $spos, (stat $rotlogfile)[7]);
-+ if ( $rotlogfile =~ /\.gz$/ ) {
-+ parseFilegz ($rotlogfile, $spos);
-+ } else {
-+ parseFile ($rotlogfile, $spos, (stat $rotlogfile)[7]);
-+ }
++ if ( $rotlogfile =~ /\.gz$/ ) {
++ parseFilegz ($rotlogfile, $spos);
++ } else {
++ parseFile ($rotlogfile, $spos, (stat $rotlogfile)[7]);
++ }
} else {
err("Could not open rotated logfile.");
err(" Tried extentions .0, .1, .01, -$today, -$yesterday");
-@@ -703,7 +802,11 @@
+@@ -854,7 +953,11 @@
$spos = 0; # reset to the start of the file
}
%include /usr/lib/rpm/macros.perl
+%define _rc rc6
Summary: Simple amavisd-new statistics generator
Summary(pl): Prosty generator statystyk dla amavisd-new
Name: amavis-stats
-Version: 0.1.12
-Release: 3
+Version: 0.1.13
+Release: 0.%{_rc}.1
License: GPL
Group: Applications/System
-Source0: http://rekudos.net/download/%{name}-%{version}.tar.gz
-# Source0-md5: b85063b3bb8ecdb03d1b7aebf0c0a6cd
+Source0: http://rekudos.net/download/%{name}-%{version}-%{_rc}.tar.gz
+# Source0-md5: 39156ca0eba50405d836aaf9d97743bf
Source1: %{name}.cron
Patch0: %{name}-gzip.patch
Patch1: %{name}-more_ac.patch
Interfejs PHP dla amavis-stats.
%prep
-%setup -q
+%setup -q -n %{name}-%{version}-%{_rc}
%patch0 -p1
%patch1 -p0
install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats
+cd $RPM_BUILD_ROOT%{_datadir}/%{name}/
+ln -s amavis-stats.php index.php
+
+
%clean
rm -rf $RPM_BUILD_ROOT