]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-3.7.2.ebuild
Add app-antivirus/clamav-unofficial-sigs-3.7.2 in preparation for a move to portage.
[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.
29 local pid_default="/var/run/clamd.pid"
30 local pid_gentoo="/run/clamav/clamd.pid"
31 local socket_default="/var/run/clamd.socket"
32 local socket_gentoo="/run/clamav/clamd.sock"
33
34 sed -i -e '$a\pkg_mgr="emerge"' \
35 -e "\$a\\pkg_rm=\"emerge -C ${PN}\"" \
36 -e "s~${socket_default}~${socket_gentoo}~" \
37 -e "s~${pid_default}~${pid_gentoo}~" \
38 "${PN}.conf" \
39 || die "failed to update paths in the ${PN}.conf file"
40
41 # Now, change the script's working directory to point to
42 # /var/lib/${PN}. We'll need to make this writable by the clamav
43 # user during src_install.
44 sed -i -e "s~/usr/unofficial-dbs~/var/lib/${PN}~" "${PN}.conf" \
45 || die 'failed to update the work_dir variable'
46 }
47
48 src_install() {
49 dosbin "${PN}.sh"
50
51 # We set the script's working directory to /var/lib/${PN} in
52 # src_compile, so make sure that the permissions are set correctly
53 # here. By default, it runs as clamav/clamav.
54 diropts -m 0755 -o clamav -g clamav
55 dodir "/var/lib/${PN}"
56
57 insinto /etc/logrotate.d
58 doins "${PN}-logrotate"
59
60 insinto /etc
61 doins "${PN}.conf"
62
63 doman "${PN}.8"
64 dodoc CHANGELOG INSTALL README
65 }
66
67 pkg_postinst() {
68 elog "You will need to set up your /etc/${PN}.conf file."
69 elog "For details, please see the ${PN}(8) manual page."
70 elog ""
71 elog "Don't forget to set user_configuration_complete=\"yes\"."
72 elog ""
73 elog "An up-to-date description of the available SaneSecurity"
74 elog "databases is available at,"
75 elog ""
76 elog " http://sanesecurity.com/usage/signatures/"
77 elog ""
78 }