1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
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"
11 KEYWORDS="~amd64 ~x86"
14 DEPEND="app-antivirus/clamav"
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.
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~' \
32 || die "failed to update paths in the ${PN}.conf file"
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'
42 dosbin ${PN}.sh || die
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"
50 insinto /etc/logrotate.d
51 doins ${PN}-logrotate || die
54 doins ${PN}.conf || die
57 dodoc CHANGELOG INSTALL README || die
61 elog "You will need to set up your /etc/${PN}.conf file."
62 elog "For details, please see the ${PN}(8) manual page."
64 elog "Don't forget to set user_configuration_complete=\"yes\"."