]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-3.7.2.ebuild
Twiddle a few more settings by default.
[mjo-overlay.git] / app-antivirus / clamav-unofficial-sigs / clamav-unofficial-sigs-3.7.2.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="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"
10
11 LICENSE="BSD"
12 SLOT="0"
13 KEYWORDS="~amd64"
14 IUSE=""
15
16 DEPEND="app-antivirus/clamav"
17
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.
21 RDEPEND="${DEPEND}
22 app-crypt/gnupg
23 dev-lang/perl
24 net-dns/bind-tools
25 net-misc/curl"
26
27 src_compile() {
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"
33
34 # clamd listens on a local socket by default. The clamd_socket
35 # setting needs to be uncommented in the configuration file for it
36 # to take effect.
37 local socket_default="#clamd_socket=\"/var/run/clamd.socket\""
38 local socket_gentoo="clamd_socket=\"/var/run/clamav/clamd.sock\""
39
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}~" \
44 "${PN}.conf" \
45 || die "failed to update paths in the ${PN}.conf file"
46
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"
52
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"
58 }
59
60 src_install() {
61 dosbin "${PN}.sh"
62
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}"
68
69 insinto /etc/logrotate.d
70 doins "${PN}-logrotate"
71
72 insinto /etc
73 doins "${PN}.conf"
74
75 doman "${PN}.8"
76 dodoc CHANGELOG INSTALL README
77 }
78
79 pkg_postinst() {
80 elog ''
81 elog "You will need to select databases in /etc/${PN}.conf."
82 elog "For details, please see the ${PN}(8) manual page."
83 elog ''
84 elog 'An up-to-date description of the available Sanesecurity'
85 elog 'databases is available at,'
86 elog ''
87 elog ' http://sanesecurity.com/usage/signatures/'
88 elog ''
89 }