New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 82675


Ignore:
Timestamp:
08/17/11 16:09:48 (4 years ago)
Author:
pixilla@…
Message:

systuils/logrotate:

  • Upgrade to 3.8.0.
  • Add conf and startupitem examples.
  • Add +startupitem variant.
  • Add +gzip and +bzip2 variants to select default compression engine.
Location:
trunk/dports/sysutils/logrotate
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/sysutils/logrotate/Portfile

    r82672 r82675  
    55 
    66name                logrotate 
    7 version             3.7.1 
    8 revision            3 
     7version             3.8.0 
    98categories          sysutils 
    109maintainers         pixilla openmaintainer 
     
    1918                    gets to a certain size. 
    2019 
    21 distname            ${name}_${version}.orig 
    22 worksrcdir          ${name}-${version} 
     20homepage            https://fedorahosted.org/logrotate/ 
     21master_sites        gentoo 
     22checksums           sha1    a79c500c4ce45177b47bb473a6bff4021af7121e \ 
     23                    rmd160  7e1e24f53db5230eee2e1db8d90fe3a33692ca01 
    2324 
    24 homepage            http://packages.debian.org/stable/admin/logrotate 
     25patch.pre_args      -p1 
     26patchfiles          patch-config.c.diff \ 
     27                    patch-Makefile.diff 
    2528 
    26 master_sites        http://ftp.debian.org/debian/pool/main/l/logrotate 
    27 checksums           ${distname}${extract.suffix} md5 552639142e163745f6bcd4f1f3816d8a \ 
    28                     logrotate_${version}-5.diff.gz md5 619d36e123f8d5d6e25a1544a589cf27 
     29depends_run         port:popt port:gettext 
    2930 
    30 patch_sites         http://ftp.debian.org/debian/pool/main/l/logrotate/ 
    31 patchfiles          logrotate_${version}-5.diff.gz 
     31post-extract { 
     32    touch ${worksrcpath}/.depend 
     33} 
    3234 
    33 depends_run         port:popt \ 
    34                     port:gettext \ 
    35                     port:gzip 
     35post-patch { 
     36    reinplace "s|@@PREFIX@@|${prefix}|g" \ 
     37        ${worksrcpath}/examples/logrotate-default 
     38} 
    3639 
    3740use_configure       no 
    3841 
    39 build.args          POPT_DIR=${prefix}/include LDFLAGS="-L${prefix}/lib -lpopt" 
     42build.env-append    CC="${configure.cc} [get_canonical_archflags]" \ 
     43                    CXX="${configure.cxx} [get_canonical_archflags]" \ 
     44                    CPP="${configure.cpp} [get_canonical_archflags]" \ 
     45                    BASEDIR="${prefix}" \ 
     46                    POPT_DIR="${prefix}/include" \ 
     47                    STATEFILE="${prefix}/var/run/logrotate/logrotate.status" \ 
     48                    DEFAULT_MAIL_COMMAND="/usr/sbin/mail" 
    4049 
    41 post-patch { 
    42   reinplace "s|\"/bin/gzip\"|\"${prefix}/bin/gzip\"|g" \ 
    43     ${worksrcpath}/config.h 
     50destroot.args       INSTALL="install" \ 
     51                    BASEDIR=[string trimleft ${destroot}${prefix} /] \ 
     52                    MANDIR="${prefix}/share/man" 
     53destroot.keepdirs   ${destroot}${prefix}/etc/logrotate.d \ 
     54                    ${destroot}${prefix}/var/run/logrotate 
     55post-destroot { 
     56    xinstall -d ${destroot}${prefix}/share/${name} 
     57    set fp [open ${destroot}${prefix}/share/${name}/logrotate.conf.example w] 
     58    puts $fp \ 
     59"# see \"man logrotate\" for details 
     60# rotate log files weekly 
     61weekly 
    4462 
    45   system "cd ${worksrcpath} && patch -p1 < logrotate-${version}/debian/patches/rh-dateext.patch" 
     63# keep 4 weeks worth of backlogs 
     64rotate 4 
     65 
     66# create new (empty) log files after rotating old ones 
     67create 
     68 
     69# use date as a suffix of the rotated file 
     70dateext 
     71 
     72# uncomment this if you want your log files compressed 
     73#compress 
     74 
     75# Drop log rotation information into this directory 
     76include ${prefix}/etc/logrotate.d" 
     77    close $fp 
     78 
     79    set fp [open ${destroot}${prefix}/share/${name}/org.macports.logrotate.plist.example w] 
     80    puts $fp \ 
     81"<?xml version=\"1.0\" encoding=\"UTF-8\"?> 
     82<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"> 
     83<plist version=\"1.0\"> 
     84<dict> 
     85        <key>Disabled</key> 
     86        <true/> 
     87        <key>Label</key> 
     88        <string>com.pixilla.logrotate</string> 
     89        <key>ProgramArguments</key> 
     90        <array> 
     91                <string>${prefix}/sbin/logrotate</string> 
     92                <string>${prefix}/etc/logrotate.conf</string> 
     93        </array> 
     94        <key>StartCalendarInterval</key> 
     95        <dict> 
     96                <key>Hour</key> 
     97                <integer>5</integer> 
     98                <key>Minute</key> 
     99                <integer>30</integer> 
     100        </dict> 
     101</dict> 
     102</plist>" 
     103    close $fp 
     104    if {[variant_isset startupitem]} { 
     105        xinstall -d ${destroot}${prefix}/etc/LaunchDaemons/org.macports.logrotate 
     106        xinstall -d ${destroot}/Library/LaunchDaemons 
     107        xinstall -m 755 ${destroot}${prefix}/share/${name}/org.macports.logrotate.plist.example \ 
     108            ${destroot}${prefix}/etc/LaunchDaemons/org.macports.logrotate/org.macports.logrotate.plist 
     109        ln -sf "${prefix}/etc/LaunchDaemons/org.macports.logrotate/org.macports.logrotate.plist" "${destroot}/Library/LaunchDaemons/org.macports.logrotate.plist" 
     110    } 
    46111} 
    47112 
    48 destroot { 
    49   xinstall -m 755 ${worksrcpath}/logrotate ${destroot}${prefix}/sbin 
    50   xinstall -m 755 ${worksrcpath}/examples/logrotate-default \ 
    51     ${destroot}${prefix}/etc/logrotate.conf.sample 
    52   xinstall -m 444 ${worksrcpath}/logrotate.8 ${destroot}${prefix}/share/man/man8 
     113variant bzip2 conflicts gzip description {Use bzip2 compression by default} { 
     114    build.env-append \ 
     115                    COMPRESS_COMMAND="${prefix}/bin/bzip2" \ 
     116                    COMPRESS_EXT=".bz2" \ 
     117                    UNCOMPRESS_COMMAND="${prefix}/bin/bunzip2" 
     118    depends_run-append \ 
     119                    port:bzip2 
    53120} 
     121 
     122variant gzip conflicts bzip2 description {Use gzip compression by default} { 
     123    build.pre_args-append \ 
     124                    COMPRESS_COMMAND="${prefix}/bin/gzip" \ 
     125                    COMPRESS_EXT=".gz" \ 
     126                    UNCOMPRESS_COMMAND="${prefix}/bin/gunzip" 
     127    depends_run-append \ 
     128                    port:gzip 
     129} 
     130 
     131variant startupitem description {Install launchd plist} { 
     132} 
     133 
     134default_variants    +startupitem 
     135 
     136if {![variant_isset bzip2]} { 
     137    default_variants-append \ 
     138                    +gzip 
     139    variant_set     gzip 
     140} 
     141 
     142livecheck.type      regex 
     143livecheck.url       ${master_sites} 
     144livecheck.regex     ${name}-(\\d+\\.\\d+(\\.\\d+)?)${extract.suffix} 
     145 
     146notes \ 
     147" 
     148 
     149To use logrotate: 
     150 
     151  * If ${prefix}/etc/logrotate.conf does not exist copy the example into place. 
     152 
     153    \$ sudo cp ${prefix}/share/${name}/logrotate.conf.example ${prefix}/etc/logrotate.conf 
     154 
     155  * logrotate scripts added to ${prefix}/etc/logrotate.d will read by default 
     156 
     157    \$ sudo ${prefix}/sbin/${name} ${prefix}/etc/logrotate.conf 
     158 
     159  * With the +startupitem variant you can activate a scheduled log rotation with this command. 
     160 
     161    \$ sudo port load Logrotate 
     162 
     163  * To create your own startup item with non-default intervals build; without the +startupitem 
     164    variant, copy the example into place and manually edit to your liking. 
     165 
     166    \$ sudo cp ${prefix}/share/${name}/org.macports.logrotate.plist.example\ 
     167/Library/LaunchDaemons/org.macports.logrotate.plist 
     168 
     169    Once your /Library/LaunchDaemons/org.macports.logrotate.plist file is ready maunually load it 
     170    with this command. 
     171 
     172    \$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.logrotate.plist 
     173     
     174" 
Note: See TracChangeset for help on using the changeset viewer.