rpms/cyphesis/devel logwatch.logconf.cyphesis, NONE, 1.1 logwatch.script.cyphesis, NONE, 1.1 logwatch.serviceconf.cyphesis, NONE, 1.1 logwatch.shared.applycyphesisdate, NONE, 1.1 cyphesis.spec, 1.6, 1.7

Michael Thomas (wart) fedora-extras-commits at redhat.com
Mon Feb 26 02:50:53 UTC 2007


Author: wart

Update of /cvs/extras/rpms/cyphesis/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22596

Modified Files:
	cyphesis.spec 
Added Files:
	logwatch.logconf.cyphesis logwatch.script.cyphesis 
	logwatch.serviceconf.cyphesis 
	logwatch.shared.applycyphesisdate 
Log Message:
Add logwatch support




--- NEW FILE logwatch.logconf.cyphesis ---
##########################################################################
##########################################################################

# What actual file?  Defaults to LogPath if not absolute path....
LogFile = /var/tmp/cyphesis_event.log

# Keep only the lines in the proper date range...
*ApplyCyphesisDate

# vi: shiftwidth=3 tabstop=3 et


--- NEW FILE logwatch.script.cyphesis ---
##########################################################################
##########################################################################

use strict;

my ($junk, $Msg, $total);
my %Action = ();
my %Start = ();
my %Login = ();
my %TakeChar = ();
my %DropChar = ();
my %Logout = ();

my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;

# Interesting events:
#2007-02-17 12:45:22 START - - - Standalone server startup
#2007-02-17 12:56:58 LOGIN 2158 2159 - Create account wart
#2007-02-17 12:57:03 TAKE_CHAR 2158 2159 2160 Created character wart(settler) by account wart
#2007-02-17 12:57:43 DROP_CHAR 2158 - 2160 Logout character wart(settler)
#2007-02-17 12:57:43 LOGOUT 2158 2159 - Logout account wart


while (defined(my $ThisLine = <STDIN>)) {
   chomp($ThisLine);
   if ( ($Msg) = ($ThisLine =~ /START - - - (.*)$/)) {
      $Start{$Msg}++;
   }
   if ( ($Msg) = ($ThisLine =~ /LOGIN [-0-9]+ [-0-9]+ [-0-9]+ (.*)$/)) {
      $Login{$Msg}++;
   }
   if ( ($Msg) = ($ThisLine =~ /TAKE_CHAR [-0-9]+ [-0-9]+ [-0-9]+ (.*)$/)) {
      $TakeChar{$Msg}++;
   }
   if ( ($Msg) = ($ThisLine =~ /DROP_CHAR [-0-9]+ [-0-9]+ [-0-9]+ (.*)$/)) {
      $DropChar{$Msg}++;
   }
   if ( ($Msg) = ($ThisLine =~ /LOGOUT [-0-9]+ [-0-9]+ [-0-9]+ (.*)$/)) {
      $Logout{$Msg}++;
   }
}

if (keys %Start) {
   if ($Detail >= 5) {
      foreach my $Msg (sort keys %Start) {
         if ($Start{$Msg} > 1) {
            print "$Msg ($Start{$Msg} times)\n"
         } else {
            print "$Msg\n"
         }
      }
   } else {
      my $total;
      foreach my $Msg (sort keys %Start) {
         $total += $Start{$Msg};
      }
      print "Server started $total times\n";
   }
}

if (keys %Login) {
   if ($Detail >= 5) {
      foreach my $Msg (sort keys %Login) {
         if ($Login{$Msg} > 1) {
            print "$Msg ($Login{$Msg} times)\n"
         } else {
            print "$Msg\n"
         }
      }
   } else {
      my $total;
      foreach my $Msg (sort keys %Login) {
         $total += $Login{$Msg};
      }
      print "$total Users logged in\n";
   }
}

if (keys %TakeChar) {
   if ($Detail >= 5) {
      foreach my $Msg (sort keys %TakeChar) {
         if ($TakeChar{$Msg} > 1) {
            print "$Msg ($TakeChar{$Msg} times)\n"
         } else {
            print "$Msg\n"
         }
      }
   } else {
      my $total;
      foreach my $Msg (sort keys %TakeChar) {
         $total += $TakeChar{$Msg};
      }
      print "$total characters entered the world\n";
   }
}

if (keys %DropChar) {
   if ($Detail >= 5) {
      foreach my $Msg (sort keys %DropChar) {
         if ($DropChar{$Msg} > 1) {
            print "$Msg ($DropChar{$Msg} times)\n"
         } else {
            print "$Msg\n"
         }
      }
   } else {
      my $total;
      foreach my $Msg (sort keys %DropChar) {
         $total += $DropChar{$Msg};
      }
      print "$total characters left the world\n";
   }
}

if (keys %Logout) {
   if ($Detail >= 5) {
      foreach my $Msg (sort keys %Logout) {
         if ($Logout{$Msg} > 1) {
            print "$Msg ($Logout{$Msg} times)\n"
         } else {
            print "$Msg\n"
         }
      }
   } else {
      my $total;
      foreach my $Msg (sort keys %Logout) {
         $total += $Logout{$Msg};
      }
      print "$total players logged out\n";
   }
}

exit(0);

