# -*- 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$ PortSystem 1.0 name logrotate version 3.8.2 categories sysutils maintainers pixilla openmaintainer platforms darwin description Rotates, compresses, and mails system logs long_description The logrotate utility is designed to simplify the administration of log files \ on a system which generates a lot of log files. Logrotate allows for the \ automatic rotation compression, removal and mailing of log files. Logrotate \ can be set to handle a log file \daily, weekly, monthly or when the log file \ gets to a certain size. homepage https://fedorahosted.org/logrotate/ master_sites https://fedorahosted.org/releases/l/o/logrotate/ checksums rmd160 5e6c1006f590e72c6f36b639a4e0fcf4e49eb029 \ sha256 1cb9496e48fc4b8fe63d85d27be8567e9131541fe11e4d4d5993730afc578cab patchfiles patch-Makefile.diff depends_run port:popt port:gettext post-extract { touch ${worksrcpath}/.depend } post-patch { reinplace "s|@@PREFIX@@|${prefix}|g" \ ${worksrcpath}/examples/logrotate-default } use_configure no variant universal {} build.env-append CC="${configure.cc} [get_canonical_archflags]" \ CXX="${configure.cxx} [get_canonical_archflags]" \ CPP="${configure.cpp} [get_canonical_archflags]" \ BASEDIR="${prefix}" \ POPT_DIR="${prefix}" \ STATEFILE="${prefix}/var/run/logrotate/logrotate.status" \ DEFAULT_MAIL_COMMAND="/usr/sbin/mail" destroot.args INSTALL="install" \ BINDIR="${destroot}${prefix}/sbin" \ MANDIR="${destroot}${prefix}/share/man" destroot.keepdirs ${destroot}${prefix}/etc/logrotate.d \ ${destroot}${prefix}/var/run/logrotate post-destroot { xinstall -d ${destroot}${prefix}/share/${name} set fp [open ${destroot}${prefix}/share/${name}/logrotate.conf.example w] puts $fp \ "# see \"man logrotate\" for details # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # use date as a suffix of the rotated file dateext # uncomment this if you want your log files compressed #compress # Drop log rotation information into this directory include ${prefix}/etc/logrotate.d" close $fp set fp [open ${destroot}${prefix}/share/${name}/org.macports.logrotate.plist.example w] puts $fp \ " Disabled Label com.pixilla.logrotate ProgramArguments ${prefix}/sbin/logrotate ${prefix}/etc/logrotate.conf StartCalendarInterval Hour 5 Minute 30 " close $fp if {[variant_isset startupitem]} { xinstall -d ${destroot}${prefix}/etc/LaunchDaemons/org.macports.logrotate xinstall -d ${destroot}/Library/LaunchDaemons xinstall -m 644 ${destroot}${prefix}/share/${name}/org.macports.logrotate.plist.example \ ${destroot}${prefix}/etc/LaunchDaemons/org.macports.logrotate/org.macports.logrotate.plist ln -sf "${prefix}/etc/LaunchDaemons/org.macports.logrotate/org.macports.logrotate.plist" "${destroot}/Library/LaunchDaemons/org.macports.logrotate.plist" } } variant bzip2 conflicts gzip description {Use bzip2 compression by default} { build.env-append \ COMPRESS_COMMAND="${prefix}/bin/bzip2" \ COMPRESS_EXT=".bz2" \ UNCOMPRESS_COMMAND="${prefix}/bin/bunzip2" depends_run-append \ port:bzip2 } variant gzip conflicts bzip2 description {Use gzip compression by default} { build.pre_args-append \ COMPRESS_COMMAND="${prefix}/bin/gzip" \ COMPRESS_EXT=".gz" \ UNCOMPRESS_COMMAND="${prefix}/bin/gunzip" depends_run-append \ port:gzip } variant startupitem description {Install launchd plist} { } if {![variant_isset bzip2]} { default_variants-append \ +gzip variant_set gzip } livecheck.url $homepage livecheck.type regex livecheck.regex "(?!${name}).*${name}-((?!${extract.suffix}).*)${extract.suffix}" notes \ " To use logrotate: * If ${prefix}/etc/logrotate.conf does not exist copy the example into place. \$ sudo cp ${prefix}/share/${name}/logrotate.conf.example ${prefix}/etc/logrotate.conf * Logrotate scripts added to ${prefix}/etc/logrotate.d are read by default. \$ sudo ${prefix}/sbin/${name} ${prefix}/etc/logrotate.conf * With the startupitem variant (+startupitem) you can activate a scheduled log rotation with this command. \$ sudo port load Logrotate * To create your own startup item with non-default intervals, build logrotate without the startupitem variant (-startupitem), copy the example into place and edit to your liking and load with launchctl when finished. \$ sudo cp ${prefix}/share/${name}/org.macports.logrotate.plist.example /Library/LaunchDaemons/org.macports.logrotate.plist \$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.logrotate.plist "