1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 DESCRIPTION="Downloads and installs third-party clamav signatures"
8 HOMEPAGE="http://sourceforge.net/projects/unofficial-sigs"
9 SRC_URI="mirror://sourceforge/unofficial-sigs/${P}.tar.gz"
16 DEPEND="app-antivirus/clamav"
18 # The script relies on either net-misc/socat, or Perl's
19 # IO::Socket::UNIX. We already depend on Perl, and Gentoo's Perl ships
20 # with IO::Socket::UNIX, so we can leave out net-misc/socat here.
28 # First, fix the paths contained in the configuration file. Eventually
29 # these should be moved under /run, but for now we keep them sync'ed
30 # with the default clamd.conf.
31 local pid_default="/var/run/clamd.pid"
32 local pid_gentoo="/var/run/clamav/clamd.pid"
34 # clamd listens on a local socket by default. The clamd_socket
35 # setting needs to be uncommented in the configuration file for it
37 local socket_default="#clamd_socket=\"/var/run/clamd.socket\""
38 local socket_gentoo="clamd_socket=\"/var/run/clamav/clamd.sock\""
40 sed -i -e '$a\pkg_mgr="emerge"' \
41 -e "\$a\\pkg_rm=\"emerge -C ${PN}\"" \
42 -e "s~${socket_default}~${socket_gentoo}~" \
43 -e "s~${pid_default}~${pid_gentoo}~" \
45 || die "failed to update paths in the ${PN}.conf file"
47 # Now, change the script's working directory to point to
48 # /var/lib/${PN}. We'll need to make this writable by the clamav
49 # user during src_install.
50 sed -i -e "s~/usr/unofficial-dbs~/var/lib/${PN}~" "${PN}.conf" \
51 || die "failed to update the work_dir variable in ${PN}.conf"
53 # Tell the script that it's been configured.
54 local cfged_default='user_configuration_complete="no"'
55 local cfged_gentoo='user_configuration_complete="yes"'
56 sed -i "s/${cfged_default}/${cfged_gentoo}/" "${PN}.conf" \
57 || die "failed to set user configuration completed in ${PN}.conf"
63 # We set the script's working directory to /var/lib/${PN} in
64 # src_compile, so make sure that the permissions are set correctly
65 # here. By default, it runs as clamav/clamav.
66 diropts -m 0755 -o clamav -g clamav
67 dodir "/var/lib/${PN}"
69 insinto /etc/logrotate.d
70 doins "${PN}-logrotate"
76 dodoc CHANGELOG INSTALL README
81 elog "You will need to select databases in /etc/${PN}.conf."
82 elog "For details, please see the ${PN}(8) manual page."
84 elog 'An up-to-date description of the available Sanesecurity'
85 elog 'databases is available at,'
87 elog ' http://sanesecurity.com/usage/signatures/'