]> Pileus Git - ~andy/sunrise/blob - app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-3.7.1.ebuild
ffd95bb1e926c48d44ea32952ef4e3e4569bd897
[~andy/sunrise] / app-antivirus / clamav-unofficial-sigs / clamav-unofficial-sigs-3.7.1.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 DESCRIPTION="Downloads and installs third-party clamav signatures"
6 HOMEPAGE="http://sourceforge.net/projects/unofficial-sigs"
7 SRC_URI="mirror://sourceforge/unofficial-sigs/${P}.tar.gz"
8
9 LICENSE="BSD"
10 SLOT="0"
11 KEYWORDS="~amd64 ~x86"
12 IUSE=""
13
14 DEPEND="app-antivirus/clamav"
15
16 # The script relies on either net-misc/socat, or Perl's
17 # IO::Socket::UNIX. We already depend on Perl, and Gentoo's Perl ships
18 # with IO::Socket::UNIX, so we can leave out net-misc/socat here.
19 RDEPEND="${DEPEND}
20         app-crypt/gnupg
21         dev-lang/perl
22         net-dns/bind-tools
23         net-misc/curl"
24
25 src_compile() {
26         # First, fix the paths contained in the configuration file.
27         sed -i  -e '$a\pkg_mgr="emerge"' \
28                 -e "\$a\\pkg_rm=\"emerge -C ${PN}\"" \
29                 -e 's~/var/run/clamd.socket~/var/run/clamav/clamd.sock~' \
30                 -e 's~/var/run/clamd.pid~/var/run/clamav/clamd.pid~' \
31                 ${PN}.conf \
32                 || die "failed to update paths in the ${PN}.conf file"
33
34         # Now, change the script's working directory to point to
35         # /var/lib/${PN}. We'll need to make this writable by the clamav
36         # user during install.
37         sed -i  -e "s~/usr/unofficial-dbs~/var/lib/${PN}~" ${PN}.conf \
38                 || die 'failed to update the work_dir variable'
39 }
40
41 src_install() {
42         dosbin ${PN}.sh || die
43
44         # We set the script's working directory to /var/lib/${PN} in
45         # src_compile, so make sure that the permissions are set correctly
46         # here. By default, it runs as clamav/clamav.
47         diropts -m0755 -o clamav -g clamav
48         dodir /var/lib/${PN} || die "failed to create working directory"
49
50         insinto /etc/logrotate.d
51         doins ${PN}-logrotate || die
52
53         insinto /etc
54         doins ${PN}.conf || die
55
56         doman ${PN}.8  || die
57         dodoc CHANGELOG INSTALL README  || die
58 }
59
60 pkg_postinst() {
61         elog "You will need to set up your /etc/${PN}.conf file."
62         elog "For details, please see the ${PN}(8) manual page."
63         elog ""
64         elog "Don't forget to set user_configuration_complete=\"yes\"."
65 }