/[gentoo-x86]/app-antivirus/clamav/clamav-0.97.3.ebuild
Gentoo

Contents of /app-antivirus/clamav/clamav-0.97.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Thu May 31 03:01:52 2012 UTC (2 years, 1 month ago) by zmedico
Branch: MAIN
Changes since 1.10: +2 -2 lines
inherit user for enewgroup and enewuser

(Portage version: 2.2.0_alpha108_p8/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/clamav-0.97.3.ebuild,v 1.10 2012/05/02 20:14:11 jdhore Exp $
4
5 EAPI=4
6
7 inherit eutils autotools-utils flag-o-matic user
8
9 DESCRIPTION="Clam Anti-Virus Scanner"
10 HOMEPAGE="http://www.clamav.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd"
16 IUSE="bzip2 clamdtop iconv ipv6 milter selinux static-libs"
17
18 CDEPEND="bzip2? ( app-arch/bzip2 )
19 clamdtop? ( sys-libs/ncurses )
20 iconv? ( virtual/libiconv )
21 milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
22 dev-libs/libtommath
23 >=sys-libs/zlib-1.2.2
24 sys-devel/libtool"
25 DEPEND="${CDEPEND}
26 virtual/pkgconfig"
27 RDEPEND="${CDEPEND}
28 selinux? ( sec-policy/selinux-clamav )"
29
30 RESTRICT="test"
31
32 DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
33
34 PATCHES=( "${FILESDIR}"/${PN}-0.97-nls.patch )
35
36 pkg_setup() {
37 enewgroup clamav
38 enewuser clamav -1 -1 /dev/null clamav
39 }
40
41 src_prepare() {
42 use ppc64 && append-flags -mminimal-toc
43 autotools-utils_src_prepare
44 }
45
46 src_configure() {
47 local myeconfargs=(
48 --disable-experimental
49 --enable-id-check
50 --with-dbdir=/var/lib/clamav
51 --with-system-tommath
52 $(use_enable bzip2)
53 $(use_enable clamdtop)
54 $(use_enable ipv6)
55 $(use_enable milter)
56 $(use_with iconv)
57 )
58 autotools-utils_src_configure
59 }
60
61 src_install() {
62 autotools-utils_src_install
63
64 rm -rf "${ED}"/var/lib/clamav
65 newinitd "${FILESDIR}"/clamd.rc clamd
66 newconfd "${FILESDIR}"/clamd.conf clamd
67
68 keepdir /var/lib/clamav
69 fowners clamav:clamav /var/lib/clamav
70 keepdir /var/run/clamav
71 fowners clamav:clamav /var/run/clamav
72 keepdir /var/log/clamav
73 fowners clamav:clamav /var/log/clamav
74
75 dodir /etc/logrotate.d
76 insinto /etc/logrotate.d
77 newins "${FILESDIR}"/clamav.logrotate clamav
78
79 # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
80 sed -i -e "s:^\(Example\):\# \1:" \
81 -e "s:.*\(PidFile\) .*:\1 /var/run/clamav/clamd.pid:" \
82 -e "s:.*\(LocalSocket\) .*:\1 /var/run/clamav/clamd.sock:" \
83 -e "s:.*\(User\) .*:\1 clamav:" \
84 -e "s:^\#\(LogFile\) .*:\1 /var/log/clamav/clamd.log:" \
85 -e "s:^\#\(LogTime\).*:\1 yes:" \
86 -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
87 "${ED}"/etc/clamd.conf
88 sed -i -e "s:^\(Example\):\# \1:" \
89 -e "s:.*\(PidFile\) .*:\1 /var/run/clamav/freshclam.pid:" \
90 -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
91 -e "s:^\#\(UpdateLogFile\) .*:\1 /var/log/clamav/freshclam.log:" \
92 -e "s:^\#\(NotifyClamd\).*:\1 /etc/clamd.conf:" \
93 -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
94 -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
95 "${ED}"/etc/freshclam.conf
96
97 if use milter ; then
98 # MilterSocket one to include ' /' because there is a 2nd line for
99 # inet: which we want to leave
100 dodoc "${FILESDIR}"/clamav-milter.README.gentoo
101 sed -i -e "s:^\(Example\):\# \1:" \
102 -e "s:.*\(PidFile\) .*:\1 /var/run/clamav/clamav-milter.pid:" \
103 -e "s+^\#\(ClamdSocket\) .*+\1 unix:/var/run/clamav/clamd.sock+" \
104 -e "s:.*\(User\) .*:\1 clamav:" \
105 -e "s+^\#\(MilterSocket\) /.*+\1 unix:/var/run/clamav/clamav-milter.sock+" \
106 -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
107 -e "s:^\#\(LogFile\) .*:\1 /var/log/clamav/clamav-milter.log:" \
108 "${ED}"/etc/clamav-milter.conf
109 cat > "${ED}"/etc/conf.d/clamd <<-EOF
110 MILTER_NICELEVEL=19
111 START_MILTER=no
112 EOF
113 fi
114 }
115
116 pkg_postinst() {
117 if use milter ; then
118 elog "For simple instructions how to setup the clamav-milter read the"
119 elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
120 fi
121 }

  ViewVC Help
Powered by ViewVC 1.1.20