logwatch-7.4.3.ebuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils
  5. DESCRIPTION="Analyzes and Reports on system logs"
  6. HOMEPAGE="http://www.logwatch.org/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm hppa ppc ppc64 sparc x86 ~x86-fbsd"
  11. IUSE=""
  12. DEPEND=""
  13. RDEPEND="virtual/cron
  14. virtual/mta
  15. virtual/mailx
  16. dev-lang/perl
  17. dev-perl/Date-Calc
  18. dev-perl/Date-Manip
  19. dev-perl/Tie-IxHash
  20. dev-perl/Sys-CPU
  21. dev-perl/Sys-MemInfo"
  22. src_prepare() {
  23. epatch "${FILESDIR}"/${PN}-7.4.2-openssh-hpn.patch
  24. }
  25. src_install() {
  26. dodir /usr/share/logwatch/lib
  27. dodir /usr/share/logwatch/scripts/services
  28. dodir /usr/share/logwatch/scripts/shared
  29. dodir /usr/share/logwatch/default.conf/logfiles
  30. dodir /usr/share/logwatch/default.conf/services
  31. dodir /usr/share/logwatch/default.conf/html
  32. keepdir /etc/logwatch
  33. newsbin scripts/logwatch.pl logwatch.pl
  34. exeinto /usr/share/logwatch/lib
  35. doexe lib/*.pm
  36. exeinto /usr/share/logwatch/scripts/services
  37. doexe scripts/services/*
  38. exeinto /usr/share/logwatch/scripts/shared
  39. doexe scripts/shared/*
  40. insinto /usr/share/logwatch/default.conf
  41. doins conf/logwatch.conf
  42. insinto /usr/share/logwatch/default.conf/logfiles
  43. doins conf/logfiles/*
  44. insinto /usr/share/logwatch/default.conf/services
  45. doins conf/services/*
  46. insinto /usr/share/logwatch/default.conf/html
  47. doins conf/html/*
  48. # Make sure logwatch is run before anything else #100243
  49. exeinto /etc/cron.daily
  50. newexe "${FILESDIR}"/logwatch 00-logwatch
  51. doman logwatch.8
  52. dodoc README HOWTO-Customize-LogWatch
  53. # Do last due to insopts modification.
  54. insinto /usr/share/logwatch/scripts/logfiles
  55. insopts -m755
  56. doins -r scripts/logfiles/*
  57. }
  58. pkg_postinst() {
  59. if [[ -e ${ROOT}/etc/cron.daily/logwatch ]] ; then
  60. local md5=$(md5sum "${ROOT}"/etc/cron.daily/logwatch)
  61. [[ ${md5} == "edb003cbc0686ed4cf37db16025635f3" ]] \
  62. && rm -f "${ROOT}"/etc/cron.daily/logwatch \
  63. || ewarn "You have two logwatch files in /etc/cron.daily/"
  64. fi
  65. }