Changeset 82674
- Timestamp:
- 08/17/11 15:54:28 (4 years ago)
- File:
-
- 1 edited
-
users/pixilla/dports/sysutils/logrotate/Portfile (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
users/pixilla/dports/sysutils/logrotate/Portfile
r82307 r82674 7 7 version 3.8.0 8 8 categories sysutils 9 maintainers markdopenmaintainer9 maintainers pixilla openmaintainer 10 10 platforms darwin 11 11 … … 54 54 ${destroot}${prefix}/var/run/logrotate 55 55 post-destroot { 56 xinstall -m 755 ${worksrcpath}/examples/logrotate-default \ 57 ${destroot}${prefix}/etc/logrotate.conf.sample 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 61 weekly 62 63 # keep 4 weeks worth of backlogs 64 rotate 4 65 66 # create new (empty) log files after rotating old ones 67 create 68 69 # use date as a suffix of the rotated file 70 dateext 71 72 # uncomment this if you want your log files compressed 73 #compress 74 75 # Drop log rotation information into this directory 76 include ${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 } 58 111 } 59 112 … … 76 129 } 77 130 78 if {![variant_isset gzip]} { 79 default_variants +bzip2 80 variant_set bzip2 131 variant startupitem description {Install launchd plist} { 132 } 133 134 default_variants +startupitem 135 136 if {![variant_isset bzip2]} { 137 default_variants-append \ 138 +gzip 139 variant_set gzip 81 140 } 82 141 … … 86 145 87 146 notes \ 88 "Copy ${prefix}/etc/logrotate.conf.sample to ${prefix}/etc/logrotate.conf for a start: 89 \$ cp ${prefix}/etc/logrotate.conf.sample ${prefix}/etc/logrotate.conf 90 Afterwards putting logrotate scripts in ${prefix}/etc/logrotate.d will cause them to 91 be executed with the following command: 92 \$ ${prefix}/bin/${name} ${prefix}/etc/logrotate.conf" 147 " 148 149 To 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.

