recipe 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Build recipe for logrotate.
  2. #
  3. # Copyright (c) 2017 Alan Beadle, <ab.beadle@gmail.com>.
  4. # Copyright (c) 2021 Matias Fonzo, <selk@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. # Exit immediately on any error
  18. set -e
  19. program=logrotate
  20. version=3.18.0
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=tools
  24. tarname=${program}-${version}.tar.gz
  25. # Remote source(s)
  26. fetch=https://github.com/logrotate/logrotate/releases/download/${version}/${tarname}
  27. description="
  28. Utility to rotate system logs automatically.
  29. The logrotate utility is designed to simplify the administration of
  30. log files on a system which generates a lot of log files. Logrotate
  31. allows for the automatic rotation compression, removal and mailing of
  32. log files. Logrotate can be set to handle a log file daily, weekly,
  33. monthly or when the log file gets to a certain size.
  34. "
  35. homepage=https://github.com/logrotate/logrotate
  36. license=GPLv2+
  37. # Source documentation
  38. docs="ChangeLog.md COPYING README.md"
  39. docsdir="${docdir}/${program}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. ./configure CPPFLAGS="$QICPPFLAGS" \
  47. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  48. $configure_args \
  49. --mandir=$mandir \
  50. --with-compress-command="/usr/bin/lzip -9"\
  51. --with-uncompress-command="/usr/bin/lzip -d" \
  52. --with-compress-extension=.lz \
  53. --with-default-mail-command=/usr/bin/mail \
  54. --with-acl \
  55. --without-selinux \
  56. --build="$(gcc -dumpmachine)"
  57. make -j${jobs} V=1
  58. make -j${jobs} DESTDIR="$destdir" install
  59. mkdir -p "${destdir}/etc/logrotate.d" "${destdir}/etc/cron.daily"
  60. cp -p examples/logrotate.conf "${destdir}/etc"
  61. chmod 644 "${destdir}/etc/logrotate.conf"
  62. # To make use of the compression by default
  63. sed -i "s|#compress|compress|" "${destdir}/etc/logrotate.conf"
  64. touch "${destdir}/etc/.graft-config"
  65. cp -p "${worktree}/archive/logrotate/logrotate.cron" \
  66. "${destdir}/etc/cron.daily/logrotate"
  67. chmod 755 "${destdir}/etc/cron.daily/logrotate"
  68. # Compress man pages
  69. lzip -9 "${destdir}/${mandir}"/man?/*
  70. # Copy documentation
  71. mkdir -p "${destdir}${docsdir}"
  72. cp -p $docs "${destdir}${docsdir}"
  73. }