]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-mail/amavis-logwatch/amavis-logwatch-1.51.02.ebuild
Replace the config patch with a sed invocation.
[mjo-overlay.git] / net-mail / amavis-logwatch / amavis-logwatch-1.51.02.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 amavisd-new"
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 IUSE="logwatch"
15
16 RDEPEND="dev-lang/perl"
17
18 src_prepare() {
19 # Replace the default config file location with ours.
20 local cfg_default='/usr/local/etc/${progname_prefix}-logwatch.conf'
21 local cfg_gentoo='/etc/${progname_prefix}-logwatch.conf';
22 sed -i "s~${cfg_default}~${cfg_gentoo}~" ${PN} \
23 || die 'failed to update the default config location'
24 }
25
26 src_compile() {
27 # The default make target just outputs instructions. We don't want
28 # the user to see these, so we avoid the default emake.
29 :
30 }
31
32 src_install() {
33 # There are two different "versions" of the package in the
34 # tarball: a standalone executable and a logwatch filter. The
35 # standalone is always installed. However, the logwatch filter is
36 # only installed with USE="logwatch".
37 dodoc Bugs Changes README
38 doman ${PN}.1
39 dobin ${PN}
40 insinto /etc
41 doins ${PN}.conf
42
43 if use logwatch; then
44 # Remove the taint mode (-T) switch from the header of the
45 # standalone executable, and save the result as our logwatch
46 # filter.
47 #
48 # We don't do this for the standalone script because it's nice
49 # to have the taint flag when it works.
50 #
51 sed 's~^#!/usr/bin/perl -T$~#!/usr/bin/perl~' ${PN} > amavis \
52 || die 'failed to remove the perl taint switch'
53
54 insinto /etc/logwatch/scripts/services
55 doins amavis
56
57 insinto /etc/logwatch/conf/services
58 newins ${PN}.conf amavis.conf
59 fi
60 }