Changeset 82675
- Timestamp:
- 08/17/11 16:09:48 (4 years ago)
- Location:
- trunk/dports/sysutils/logrotate
- Files:
-
- 3 added
- 1 edited
-
Portfile (modified) (2 diffs)
-
files (added)
-
files/patch-Makefile.diff (added)
-
files/patch-config.c.diff (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dports/sysutils/logrotate/Portfile
r82672 r82675 5 5 6 6 name logrotate 7 version 3.7.1 8 revision 3 7 version 3.8.0 9 8 categories sysutils 10 9 maintainers pixilla openmaintainer … … 19 18 gets to a certain size. 20 19 21 distname ${name}_${version}.orig 22 worksrcdir ${name}-${version} 20 homepage https://fedorahosted.org/logrotate/ 21 master_sites gentoo 22 checksums sha1 a79c500c4ce45177b47bb473a6bff4021af7121e \ 23 rmd160 7e1e24f53db5230eee2e1db8d90fe3a33692ca01 23 24 24 homepage http://packages.debian.org/stable/admin/logrotate 25 patch.pre_args -p1 26 patchfiles patch-config.c.diff \ 27 patch-Makefile.diff 25 28 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 29 depends_run port:popt port:gettext 29 30 30 patch_sites http://ftp.debian.org/debian/pool/main/l/logrotate/ 31 patchfiles logrotate_${version}-5.diff.gz 31 post-extract { 32 touch ${worksrcpath}/.depend 33 } 32 34 33 depends_run port:popt \ 34 port:gettext \ 35 port:gzip 35 post-patch { 36 reinplace "s|@@PREFIX@@|${prefix}|g" \ 37 ${worksrcpath}/examples/logrotate-default 38 } 36 39 37 40 use_configure no 38 41 39 build.args POPT_DIR=${prefix}/include LDFLAGS="-L${prefix}/lib -lpopt" 42 build.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" 40 49 41 post-patch { 42 reinplace "s|\"/bin/gzip\"|\"${prefix}/bin/gzip\"|g" \ 43 ${worksrcpath}/config.h 50 destroot.args INSTALL="install" \ 51 BASEDIR=[string trimleft ${destroot}${prefix} /] \ 52 MANDIR="${prefix}/share/man" 53 destroot.keepdirs ${destroot}${prefix}/etc/logrotate.d \ 54 ${destroot}${prefix}/var/run/logrotate 55 post-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 61 weekly 44 62 45 system "cd ${worksrcpath} && patch -p1 < logrotate-${version}/debian/patches/rh-dateext.patch" 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 } 46 111 } 47 112 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 113 variant 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 53 120 } 121 122 variant 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 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 140 } 141 142 livecheck.type regex 143 livecheck.url ${master_sites} 144 livecheck.regex ${name}-(\\d+\\.\\d+(\\.\\d+)?)${extract.suffix} 145 146 notes \ 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.

