]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-mail/postfix-logwatch/postfix-logwatch-1.40.00.ebuild
Block >sys-apps/logwatch-7.4.0 when USE=logwatch in postfix/amavis-logwatch.
[mjo-overlay.git] / net-mail / postfix-logwatch / postfix-logwatch-1.40.00.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=5
6
7 DESCRIPTION="A log analyzer for postfix"
8 HOMEPAGE="http://logreporters.sourceforge.net/"
9 SRC_URI="mirror://sourceforge/logreporters/${P}.tgz"
10
11 LICENSE="MIT"
12 SLOT="0"
13 KEYWORDS="~amd64"
14
15 # >sys-apps/logwatch-7.4.0 ships our logwatch scripts and will
16 # thus obsolete this use flag.
17 IUSE="logwatch"
18
19 RDEPEND="dev-lang/perl
20 logwatch? ( !>sys-apps/logwatch-7.4.0 )"
21
22 src_prepare() {
23 # Replace the default config file location with ours.
24 local cfg_default='/usr/local/etc/${progname_prefix}-logwatch.conf'
25 local cfg_gentoo='/etc/${progname_prefix}-logwatch.conf';
26 sed -i "s~${cfg_default}~${cfg_gentoo}~" ${PN} \
27 || die 'failed to update the default config location'
28 }
29
30 src_compile() {
31 # The default make target just outputs instructions. We don't want
32 # the user to see these, so we avoid the default emake.
33 :
34 }
35
36 src_install() {
37 # There are two different "versions" of the package in the
38 # tarball: a standalone executable and a logwatch filter. The
39 # standalone is always installed. However, the logwatch filter is
40 # only installed with USE="logwatch".
41 dodoc Bugs Changes README ${PN}.conf-topn
42 doman ${PN}.1
43 dobin ${PN}
44 insinto /etc
45 doins ${PN}.conf
46
47 if use logwatch; then
48 # Remove the taint mode (-T) switch from the header of the
49 # standalone executable, and save the result as our logwatch
50 # filter.
51 #
52 # We don't do this for the standalone script because it's nice
53 # to have the taint flag when it works.
54 #
55 sed 's~^#!/usr/bin/perl -T$~#!/usr/bin/perl~' ${PN} > postfix \
56 || die 'failed to remove the perl taint switch'
57
58 insinto /etc/logwatch/scripts/services
59 doins postfix
60
61 insinto /etc/logwatch/conf/services
62 newins ${PN}.conf postfix.conf
63 fi
64 }