Ticket #26195: Portfile

File Portfile, 3.1 KB (added by pixilla (Bradley Giesbrecht), 14 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id:$
3
4PortSystem          1.0
5
6name                logrotate
7version             3.7.9
8categories          sysutils
9maintainers         markd pixilla.com:brad
10platforms           darwin
11
12description         Rotates, compresses, and mails system logs
13
14long_description    The logrotate utility is designed to simplify the administration of log files \
15                    on a system which generates a lot of log files. Logrotate allows for the \
16                    automatic rotation compression, removal and mailing of log files. Logrotate \
17                    can be set to handle a log file \daily, weekly, monthly or when the log file \
18                    gets to a certain size.
19
20homepage            https://fedorahosted.org/logrotate/
21master_sites        https://fedorahosted.org/releases/l/o/logrotate
22checksums           sha1    b920f9664a2c930f1ccdabc0db4f31f67cf95661 \
23                    rmd160  e3fb77e37c454a52566f7d5b017d70c9dddf9b66
24
25livecheck.type      regex
26livecheck.url       ${master_sites}
27livecheck.regex     ${name}-(\\d+\\.\\d+(\\.\\d+)?)${extract.suffix}
28
29patchfiles          patch-Makefile.diff \
30                    patch-examples-logrotate-default.diff \
31                    patch-config.c.diff \
32                    patch-logrotate.c.diff
33
34depends_run         port:popt port:gettext port:gzip
35
36use_configure       no
37
38set prefix_hack     [string trimleft ${destroot}${prefix} /]
39
40destroot.env-append BASEDIR="${prefix_hack}"
41
42build.env           BASEDIR="${prefix}" \
43                    POPT_DIR="{$prefix}/include" \
44                    STATEFILE="${prefix}/var/run/logrotate/logrotate.status" \
45                    DEFAULT_MAIL_COMMAND="/usr/sbin/mail" \
46                    USEINSTALL="install"
47
48#build.args-append   LDFLAGS="-L${prefix}/lib"
49                   
50post-patch {
51        reinplace "s|@@PREFIX@@|${prefix}|g" \
52                ${worksrcpath}/examples/logrotate-default
53}
54
55destroot.keepdirs   ${destroot}${prefix}/etc/logrotate.d \
56                    ${destroot}${prefix}/var/run/logrotate
57
58post-destroot {
59                xinstall -m 755 ${worksrcpath}/examples/logrotate-default \
60                        ${destroot}${prefix}/etc/logrotate.conf.sample
61    xinstall -d ${destroot}${prefix}/etc/logrotate.d
62    xinstall -d ${destroot}${prefix}/var/run/logrotate
63}
64
65post-activate {
66    delete  ${prefix}/etc/logrotate.d/.turd_${name} \
67            ${prefix}/var/run/logrotate/.turd_${name}
68}
69
70variant bzip2 description {change default compression to bzip} {
71    build.env-append    COMPRESS_COMMAND="${prefix}/bin/bzip2" \
72                        COMPRESS_EXT=".bz2" \
73                        UNCOMPRESS_COMMAND="${prefix}/bin/bunzip2"
74    depends_run-delete  port:gzip
75    depends_run-append  port:bzip2
76}
77
78notes \
79"Copy ${prefix}/etc/logrotate.conf.sample to ${prefix}/etc/logrotate.conf for a start.
80Afterwards putting logrotate scripts in ${prefix}/etc/logrotate.d will cause them to
81be executed with the following command:
82\$ ${prefix}/bin/${name} ${prefix}/etc/logrotate.conf"