Ticket #18021: Portfile.5

File Portfile.5, 3.0 KB (added by lassi.tuura@…, 16 years ago)

Combined merge of previous diff plus requested changes from macports admins.

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$
3
4PortSystem          1.0
5
6name                logwatch
7revision            1
8version             7.3.6
9distname            logwatch-${version}
10categories          security
11maintainers         lassi.tuura@cern.ch
12description         system log analyzer and reporter
13long_description  \
14                    Logwatch is a customizable log analysis system. Logwatch \
15                    parses through your system's logs for a given period of \
16                    time and creates a report analyzing areas that you \
17                    specify, in as much detail as you require. Logwatch is \
18                    easy to use and will work right out of the package on most \
19                    systems.
20
21homepage            http://www.logwatch.org
22master_sites        ftp://ftp.kaybee.org/pub/linux
23platforms           darwin
24checksums           md5 937d982006b2a76a83edfcfd2e5a9d7d
25
26use_configure       no
27build {
28    reinplace s|/usr/share/${name}|${prefix}/share/${name}|g ${worksrcpath}/scripts/logwatch.pl
29    reinplace s|/var/cache/${name}|${prefix}/var/cache/${name}|g ${worksrcpath}/scripts/logwatch.pl
30    reinplace s|/var/cache/${name}|${prefix}/var/cache/${name}|g ${worksrcpath}/conf/logwatch.conf
31    reinplace s|messages|system|g ${worksrcpath}/conf/logfiles/messages.conf
32}
33
34destroot.keepdirs   ${destroot}${prefix}/var/cache/${name}
35destroot {
36    file mkdir ${destroot}${prefix}/etc/${name}/scripts
37    file mkdir ${destroot}${prefix}/etc/${name}/conf/logfiles
38    file mkdir ${destroot}${prefix}/etc/${name}/conf/services
39    file mkdir ${destroot}${prefix}/share/${name}/dist.conf/logfiles
40    file mkdir ${destroot}${prefix}/var/cache/${name}
41
42    file copy ${worksrcpath}/conf    ${destroot}${prefix}/share/${name}/default.conf
43    file copy ${worksrcpath}/scripts ${destroot}${prefix}/share/${name}/scripts
44    file copy ${worksrcpath}/lib     ${destroot}${prefix}/share/${name}/lib
45
46    ln -s ../share/${name}/scripts/logwatch.pl ${destroot}${prefix}/bin/logwatch
47
48    # startup item
49    file mkdir ${destroot}${prefix}/etc/LaunchDaemons/${name}
50    file copy files/org.macports.${name}.plist ${destroot}${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist
51    reinplace s|@PREFIX@|${prefix}|g ${destroot}${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist
52}
53
54post-destroot {
55    file delete /Library/LaunchDaemons/org.macports.${name}.plist
56    ln -s ${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist /Library/LaunchDaemons
57    ui_msg "###########################################################"
58    ui_msg "# A startup item has been generated that will aid in"
59    ui_msg "# starting logwatch with launchd. It is disabled"
60    ui_msg "# by default. Execute the following command to start it,"
61    ui_msg "# and to cause it to launch at startup:"
62    ui_msg "#"
63    ui_msg "# sudo launchctl load -w /Library/LaunchDaemons/org.macports.logwatch.plist"
64    ui_msg "###########################################################"
65}