]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/logwatch
Zwischencommit fuer LFS. GCC und Binutils fixed.
[ipfire-2.x.git] / lfs / logwatch
1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
3 # #
4 # IPCop is free software; you can redistribute it and/or modify #
5 # it under the terms of the GNU General Public License as published by #
6 # the Free Software Foundation; either version 2 of the License, or #
7 # (at your option) any later version. #
8 # #
9 # IPCop is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU General Public License for more details. #
13 # #
14 # You should have received a copy of the GNU General Public License #
15 # along with IPCop; if not, write to the Free Software #
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
17 # #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
20 # #
21 # Modifications by: #
22 # ??-12-2003 Mark Wormgoor < mark@wormgoor.com> #
23 # - Modified Makefile for IPCop build #
24 # #
25 # $Id: logwatch,v 1.8.2.10 2005/10/18 21:30:32 gespinasse Exp $
26 # #
27 ###############################################################################
28
29 ###############################################################################
30 # Definitions
31 ###############################################################################
32
33 include Config
34
35 VER = 6.1.2
36
37 THISAPP = logwatch-$(VER)
38 DL_FILE = $(THISAPP).tar.gz
39 DL_FROM = ftp://ftp.kaybee.org/pub/old/linux
40 DIR_APP = $(DIR_SRC)/$(THISAPP)
41 TARGET = $(DIR_INFO)/$(THISAPP)
42
43 ###############################################################################
44 # Top-level Rules
45 ###############################################################################
46
47 objects = $(DL_FILE)
48
49 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
50
51 $(DL_FILE)_MD5 = a764bf80a31ab04ca788ac1303cba297
52
53 install : $(TARGET)
54
55 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
56
57 download :$(patsubst %,$(DIR_DL)/%,$(objects))
58
59 md5 : $(subst %,%_MD5,$(objects))
60
61 ###############################################################################
62 # Downloading, checking, md5sum
63 ###############################################################################
64
65 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
66 @$(CHECK)
67
68 $(patsubst %,$(DIR_DL)/%,$(objects)) :
69 @$(LOAD)
70
71 $(subst %,%_MD5,$(objects)) :
72 @$(MD5)
73
74 ###############################################################################
75 # Installation Details
76 ###############################################################################
77
78 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
79 @$(PREBUILD)
80 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
81 -mkdir -p /etc/log.d /var/log/logwatch
82 chown logwatch:nobody /var/log/logwatch
83 cd $(DIR_APP) && cp -Rf conf scripts lib /etc/log.d
84 cd $(DIR_APP) && install -m 0755 scripts/logwatch.pl /etc/log.d/scripts/logwatch.pl
85 cd $(DIR_APP) && install -m 0644 logwatch.8 /usr/share/man/man8
86 sed -i 's/^Print = .*$$/Print = Yes/' /etc/log.d/conf/logwatch.conf
87 # comment out line with unused example
88 sed -i '/-zz-network/s/Service/#Service/' /etc/log.d/conf/logwatch.conf
89 # fix typo in output
90 sed -i '/MB transfered/s/transfered/transferred/' /etc/log.d/scripts/services/http
91
92 # Strip out some filters for services we don't run - no point wasting log keeping them
93 # cron filter don't support fcron
94 # final selection for remaining files is in rootfile
95 UNNEEDED="afpd amavis arpwatch audit automount autorpm cisco clamav clamav-milter \
96 clam-update courier cron emerge exim extreme-networks ftpd-messages ftpd-xferlog \
97 imapd identd in.qpopper ipop3d maillog mailscanner mountd named netopia netscreen \
98 oidentd pam pam_pwdb pop3 portsentry postfix pound proftpd-messages pureftp \
99 pureftpd qmail rt314 saslauthd samba sendmail sendmail-largeboxes shaperd smartd \
100 sonicwall stunnel sudo tac_acc up2date vpopmail vsftpd xferlog yum zz-fortune" && \
101 for i in $$UNNEEDED ; do \
102 rm -f /etc/log.d/{conf,scripts}/services/$$i{,.conf} /etc/log.d/conf/logfiles/$$i.conf; \
103 done
104 rm -rf /etc/log.d/scripts/logfiles
105
106 sed -i 's/df -h/df -h -x rootfs/' /etc/log.d/scripts/services/zz-disk_space
107 for i in `find /etc/log.d -type f`; do \
108 sed -i 's/perl -w/perl/' $$i; \
109 done
110 # The httpd log checker script considers any request containing the word
111 # null to be an exploit attempt, reverse this behaviour as we have a
112 # null.gif
113 sed -i -e "/ 'null',/d" /etc/log.d/scripts/services/http
114 chmod -R 755 /etc/log.d
115 @rm -rf $(DIR_APP)
116 @$(POSTBUILD)