recipes: tools/logrotate: Added version 3.18.0
[dragora.git] / recipes / tools / logrotate / recipe
blob110fe4d120e9e4644d9f53876a01b93115e1eb20
1 # Build recipe for logrotate.
3 # Copyright (c) 2017 Alan Beadle, <ab.beadle@gmail.com>.
4 # Copyright (c) 2021 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 program=logrotate
19 version=3.18.0
20 release=1
22 # Define a category for the output of the package name
23 pkgcategory=tools
25 tarname=${program}-${version}.tar.gz
27 # Remote source(s)
28 fetch=https://github.com/logrotate/logrotate/releases/download/${version}/${tarname}
30 description="
31 Utility to rotate system logs automatically.
33 The logrotate utility is designed to simplify the administration of
34 log files on a system which generates a lot of log files.  Logrotate
35 allows for the automatic rotation compression, removal and mailing of
36 log files.  Logrotate can be set to handle a log file daily, weekly,
37 monthly or when the log file gets to a certain size.
40 homepage=https://github.com/logrotate/logrotate
41 license=GPLv2+
43 # Source documentation
44 docs="ChangeLog.md COPYING README.md"
45 docsdir="${docdir}/${program}-${version}"
47 build()
49     set -e
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Set sane permissions
56     chmod -R u+w,go-w,a+rX-s .
58     ./configure CPPFLAGS="$QICPPFLAGS" \
59     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
60      $configure_args \
61      --mandir=$mandir \
62      --with-compress-command="/usr/bin/lzip -9"\
63      --with-uncompress-command="/usr/bin/lzip -d" \
64      --with-compress-extension=.lz \
65      --with-default-mail-command=/usr/bin/mail \
66      --with-acl \
67      --without-selinux \
68      --build="$(gcc -dumpmachine)"
70     make -j${jobs} V=1
71     make -j${jobs} DESTDIR="$destdir" install
73     mkdir -p "${destdir}/etc/logrotate.d" "${destdir}/etc/cron.daily"
75     cp -p examples/logrotate.conf "${destdir}/etc"
76     chmod 644 "${destdir}/etc/logrotate.conf"
78     # To make use of the compression by default
79     sed -i "s|#compress|compress|" "${destdir}/etc/logrotate.conf"
81     touch "${destdir}/etc/.graft-config"
83     cp -p "${worktree}/archive/logrotate/logrotate.cron" \
84           "${destdir}/etc/cron.daily/logrotate"
85     chmod 755 "${destdir}/etc/cron.daily/logrotate"
87     # Compress man pages
88     lzip -9 "${destdir}/${mandir}"/man?/*
90     # Copy documentation
91     mkdir -p "${destdir}${docsdir}"
92     cp -p $docs "${destdir}${docsdir}"