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.
22 # Define a category for the output of the package name
25 tarname=${program}-${version}.tar.gz
28 fetch=https://github.com/logrotate/logrotate/releases/download/${version}/${tarname}
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
43 # Source documentation
44 docs="ChangeLog.md COPYING README.md"
45 docsdir="${docdir}/${program}-${version}"
51 unpack "${tardir}/$tarname"
55 # Set sane permissions
56 chmod -R u+w,go-w,a+rX-s .
58 ./configure CPPFLAGS="$QICPPFLAGS" \
59 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
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 \
68 --build="$(gcc -dumpmachine)"
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"
88 lzip -9 "${destdir}/${mandir}"/man?/*
91 mkdir -p "${destdir}${docsdir}"
92 cp -p $docs "${destdir}${docsdir}"