recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tools / logrotate / recipe
blobec4b11f007b8e788d4e3cdeb802d1fb6f9ac33f8
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
19 set -e
21 program=logrotate
22 version=3.19.0
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=tools
28 tarname=${program}-${version}.tar.gz
30 # Remote source(s)
31 fetch=https://github.com/logrotate/logrotate/releases/download/${version}/${tarname}
33 description="
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
44 license=GPLv2+
46 # Source documentation
47 docs="ChangeLog.md COPYING README.md"
48 docsdir="${docdir}/${program}-${version}"
50 build()
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     ./configure CPPFLAGS="$QICPPFLAGS" \
60     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
61      $configure_args \
62      --mandir=$mandir \
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 \
67      --with-acl \
68      --without-selinux \
69      --build="$(gcc -dumpmachine)"
71     make -j${jobs} V=1
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"
88     # Compress man pages
89     lzip -9 "${destdir}/${mandir}"/man?/*
91     # Copy documentation
92     mkdir -p "${destdir}/$docsdir"
93     cp -p $docs "${destdir}/$docsdir"