/
Portfile
107 lines (84 loc) · 3.46 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# -*- 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
PortSystem 1.0
PortGroup github 1.0
PortGroup legacysupport 1.1
# Need O_CLOEXEC
legacysupport.newest_darwin_requires_legacy 10
github.setup logrotate logrotate 3.21.0
revision 0
github.tarball_from releases
use_xz yes
checksums rmd160 9e1edb08441ae239a8471f81b8d589772e3d5243 \
sha256 8fa12015e3b8415c121fc9c0ca53aa872f7b0702f543afda7e32b6c4900f6516 \
size 168532
categories sysutils
license GPL-2
maintainers {ctreleaven @ctreleaven} openmaintainer
description Rotates, compresses, and mails system logs
long_description The logrotate utility is designed to simplify the administration of logs \
on a system which generates a lot of log files. Logrotate provides \
automatic rotation, compression (gzip by default), removal and mailing \
of log files. Logrotate can be set to handle a log file daily, weekly, \
monthly or when the log file exceeds a certain size.
installs_libs no
depends_lib port:popt
depends_run port:gettext \
port:gzip
set compress ${prefix}/bin/gzip
set compress_ext .gz
set uncompress ${prefix}/bin/gunzip
post-extract {
touch ${worksrcpath}/.depend
copy ${filespath}/logrotate.conf.example \
${worksrcpath}/
copy ${filespath}/org.macports.logrotate.plist.example \
${worksrcpath}/
}
post-patch {
reinplace "s|@PREFIX@|${prefix}|g" \
${worksrcpath}/logrotate.conf.example
reinplace "s|@PREFIX@|${prefix}|g" \
${worksrcpath}/org.macports.logrotate.plist.example
}
use_autoconf yes
configure.args-append \
--disable-silent-rules\
--with-state-file-path=${prefix}/var/run/logrotate/logrotate.status \
--with-default-mail-command=/bin/mail \
--with-compress-command=${compress} \
--with-uncompress-command=${uncompress} \
--with-compress-extension=${compress_ext}
destroot.keepdirs ${destroot}${prefix}/etc/logrotate.d \
${destroot}${prefix}/var/run/logrotate
post-destroot {
xinstall -d ${destroot}${prefix}/share/${name}
xinstall -m 644 -W ${worksrcpath} ChangeLog.md COPYING logrotate.conf.example \
${destroot}${prefix}/share/${name}
}
startupitem.type launchd
startupitem.create no
startupitem.custom_file \
${worksrcpath}/org.macports.logrotate.plist.example
pre-activate {
# launchd plist was formerly unregistered; delete if found
# this block can be deleted in a couple of years (2025)
delete /Library/LaunchDaemons/org.macports.logrotate.plist
}
post-activate {
if {![file exists ${prefix}/etc/logrotate.conf]} {
copy ${prefix}/share/${name}/logrotate.conf.example ${prefix}/etc/logrotate.conf
}
}
variant bzip2 description {Use bzip2 compression by default} {
set compress ${prefix}/bin/bzip2
set compress_ext .bz2
set uncompress ${prefix}/bin/bunzip2
depends_run-replace \
port:gzip port:bzip2
}
notes "
To use logrotate:
* See 'man logrotate' for configuration options.
* Enable daily log rotation with this command.
\$ sudo port load logrotate
"