From fbf62cb7b2aa95f6b1bd5341be210f83cbf2fceb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Tue, 16 Feb 2021 03:52:21 -0300 Subject: [PATCH] recipes: tools/logrotate: Added version 3.18.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Matías Fonzo --- archive/logrotate/logrotate.cron | 15 ++++++ recipes/tools/logrotate/recipe | 94 ++++++++++++++++++++++++++++++++++ sources/SOURCELIST.txt | 1 + sources/logrotate-3.18.0.tar.gz.sha256 | 1 + 4 files changed, 111 insertions(+) create mode 100644 archive/logrotate/logrotate.cron create mode 100644 recipes/tools/logrotate/recipe create mode 100644 sources/logrotate-3.18.0.tar.gz.sha256 diff --git a/archive/logrotate/logrotate.cron b/archive/logrotate/logrotate.cron new file mode 100644 index 00000000..e7aec679 --- /dev/null +++ b/archive/logrotate/logrotate.cron @@ -0,0 +1,15 @@ +#! /bin/sh - +# +# /etc/cron.daily/logrotate - Rotates system logs periodically. +# + +/usr/sbin/logrotate /etc/logrotate.conf +status=$? + +if test $status -ne 0 +then + /usr/bin/logger \ + -t logrotate "ALERT exited abnormally with exit status $status" +fi +exit $status + diff --git a/recipes/tools/logrotate/recipe b/recipes/tools/logrotate/recipe new file mode 100644 index 00000000..110fe4d1 --- /dev/null +++ b/recipes/tools/logrotate/recipe @@ -0,0 +1,94 @@ +# Build recipe for logrotate. +# +# Copyright (c) 2017 Alan Beadle, . +# Copyright (c) 2021 Matias Fonzo, . +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +program=logrotate +version=3.18.0 +release=1 + +# Define a category for the output of the package name +pkgcategory=tools + +tarname=${program}-${version}.tar.gz + +# Remote source(s) +fetch=https://github.com/logrotate/logrotate/releases/download/${version}/${tarname} + +description=" +Utility to rotate system logs automatically. + +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://github.com/logrotate/logrotate +license=GPLv2+ + +# Source documentation +docs="ChangeLog.md COPYING README.md" +docsdir="${docdir}/${program}-${version}" + +build() +{ + set -e + + unpack "${tardir}/$tarname" + + cd "$srcdir" + + # Set sane permissions + chmod -R u+w,go-w,a+rX-s . + + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \ + $configure_args \ + --mandir=$mandir \ + --with-compress-command="/usr/bin/lzip -9"\ + --with-uncompress-command="/usr/bin/lzip -d" \ + --with-compress-extension=.lz \ + --with-default-mail-command=/usr/bin/mail \ + --with-acl \ + --without-selinux \ + --build="$(gcc -dumpmachine)" + + make -j${jobs} V=1 + make -j${jobs} DESTDIR="$destdir" install + + mkdir -p "${destdir}/etc/logrotate.d" "${destdir}/etc/cron.daily" + + cp -p examples/logrotate.conf "${destdir}/etc" + chmod 644 "${destdir}/etc/logrotate.conf" + + # To make use of the compression by default + sed -i "s|#compress|compress|" "${destdir}/etc/logrotate.conf" + + touch "${destdir}/etc/.graft-config" + + cp -p "${worktree}/archive/logrotate/logrotate.cron" \ + "${destdir}/etc/cron.daily/logrotate" + chmod 755 "${destdir}/etc/cron.daily/logrotate" + + # Compress man pages + lzip -9 "${destdir}/${mandir}"/man?/* + + # Copy documentation + mkdir -p "${destdir}${docsdir}" + cp -p $docs "${destdir}${docsdir}" +} + diff --git a/sources/SOURCELIST.txt b/sources/SOURCELIST.txt index 911c29d7..3dc9f31a 100644 --- a/sources/SOURCELIST.txt +++ b/sources/SOURCELIST.txt @@ -567,3 +567,4 @@ https://xmlsoft.org/sources/libxslt-1.1.34.tar.gz https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-1.14.1.tar.xz https://zlib.net/zlib-1.2.11.tar.gz https://github.com/troglobit/sysklogd/releases/download/v2.2.1/sysklogd-2.2.1.tar.gz +https://github.com/logrotate/logrotate/releases/download/3.18.0/logrotate-3.18.0.tar.gz diff --git a/sources/logrotate-3.18.0.tar.gz.sha256 b/sources/logrotate-3.18.0.tar.gz.sha256 new file mode 100644 index 00000000..b2ef6066 --- /dev/null +++ b/sources/logrotate-3.18.0.tar.gz.sha256 @@ -0,0 +1 @@ +ceddb34dd2f33c324413e6eacb548cc5b873276709154895a44cf6259d2d37b6 logrotate-3.18.0.tar.gz -- 2.11.4.GIT