sys-apps/irqbalance: arm64 keyworded (bug #721536)
[gentoo.git] / sys-apps / logwatch / logwatch-7.5.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit tmpfiles
7
8 PATCHES=()
9
10 if [[ ${PV} == "9999" ]] ; then
11         EGIT_REPO_URI="https://git.code.sf.net/p/logwatch/git ${PN}"
12         inherit git-r3
13 else
14         SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz"
15         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
16 fi
17
18 DESCRIPTION="Analyzes and Reports on system logs"
19 HOMEPAGE="http://www.logwatch.org/"
20
21 LICENSE="MIT"
22 SLOT="0"
23 IUSE=""
24
25 DEPEND=""
26 RDEPEND="virtual/cron
27         virtual/mta
28         virtual/mailx
29         dev-lang/perl
30         dev-perl/Date-Calc
31         dev-perl/Date-Manip
32         dev-perl/Tie-IxHash
33         dev-perl/Sys-CPU
34         dev-perl/Sys-MemInfo"
35
36 src_install() {
37         dodir /usr/share/logwatch/lib
38         dodir /usr/share/logwatch/scripts/services
39         dodir /usr/share/logwatch/scripts/shared
40         dodir /usr/share/logwatch/default.conf/logfiles
41         dodir /usr/share/logwatch/default.conf/services
42         dodir /usr/share/logwatch/default.conf/html
43         keepdir /etc/logwatch
44
45         # logwatch.pl requires cache dir (bug #607668)
46         newtmpfiles "${FILESDIR}"/logwatch.tmpfile ${PN}.conf
47
48         newsbin scripts/logwatch.pl logwatch.pl
49
50         exeinto /usr/share/logwatch/lib
51         doexe lib/*.pm
52
53         exeinto /usr/share/logwatch/scripts/services
54         doexe scripts/services/*
55
56         exeinto /usr/share/logwatch/scripts/shared
57         doexe scripts/shared/*
58
59         insinto /usr/share/logwatch/default.conf
60         doins conf/logwatch.conf
61
62         insinto /usr/share/logwatch/default.conf/logfiles
63         doins conf/logfiles/*
64
65         insinto /usr/share/logwatch/default.conf/services
66         doins conf/services/*
67
68         insinto /usr/share/logwatch/default.conf/html
69         doins conf/html/*
70
71         # Make sure logwatch is run before anything else #100243
72         exeinto /etc/cron.daily
73         newexe "${FILESDIR}"/logwatch 00-logwatch
74
75         doman logwatch.8
76         dodoc README HOWTO-Customize-LogWatch
77
78         # Do last due to insopts modification.
79         insinto /usr/share/logwatch/scripts/logfiles
80         insopts -m755
81         doins -r scripts/logfiles/*
82 }
83
84 pkg_postinst() {
85         # Migration from /etc/cron.daily/logwatch -> /etc/cron.daily/00-logwatch (bug #100243)
86         if [[ -e ${ROOT}/etc/cron.daily/logwatch ]] ; then
87                 local md5=$(md5sum "${ROOT}"/etc/cron.daily/logwatch)
88                 [[ ${md5} == "edb003cbc0686ed4cf37db16025635f3" ]] \
89                         && rm -f "${ROOT}"/etc/cron.daily/logwatch \
90                         || ewarn "You have two logwatch files in /etc/cron.daily/"
91         fi
92
93         # Trigger cache dir creation to allow immediate use of logwatch (bug #607668)
94         tmpfiles_process ${PN}.conf
95 }