# vi: shiftwidth=3 tabstop=3 syntax=perl et



--- NEW FILE logwatch.serviceconf.cyphesis ---
###########################################################################
###########################################################################

# You can put comments anywhere you want to.  They are effective for the
# rest of the line.

# this is in the format of <name> = <value>.  Whitespace at the beginning
# and end of the lines is removed.  Whitespace before and after the = sign
# is removed.  Everything is case *insensitive*.

# Yes = True  = On  = 1
# No  = False = Off = 0

Title = "Cyphesis"

# Which logfile group...
LogFile = cyphesis

# vi: shiftwidth=3 tabstop=3 et


***** Error reading new file: [Errno 2] No such file or directory: 'logwatch.shared.applycyphesisdate'

Index: cyphesis.spec
===================================================================
RCS file: /cvs/extras/rpms/cyphesis/devel/cyphesis.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- cyphesis.spec	25 Jan 2007 07:16:10 -0000	1.6
+++ cyphesis.spec	26 Feb 2007 02:50:21 -0000	1.7
@@ -1,9 +1,15 @@
 %define selinux_variants mls strict targeted
 %define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp)
 
+#%define logwatch_root %{_sysconfdir}/logwatch
+#%define logwatch_conf %{logwatch_root}/conf
+%define logwatch_root %{_datadir}/logwatch
+%define logwatch_conf %{logwatch_root}/dist.conf
+%define logwatch_scripts %{logwatch_root}/scripts
+
 Name:           cyphesis
 Version:        0.5.11
-Release:        1%{?dist}
+Release:        1%{?dist}.2
 Summary:        WorldForge game server
 Group:          System Environment/Libraries
 License:        GPL
@@ -12,6 +18,10 @@
 Source1:        cyphesis.te
 Source2:        cyphesis.if
 Source3:        cyphesis.fc
+Source4:        logwatch.logconf.cyphesis
+Source5:        logwatch.script.cyphesis
+Source6:        logwatch.serviceconf.cyphesis
+Source7:        logwatch.shared.applycyphesisdate
 Patch0:         cyphesis-0.5.8-init.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  python-devel libgcrypt-devel pkgconfig atlascpp-devel
@@ -19,9 +29,6 @@
 BuildRequires:  postgresql-devel readline-devel avahi-devel
 BuildRequires:  checkpolicy selinux-policy-devel hardlink
 
-%if "%{selinux_policyver}" != ""
-Requires:       selinux-policy >= %{selinux_policyver}
-%endif
 Requires:       postgresql-server
 Requires(post): /sbin/chkconfig
 Requires(post): /sbin/service
@@ -41,12 +48,22 @@
 Summary: SELinux policy files for the WorldForge game server
 Group: Amusements/Games
 Requires: %{name} = %{version}-%{release}
+%if "%{selinux_policyver}" != ""
+Requires:       selinux-policy >= %{selinux_policyver}
+%endif
 Requires(post):         /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles
 Requires(preun):        /sbin/service /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles /usr/sbin/setsebool
 Requires(postun):       /usr/sbin/semodule
 %description selinux
 SELinux policy files for the WorldForge game server
 
+%package logwatch
+Summary: logwatch scripts for the WorldForge game server
+Group: Amusements/Games
+Requires: %{name} = %{version}-%{release} logwatch
+%description logwatch
+logwatch scripts for the WorldForge game server
+
 
 %prep
 %setup -q
@@ -88,6 +105,13 @@
 install -d %{buildroot}%{_sysconfdir}/sysconfig
 install -m 644 %{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}
 
+# Install logwatch files
+install -pD -m 0644 %{SOURCE4} %{buildroot}%{logwatch_conf}/logfiles/%{name}.conf
+install -pD -m 0755 %{SOURCE5} %{buildroot}%{logwatch_scripts}/services/%{name}
+install -pD -m 0644 %{SOURCE6} %{buildroot}%{logwatch_conf}/services/%{name}.conf
+install -pD -m 0755 %{SOURCE7} %{buildroot}%{logwatch_scripts}/shared/applycyphesisdate
+
+
 # Install selinux policies
 pushd SELinux
 for variant in %{selinux_variants}
@@ -178,6 +202,13 @@
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %{_datadir}/%{name}
 
+%files logwatch
+%defattr(-,root,root,-)
+%{logwatch_conf}/logfiles/%{name}.conf
+%{logwatch_conf}/services/%{name}.conf
+%{logwatch_scripts}/services/%{name}
+%{logwatch_scripts}/shared/applycyphesisdate
+
 %files selinux
 %defattr(-,root,root,-)
 %doc SELinux/*.??
@@ -185,8 +216,12 @@
 
 
 %changelog
+* Sat Feb 24 2007 Wart <wart at kobold.org> 0.5.11-2
+- Add logwatch subpackage
+- Move log file to /var/log directory
+
 * Wed Jan 24 2007 Wart <wart at kobold.org> 0.5.11-1
-- Update to 0.5.11 with python 1.5 support
+- Update to 0.5.11 with builtin python 2.5 support
 - Updated selinux policy
 
 * Thu Dec 14 2006 Wart <wart at kobold.org> 0.5.10-4




More information about the fedora-extras-commits mailing list