[Lunar-commits] <moonbase> logrotate: Version bump to 3.7.8

Stefan Wold ratler at lunar-linux.org
Sat Nov 7 11:36:59 CET 2009


commit 3258a43480cc976c7335a4b51149990950b53a01
Author: Stefan Wold <ratler at lunar-linux.org>
Date:   Sat Nov 7 11:36:59 2009 +0100

    logrotate: Version bump to 3.7.8
    
    * BUILD: Cleaned up
    * Added logrotate.plugin, just add logrotate.d/file in the module to
      have it installed in /etc/logrotate.d/
---
 utils/logrotate/BUILD                     |   29 +++++++++--------------
 utils/logrotate/DEPENDS                   |    1 +
 utils/logrotate/DETAILS                   |   14 ++++-------
 utils/logrotate/plugin.d/logrotate.plugin |   36 +++++++++++++++++++++++++++++
 4 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/utils/logrotate/BUILD b/utils/logrotate/BUILD
index 2bb5d66..1aae92e 100644
--- a/utils/logrotate/BUILD
+++ b/utils/logrotate/BUILD
@@ -1,34 +1,27 @@
 (
 
-  patch_it $SOURCE2 1 &&
-  
   # Logrotate craps out without this
-  unset CPP                             &&
-  make                               &&
+  unset CPP
+
+  make RPM_OPT_FLAGS="${CFLAGS}"     &&
   prepare_install                    &&
   make install                       &&
 
-  mkdir -p /etc/logrotate.d          &&
-  mkdir -p /var/state/logrotate      &&
-  mkdir -p /usr/share/doc/logrotate  &&
+  mkdir -p /etc/logrotate.d \
+           /var/lib/logrotate &&
 
   if [ ! -e /etc/logrotate.conf ] ; then
-    cp examples/logrotate-default /etc/logrotate.conf &&
-    chmod 0644 /etc/logrotate.conf
+    install -m 0644 examples/logrotate-default /etc/logrotate.conf
   fi &&
 
-  if [ -d /etc/cron.daily -a ! -e /etc/cron.daily/logrotate ]; then
-    cp examples/logrotate.cron /etc/cron.daily/logrotate &&
-    chmod 0755 /etc/cron.daily/logrotate
+  if [ ! -d /etc/cron.daily ]; then 
+    mkdir -p /etc/cron.daily
   fi &&
 
-  if [ -d /usr/share/doc/logrotate ]; then
-    cp -r examples /usr/share/doc/logrotate/
+  if [ ! -e /etc/cron.daily/logrotate ]; then
+    install -m 0644 examples/logrotate.cron /etc/cron.daily/logrotate
   fi &&
 
-  chmod 0755 /usr/sbin/logrotate                        &&
-  chmod 0644 /usr/share/man/man8/logrotate.8            &&
-  chmod 0755 /etc/logrotate.d                           &&
-  chmod 0755 /var/state/logrotate
+  gather_docs examples
 
 ) > $C_FIFO 2>&1
diff --git a/utils/logrotate/DEPENDS b/utils/logrotate/DEPENDS
new file mode 100644
index 0000000..a3980d8
--- /dev/null
+++ b/utils/logrotate/DEPENDS
@@ -0,0 +1 @@
+depends popt
diff --git a/utils/logrotate/DETAILS b/utils/logrotate/DETAILS
index 960e458..cadd98e 100644
--- a/utils/logrotate/DETAILS
+++ b/utils/logrotate/DETAILS
@@ -1,15 +1,11 @@
           MODULE=logrotate
-         VERSION=3.7
+         VERSION=3.7.8
           SOURCE=$MODULE-$VERSION.tar.gz
-         SOURCE2=$MODULE-$VERSION.patch.gz
-   SOURCE_URL[0]=ftp://ftp.su.se/pub/lunar/source-archive/
-   SOURCE_URL[1]=http://kenny.it.su.se/lunar/source-archive/
-     SOURCE2_URL=$PATCH_URL
-      SOURCE_VFY=sha1:b33a21f4f485e5f0a95c98e9a4abc09bfdaf0bde
-     SOURCE2_VFY=sha1:bec2fe494de9267b9ec9cd22d4f8bef429596a28
+      SOURCE_URL=https://fedorahosted.org/releases/l/o/logrotate
+      SOURCE_VFY=sha1:5742dc0d9541ac59eba5f5718520f7504aea2159
          ENTERED=20021231
-         UPDATED=20040707
-           SHORT="automatic rotation compression, removal, of log files."
+         UPDATED=20091107
+           SHORT="Automatic rotation, compression and removal of log files"
 cat << EOF
 The logrotate utility is designed to simplify the administration of
 log files on a system which generates a lot of log files. Logrotate
diff --git a/utils/logrotate/plugin.d/logrotate.plugin b/utils/logrotate/plugin.d/logrotate.plugin
new file mode 100644
index 0000000..bb9cffc
--- /dev/null
+++ b/utils/logrotate/plugin.d/logrotate.plugin
@@ -0,0 +1,36 @@
+#!/bin/bash
+######################################################
+#                                                    #
+# logrotate.plugin - handling of logrotate files     #
+#                                                    #
+######################################################
+#                                                    #
+# Copyright 2009 by Stefan Wold under GPLv2          #
+#                                                    #
+######################################################
+
+
+plugin_logrotate_post_build()
+{
+  local FILE SPATH LOGDPATH
+  SPATH="$SCRIPT_DIRECTORY/logrotate.d"
+  LOGDPATH="/etc/logrotate.d"
+
+  debug_msg "plugin_logrotate_post_build ($@)"
+  if [ -d "$SPATH" ] ; then
+    verbose_msg "Handling logrotate files"
+    invoke_installwatch
+    
+    [ -d $LOGDPATH ] || mkdir -p $LOGDPATH
+
+    for FILE in $SPATH/*; do
+      if [ ! -f $LOGDPATH/$FILE ]; then
+        /usr/bin/install -g 0 -o 0 -m 0644 $FILE $LOGDPATH/
+      fi
+    done
+    devoke_installwatch
+  fi
+  return 2
+}
+
+plugin_register BUILD_POST_BUILD plugin_logrotate_post_build


More information about the Lunar-commits mailing list