[82234] users/pixilla/dports
pixilla at macports.org
pixilla at macports.org
Wed Aug 10 18:30:10 PDT 2011
Revision: 82234
http://trac.macports.org/changeset/82234
Author: pixilla at macports.org
Date: 2011-08-10 18:30:10 -0700 (Wed, 10 Aug 2011)
Log Message:
-----------
sysutils/logrotate: Upgrade to 3.8.0.
Added Paths:
-----------
users/pixilla/dports/sysutils/
users/pixilla/dports/sysutils/logrotate/
users/pixilla/dports/sysutils/logrotate/Portfile
users/pixilla/dports/sysutils/logrotate/files/
users/pixilla/dports/sysutils/logrotate/files/patch-Makefile.diff
users/pixilla/dports/sysutils/logrotate/files/patch-config.c.diff
users/pixilla/dports/sysutils/logrotate/files/patch-examples-logrotate-default.diff
users/pixilla/dports/sysutils/logrotate/files/patch-logrotate.c.diff
Added: users/pixilla/dports/sysutils/logrotate/Portfile
===================================================================
--- users/pixilla/dports/sysutils/logrotate/Portfile (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/Portfile 2011-08-11 01:30:10 UTC (rev 82234)
@@ -0,0 +1,85 @@
+# -*- 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
+# $Id$
+
+PortSystem 1.0
+
+name logrotate
+version 3.8.0
+categories sysutils
+maintainers markd pixilla.com:brad
+platforms darwin
+
+description Rotates, compresses, and mails system logs
+
+long_description The logrotate utility is designed to simplify the administration of log files \
+ on a system which generates a lot of log files. Logrotate allows for the \
+ automatic rotation compression, removal and mailing of log files. Logrotate \
+ can be set to handle a log file \daily, weekly, monthly or when the log file \
+ gets to a certain size.
+
+homepage https://fedorahosted.org/logrotate/
+master_sites https://fedorahosted.org/releases/l/o/logrotate
+checksums sha1 a79c500c4ce45177b47bb473a6bff4021af7121e \
+ rmd160 7e1e24f53db5230eee2e1db8d90fe3a33692ca01
+
+livecheck.type regex
+livecheck.url ${master_sites}
+livecheck.regex ${name}-(\\d+\\.\\d+(\\.\\d+)?)${extract.suffix}
+
+patchfiles patch-Makefile.diff \
+ patch-examples-logrotate-default.diff \
+ patch-config.c.diff \
+ patch-logrotate.c.diff
+patch.pre_args -p1
+
+depends_run port:popt port:gettext port:gzip
+
+use_configure no
+
+set prefix_hack [string trimleft ${destroot}${prefix} /]
+
+destroot.env-append BASEDIR="${prefix_hack}"
+
+build.env BASEDIR="${prefix}" \
+ POPT_DIR="${prefix}/include" \
+ STATEFILE="${prefix}/var/run/logrotate/logrotate.status" \
+ DEFAULT_MAIL_COMMAND="/usr/sbin/mail" \
+ USEINSTALL="install"
+
+#build.args-append LDFLAGS="-L${prefix}/lib"
+
+post-patch {
+ reinplace "s|@@PREFIX@@|${prefix}|g" \
+ ${worksrcpath}/examples/logrotate-default
+}
+
+destroot.keepdirs ${destroot}${prefix}/etc/logrotate.d \
+ ${destroot}${prefix}/var/run/logrotate
+
+post-destroot {
+ xinstall -m 755 ${worksrcpath}/examples/logrotate-default \
+ ${destroot}${prefix}/etc/logrotate.conf.sample
+ xinstall -d ${destroot}${prefix}/etc/logrotate.d
+ xinstall -d ${destroot}${prefix}/var/run/logrotate
+}
+
+post-activate {
+ delete ${prefix}/etc/logrotate.d/.turd_${name} \
+ ${prefix}/var/run/logrotate/.turd_${name}
+}
+
+variant bzip2 description {change default compression to bzip} {
+ build.env-append COMPRESS_COMMAND="${prefix}/bin/bzip2" \
+ COMPRESS_EXT=".bz2" \
+ UNCOMPRESS_COMMAND="${prefix}/bin/bunzip2"
+ depends_run-delete port:gzip
+ depends_run-append port:bzip2
+}
+
+default_variants bzip2
+
+notes \
+"Copy ${prefix}/etc/logrotate.conf.sample to ${prefix}/etc/logrotate.conf for a start.
+Afterwards putting logrotate scripts in ${prefix}/etc/logrotate.d will cause them to
+be executed with the following command:
+\$ ${prefix}/bin/${name} ${prefix}/etc/logrotate.conf"
Property changes on: users/pixilla/dports/sysutils/logrotate/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: users/pixilla/dports/sysutils/logrotate/files/patch-Makefile.diff
===================================================================
--- users/pixilla/dports/sysutils/logrotate/files/patch-Makefile.diff (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/files/patch-Makefile.diff 2011-08-11 01:30:10 UTC (rev 82234)
@@ -0,0 +1,42 @@
+--- a/Makefile 2011-08-10 16:54:18.000000000 -0700
++++ b/Makefile 2011-08-10 18:02:54.000000000 -0700
+@@ -82,8 +82,29 @@
+ CFLAGS += -DSTATEFILE=\"$(STATEFILE)\"
+ endif
+
++ifneq ($(DEFAULT_MAIL_COMMAND),)
++ CFLAGS += -DDEFAULT_MAIL_COMMAND=\"$(DEFAULT_MAIL_COMMAND)\"
++endif
++
++ifneq ($(COMPRESS_COMMAND),)
++ CFLAGS += -DCOMPRESS_COMMAND=\"$(COMPRESS_COMMAND)\"
++endif
++
++ifneq ($(COMPRESS_EXT),)
++ CFLAGS += -DCOMPRESS_EXT=\"$(COMPRESS_EXT)\"
++endif
++
++ifneq ($(UNCOMPRESS_COMMAND),)
++ CFLAGS += -DUNCOMPRESS_COMMAND=\"$(UNCOMPRESS_COMMAND)\"
++endif
++
++ifeq ($(OS_NAME),Darwin)
++ INSTALL = install
++ LDFLAGS += -undefined dynamic_lookup
++endif
++
+ BINDIR = $(BASEDIR)/sbin
+-MANDIR = $(BASEDIR)/man
++MANDIR = $(BASEDIR)/share/man
+
+ #--------------------------------------------------------------------------
+
+@@ -92,7 +113,7 @@
+
+ ifeq ($(RPM_OPT_FLAGS),)
+ CFLAGS += -g
+-LDFLAGS = -g
++LDFLAGS += -g
+ endif
+
+ ifeq (.depend,$(wildcard .depend))
Added: users/pixilla/dports/sysutils/logrotate/files/patch-config.c.diff
===================================================================
--- users/pixilla/dports/sysutils/logrotate/files/patch-config.c.diff (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/files/patch-config.c.diff 2011-08-11 01:30:10 UTC (rev 82234)
@@ -0,0 +1,56 @@
+--- a/config.c 2011-08-10 16:54:18.000000000 -0700
++++ b/config.c 2011-08-10 17:08:36.000000000 -0700
+@@ -163,34 +163,25 @@
+ size_t len;
+
+ if ((start = isolateValue(configFile, lineNum, key, startPtr, buf, length)) != NULL) {
+-
+- chptr = start;
+-
+- while( (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0 ) {
+- if( len == (size_t)(-1) || len == (size_t)(-2) || !iswprint(pwc) || iswblank(pwc) ) {
+- message(MESS_ERROR, "%s:%d bad %s path %s\n",
+- configFile, lineNum, key, start);
+- return NULL;
+- }
+- chptr += len;
+- }
+-
+-/*
+- while (*chptr && isprint(*chptr) && *chptr != ' ')
+- chptr++;
+- if (*chptr) {
+- message(MESS_ERROR, "%s:%d bad %s path %s\n",
+- configFile, lineNum, key, start);
+- return NULL;
+- }
+-*/
+-
+- path = strdup(start);
+- free(start);
+-
+- return path;
+- } else
+- return NULL;
++
++ chptr = start;
++
++ while (*chptr && isprint(*chptr) && *chptr != ' ') {
++ chptr++;
++ }
++ if (*chptr) {
++ message(MESS_ERROR, "%s:%d bad %s path %s\n",
++ configFile, lineNum, key, start);
++ return NULL;
++ }
++
++ path = strdup(start);
++ free(start);
++
++ return path;
++ } else {
++ return NULL;
++ }
+ }
+
+ static char *readAddress(const char *configFile, int lineNum, char *key,
Added: users/pixilla/dports/sysutils/logrotate/files/patch-examples-logrotate-default.diff
===================================================================
--- users/pixilla/dports/sysutils/logrotate/files/patch-examples-logrotate-default.diff (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/files/patch-examples-logrotate-default.diff 2011-08-11 01:30:10 UTC (rev 82234)
@@ -0,0 +1,38 @@
+--- a/examples/logrotate-default 2011-08-10 16:54:18.000000000 -0700
++++ b/examples/logrotate-default 2011-08-10 17:08:36.000000000 -0700
+@@ -15,21 +15,21 @@
+ #compress
+
+ # RPM packages drop log rotation information into this directory
+-include /etc/logrotate.d
++include @@PREFIX@@/etc/logrotate.d
+
+ # no packages own wtmp and btmp -- we'll rotate them here
+-/var/log/wtmp {
+- monthly
+- create 0664 root utmp
+- minsize 1M
+- rotate 1
+-}
+-
+-/var/log/btmp {
+- missingok
+- monthly
+- create 0600 root utmp
+- rotate 1
+-}
++#/var/log/wtmp {
++# monthly
++# create 0664 root utmp
++# minsize 1M
++# rotate 1
++#}
++#
++#/var/log/btmp {
++# missingok
++# monthly
++# create 0600 root utmp
++# rotate 1
++#}
+
+ # system-specific logs may be also be configured here.
Added: users/pixilla/dports/sysutils/logrotate/files/patch-logrotate.c.diff
===================================================================
--- users/pixilla/dports/sysutils/logrotate/files/patch-logrotate.c.diff (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/files/patch-logrotate.c.diff 2011-08-11 01:30:10 UTC (rev 82234)
@@ -0,0 +1,13 @@
+--- a/logrotate.c 2011-08-10 16:54:18.000000000 -0700
++++ b/logrotate.c 2011-08-10 17:24:49.000000000 -0700
+@@ -21,6 +21,10 @@
+ #include <sys/types.h>
+ #include <utime.h>
+
++#if defined(Darwin)
++#include <limits.h>
++#endif
++
+ #if defined(SunOS)
+ #include <limits.h>
+ #endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110810/de6e4771/attachment.html>
More information about the macports-changes
mailing list