1 # Build recipe for logrotate.
3 # Copyright (c) 2017 Alan Beadle, <ab.beadle@gmail.com>.
4 # Copyright (c) 2021-2022 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 # Exit immediately on any error
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.gz
31 fetch=https://github.com/logrotate/logrotate/releases/download/${version}/${tarname}
34 Utility to rotate system logs automatically.
36 The logrotate utility is designed to simplify the administration of
37 log files on a system which generates a lot of log files. Logrotate
38 allows for the automatic rotation compression, removal and mailing of
39 log files. Logrotate can be set to handle a log file daily, weekly,
40 monthly or when the log file gets to a certain size.
43 homepage=https://github.com/logrotate/logrotate
46 # Source documentation
47 docs="ChangeLog.md COPYING README.md"
48 docsdir="${docdir}/${program}-${version}"
52 unpack "${tardir}/$tarname"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
59 ./configure CPPFLAGS="$QICPPFLAGS" \
60 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
63 --with-compress-command="/usr/bin/lzip -9"\
64 --with-uncompress-command="/usr/bin/lzip -d" \
65 --with-compress-extension=.lz \
66 --with-default-mail-command=/usr/bin/mail \
69 --build="$(gcc -dumpmachine)"
72 make -j${jobs} DESTDIR="$destdir" install
74 mkdir -p "${destdir}/etc/logrotate.d" "${destdir}/etc/cron.daily"
76 cp -p examples/logrotate.conf "${destdir}/etc"
77 chmod 644 "${destdir}/etc/logrotate.conf"
79 # To make use of the compression by default
80 sed -i "s|#compress|compress|" "${destdir}/etc/logrotate.conf"
82 touch "${destdir}/etc/.graft-config"
84 cp -p "${worktree}/archive/logrotate/logrotate.cron" \
85 "${destdir}/etc/cron.daily/logrotate"
86 chmod 755 "${destdir}/etc/cron.daily/logrotate"
89 lzip -9 "${destdir}/${mandir}"/man?/*
92 mkdir -p "${destdir}/$docsdir"
93 cp -p $docs "${destdir}/$docsdir"