# -*- 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 # $Id: Portfile 152322 2016-09-03 20:06:14Z khindenburg@macports.org $ PortSystem 1.0 name logwatch version 7.4.3 distname logwatch-${version} categories security license MIT maintainers khindenburg openmaintainer supported_archs noarch description system log analyzer and reporter long_description \ Logwatch is a customizable log analysis system. Logwatch \ parses through your system's logs for a given period of \ time and creates a report analyzing areas that you \ specify, in as much detail as you require. Logwatch is \ easy to use and will work right out of the package on most \ systems. homepage http://logwatch.sourceforge.net master_sites sourceforge:project/logwatch/logwatch-${version} platforms darwin depends_lib path:bin/perl:perl5 checksums rmd160 ec94cfa366427a9b65b664cf1cb0f84c509ef165 \ sha256 1dbdc48d65e150f2dbb43f1e4f4700d94166e053b1c7bbbdedf4ad670283720e patchfiles patch-scripts.logwatch.pl.diff \ patch-conf.logwatch.conf.diff use_configure no post-patch { reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/scripts/logwatch.pl reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/conf/logwatch.conf reinplace s|#!/usr/bin/perl|#!${prefix}/bin/perl| ${worksrcpath}/scripts/logwatch.pl reinplace s|messages|system|g ${worksrcpath}/conf/logfiles/messages.conf reinplace s|/usr/share/logwatch/default.conf|${prefix}/share/${name}/default.conf| ${worksrcpath}/logwatch.conf.5 reinplace s|/etc/logwatch/conf/ignore.conf|${prefix}/share/${name}/conf/ignore.conf| ${worksrcpath}/logwatch.conf.5 reinplace s|/etc/logwatch|${prefix}/etc/${name}| ${worksrcpath}/logwatch.conf.5 reinplace s|/usr/share|${prefix}/share| ${worksrcpath}/logwatch.8 reinplace s|/etc/${name}|${prefix}/etc/${name}| ${worksrcpath}/logwatch.8 } build {} destroot.keepdirs ${destroot}${prefix}/var/cache/${name} \ ${destroot}${prefix}/etc/${name} \ ${destroot}${prefix}/etc/${name}/scripts \ ${destroot}${prefix}/etc/${name}/conf/logfiles \ ${destroot}${prefix}/etc/${name}/conf/services destroot { file mkdir ${destroot}${prefix}/var/cache/${name} \ file mkdir ${destroot}${prefix}/etc/${name} file mkdir ${destroot}${prefix}/etc/${name}/scripts file mkdir ${destroot}${prefix}/etc/${name}/conf/logfiles file mkdir ${destroot}${prefix}/etc/${name}/conf/services file mkdir ${destroot}${prefix}/share/${name}/dist.conf/logfiles file copy ${worksrcpath}/conf ${destroot}${prefix}/share/${name}/default.conf file copy ${worksrcpath}/scripts ${destroot}${prefix}/share/${name}/scripts file copy ${worksrcpath}/lib ${destroot}${prefix}/share/${name}/lib xinstall -m 755 -d ${destroot}${prefix}/share/man/man5 xinstall -m 755 -d ${destroot}${prefix}/share/man/man8 xinstall -m 644 ${worksrcpath}/logwatch.conf.5 ${destroot}${prefix}/share/man/man5/ xinstall -m 644 ${worksrcpath}/logwatch.8 ${destroot}${prefix}/share/man/man8/ # startup item file mkdir ${destroot}${prefix}/etc/LaunchDaemons/${name} file copy ${filespath}/org.macports.${name}.plist ${destroot}${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist reinplace s|@PREFIX@|${prefix}|g ${destroot}${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist } post-destroot { file delete /Library/LaunchDaemons/org.macports.${name}.plist xinstall -d -m 0755 ${destroot}/Library/LaunchDaemons ln -sf ${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist ${destroot}/Library/LaunchDaemons/ ln -sf ${prefix}/share/${name}/scripts/logwatch.pl ${destroot}${prefix}/bin/logwatch } pre-activate { # This port used to create a symlink directly in ${prefix} which was fixed in 7.4.1_1. # The old unregistered symlink needs to be deleted from ${prefix} so upgrades work; fixed in 7.4.1_4. # This can eventually be removed. Originally added 2014-10-01; fixed 2016-02-03. set badfile ${prefix}/bin/${name} if {![catch {file type ${badfile}}] && [registry_file_registered ${badfile}] == "0"} { if {[catch {delete ${badfile}}]} { ui_warn "Cannot delete ${badfile}; please remove it manually" } } } notes " A startup item has been generated that will aid in starting logwatch with launchd. It is disabled by default. Execute the following command to start it, and to cause it to launch at startup: sudo launchctl load -w /Library/LaunchDaemons/org.macports.logwatch.plist " livecheck.regex ${name}-(\[0-9.\]+)${extract.suffix}