Ticket #18021: Portfile.2

File Portfile.2, 3.3 KB (added by lassi.tuura@…, 16 years ago)
Line 
1# $Id$
2
3PortSystem        1.0
4name              logwatch
5version           7.3.6
6distname          logwatch-${version}
7categories        security
8maintainers       lassi.tuura@cern.ch
9description       system log analyzer and reporter
10long_description  \
11                  Logwatch is a customizable log analysis system. Logwatch parses through \
12                  your system's logs for a given period of time and creates a report \
13                  analyzing areas that you specify, in as much detail as you require. \
14                  Logwatch is easy to use and will work right out of the package on \
15                  most systems.
16homepage          http://www.logwatch.org
17master_sites      ftp://ftp.kaybee.org/pub/linux
18platforms         darwin
19checksums         md5 937d982006b2a76a83edfcfd2e5a9d7d
20
21configure { }
22build { }
23destroot {
24  reinplace "s|/usr/share/${name}|${prefix}/share/${name}|g" ${worksrcpath}/scripts/logwatch.pl
25  reinplace "s|/var/cache/${name}|${prefix}/var/cache/${name}|g" ${worksrcpath}/scripts/logwatch.pl
26  reinplace "s|/var/cache/${name}|${prefix}/var/cache/${name}|g" ${worksrcpath}/conf/logwatch.conf
27  reinplace "s|messages|system|g" ${worksrcpath}/conf/logfiles/messages.conf
28
29  file mkdir ${destroot}${prefix}/etc/LaunchDaemons/${name}
30  file mkdir ${destroot}${prefix}/etc/${name}/scripts
31  file mkdir ${destroot}${prefix}/etc/${name}/conf/logfiles
32  file mkdir ${destroot}${prefix}/etc/${name}/conf/services
33  file mkdir ${destroot}${prefix}/share/${name}/dist.conf/logfiles
34  file mkdir ${destroot}${prefix}/var/cache/${name}
35  touch ${destroot}${prefix}/var/cache/.turd
36
37  file copy ${worksrcpath}/conf    ${destroot}${prefix}/share/${name}/default.conf
38  file copy ${worksrcpath}/scripts ${destroot}${prefix}/share/${name}/scripts
39  file copy ${worksrcpath}/lib     ${destroot}${prefix}/share/${name}/lib
40
41  set plist [open ${destroot}${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist w+]
42  puts $plist "<?xml version='1.0' encoding='UTF-8'?>"
43  puts $plist "<!DOCTYPE plist PUBLIC '-//Apple Computer//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>"
44  puts $plist "<plist version='1.0'>"
45  puts $plist "<dict>"
46  puts $plist "  <key>Label</key>"
47  puts $plist "  <string>org.macports.logwatch</string>"
48  puts $plist "  <key>LowPriorityIO</key>"
49  puts $plist "  <true/>"
50  puts $plist "  <key>Nice</key>"
51  puts $plist "  <integer>1</integer>"
52  puts $plist "  <key>ProgramArguments</key>"
53  puts $plist "  <array>"
54  puts $plist "    <string>/bin/sh</string>"
55  puts $plist "    <string>-c</string>"
56  puts $plist "    <string>PATH=${prefix}/bin:\$PATH; logwatch --mailto root</string>"
57  puts $plist "  </array>"
58  puts $plist "  <key>ServiceDescription</key>"
59  puts $plist "  <string>Periodic run of logwatch</string>"
60  puts $plist "  <key>StartCalendarInterval</key>"
61  puts $plist "  <dict>"
62  puts $plist "    <key>Hour</key>"
63  puts $plist "    <integer>1</integer>"
64  puts $plist "    <key>Minute</key>"
65  puts $plist "    <integer>12</integer>"
66  puts $plist "  </dict>"
67  puts $plist "</dict>"
68  puts $plist "</plist>"
69  close $plist
70
71  system "ln -s ../share/${name}/scripts/logwatch.pl ${destroot}${prefix}/bin/logwatch"
72  system "rm -f /Library/LaunchDaemons/org.macports.${name}.plist"
73  system "ln -s ${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist /Library/LaunchDaemons"
74}
75
76post-destroot {
77}