source: trunk/dports/security/logwatch/Portfile

Last change on this file was 152322, checked in by khindenburg@…, 13 months ago

logwatch: update to 7.4.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 152322 2016-09-03 20:06:14Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                logwatch
7version             7.4.3
8distname            logwatch-${version}
9categories          security
10license             MIT
11maintainers         khindenburg openmaintainer
12supported_archs     noarch
13
14description         system log analyzer and reporter
15long_description  \
16                    Logwatch is a customizable log analysis system. Logwatch \
17                    parses through your system's logs for a given period of \
18                    time and creates a report analyzing areas that you \
19                    specify, in as much detail as you require. Logwatch is \
20                    easy to use and will work right out of the package on most \
21                    systems.
22
23homepage            http://logwatch.sourceforge.net
24master_sites        sourceforge:project/logwatch/logwatch-${version}
25
26platforms           darwin
27depends_lib         path:bin/perl:perl5
28
29checksums           rmd160  ec94cfa366427a9b65b664cf1cb0f84c509ef165 \
30                    sha256  1dbdc48d65e150f2dbb43f1e4f4700d94166e053b1c7bbbdedf4ad670283720e
31
32patchfiles          patch-scripts.logwatch.pl.diff \
33                    patch-conf.logwatch.conf.diff
34
35use_configure       no
36
37post-patch {
38    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/scripts/logwatch.pl
39    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/conf/logwatch.conf
40
41    reinplace s|#!/usr/bin/perl|#!${prefix}/bin/perl| ${worksrcpath}/scripts/logwatch.pl
42    reinplace s|messages|system|g ${worksrcpath}/conf/logfiles/messages.conf
43
44    reinplace s|/usr/share/logwatch/default.conf|${prefix}/share/${name}/default.conf| ${worksrcpath}/logwatch.conf.5
45    reinplace s|/etc/logwatch/conf/ignore.conf|${prefix}/share/${name}/conf/ignore.conf| ${worksrcpath}/logwatch.conf.5
46    reinplace s|/etc/logwatch|${prefix}/etc/${name}| ${worksrcpath}/logwatch.conf.5
47
48    reinplace s|/usr/share|${prefix}/share| ${worksrcpath}/logwatch.8
49    reinplace s|/etc/${name}|${prefix}/etc/${name}| ${worksrcpath}/logwatch.8
50}
51
52build {}
53
54destroot.keepdirs   ${destroot}${prefix}/var/cache/${name} \
55                    ${destroot}${prefix}/etc/${name} \
56                    ${destroot}${prefix}/etc/${name}/scripts \
57                    ${destroot}${prefix}/etc/${name}/conf/logfiles \
58                    ${destroot}${prefix}/etc/${name}/conf/services
59
60destroot {
61    file mkdir ${destroot}${prefix}/var/cache/${name} \
62    file mkdir ${destroot}${prefix}/etc/${name}
63    file mkdir ${destroot}${prefix}/etc/${name}/scripts
64    file mkdir ${destroot}${prefix}/etc/${name}/conf/logfiles
65    file mkdir ${destroot}${prefix}/etc/${name}/conf/services
66    file mkdir ${destroot}${prefix}/share/${name}/dist.conf/logfiles
67
68    file copy ${worksrcpath}/conf    ${destroot}${prefix}/share/${name}/default.conf
69    file copy ${worksrcpath}/scripts ${destroot}${prefix}/share/${name}/scripts
70    file copy ${worksrcpath}/lib     ${destroot}${prefix}/share/${name}/lib
71
72    xinstall -m 755 -d ${destroot}${prefix}/share/man/man5
73    xinstall -m 755 -d ${destroot}${prefix}/share/man/man8
74
75    xinstall -m 644 ${worksrcpath}/logwatch.conf.5 ${destroot}${prefix}/share/man/man5/
76    xinstall -m 644 ${worksrcpath}/logwatch.8 ${destroot}${prefix}/share/man/man8/
77
78    # startup item
79    file mkdir ${destroot}${prefix}/etc/LaunchDaemons/${name}
80    file copy ${filespath}/org.macports.${name}.plist ${destroot}${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist
81    reinplace s|@PREFIX@|${prefix}|g ${destroot}${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist
82}
83
84post-destroot {
85    file delete /Library/LaunchDaemons/org.macports.${name}.plist
86    xinstall -d -m 0755 ${destroot}/Library/LaunchDaemons
87    ln -sf ${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist ${destroot}/Library/LaunchDaemons/
88    ln -sf ${prefix}/share/${name}/scripts/logwatch.pl ${destroot}${prefix}/bin/logwatch
89}
90
91pre-activate {
92    # This port used to create a symlink directly in ${prefix} which was fixed in 7.4.1_1.
93    # The old unregistered symlink needs to be deleted from ${prefix} so upgrades work; fixed in 7.4.1_4.
94    # This can eventually be removed. Originally added 2014-10-01; fixed 2016-02-03.
95    set badfile ${prefix}/bin/${name}
96    if {![catch {file type ${badfile}}] && [registry_file_registered ${badfile}] == "0"} {
97        if {[catch {delete ${badfile}}]} {
98            ui_warn "Cannot delete ${badfile}; please remove it manually"
99        }
100    }
101}
102
103notes "
104A startup item has been generated that will aid in
105starting logwatch with launchd. It is disabled
106by default. Execute the following command to start it,
107and to cause it to launch at startup:
108
109sudo launchctl load -w /Library/LaunchDaemons/org.macports.logwatch.plist
110"
111
112livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.