Gentoo Archives: gentoo-commits

From: Thomas Raschbacher <lordvan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-antivirus/clamav/
Date: Wed, 02 Dec 2015 15:36:33
Message-Id: 1449068646.cdc073a94d9ab8ce7d489566681804990f160a0e.lordvan@gentoo
1 commit: cdc073a94d9ab8ce7d489566681804990f160a0e
2 Author: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 2 14:23:06 2015 +0000
4 Commit: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 2 15:04:06 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cdc073a9
7
8 Version bump
9
10 Package-Manager: portage-2.2.23
11
12 app-antivirus/clamav/Manifest | 1 +
13 app-antivirus/clamav/clamav-0.99.ebuild | 140 ++++++++++++++++++++++++++++++++
14 2 files changed, 141 insertions(+)
15
16 diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
17 index 3f4c8fa..41dac85 100644
18 --- a/app-antivirus/clamav/Manifest
19 +++ b/app-antivirus/clamav/Manifest
20 @@ -1,3 +1,4 @@
21 DIST clamav-0.98.5.tar.gz 15146379 SHA256 9c2f37d5fa9033936468237f6f4b29289f30791caa84765ef510acb56c8daa4d SHA512 4fd3af9e8e828b426ac4aaa867b356df05eb84396b62ab02715630683371f5a9b7a417d495236952a5e112b700ec0304c3760351855d10edc9fa8c032a64c52c WHIRLPOOL d7d32199c9fed92a6a7dd827f7ddac9b6a9689f29d315a7f525d8cf9e96bcf37087b743cc0b181d7e76f6f47897ac93f587de9f9ed336bd7a7552a320608332a
22 DIST clamav-0.98.6.tar.gz 15148292 SHA256 6591245d55445a2ddcc1700964c33b8bf62fe20c75bd9c7746f4fe0735502951 SHA512 420064e784c352c1398c531f7530dbe37ed1092de8015984b354a96f0e5fe0968b285cae6108659fcebfa91ffbe0742335b70cb8d7f49db7690d049ca2d52758 WHIRLPOOL 40ed590fb649aa40849526af95bf0f2bfb86b51a4cff0db5f79bafcd8954bd2aba37845ca6c57f290b044976567a5b4e54ce57082c11020342f2f3d1c094e192
23 DIST clamav-0.98.7.tar.gz 15118851 SHA256 282417b707740de13cd8f18d4cbca9ddd181cf96b444db2cad98913a5153e272 SHA512 acf01961472c13ccb219420cc3fa3c3e6f8a733edef371dbc04ce5867900aa1535e956ec8ad50d31c8f872a0a1d79fcccac944cd86e29ecdfa4af18f7fd5afb9 WHIRLPOOL c9f2e6f52f07f68bdcccf55ca1aab0bf3deaa6963279459d64ecca076a9ed0ef53c25996b2b673e9746833822df24689a9fab0654064c5ee6ed372a86966fbb6
24 +DIST clamav-0.99.tar.gz 15968038 SHA256 d2792c8cfadd685fffc40b2199679628815df031fd3149ccf961649fc8787ea9 SHA512 328e66fa412ba61f5e44c839b254c7a84d2ce7821fda6cf29e4ee9532c06e45bdec62f202ca561223e984fff170bfd8280e5cc8e306c09a3017b17e7db3bbf56 WHIRLPOOL 696b425c0d3a6639d627e6dba000a57c4e532232f9f42a564a992c0b459d8041a1947b09548d99b621a5685c78d91045adf4b61731242f55eda2b8d5150fc8b8
25
26 diff --git a/app-antivirus/clamav/clamav-0.99.ebuild b/app-antivirus/clamav/clamav-0.99.ebuild
27 new file mode 100644
28 index 0000000..565b0c5
29 --- /dev/null
30 +++ b/app-antivirus/clamav/clamav-0.99.ebuild
31 @@ -0,0 +1,140 @@
32 +# Copyright 1999-2015 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +# $Id$
35 +
36 +EAPI=5
37 +
38 +inherit eutils flag-o-matic user systemd
39 +
40 +DESCRIPTION="Clam Anti-Virus Scanner"
41 +HOMEPAGE="http://www.clamav.net/"
42 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
43 +
44 +LICENSE="GPL-2"
45 +SLOT="0"
46 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
47 +IUSE="bzip2 clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs uclibc"
48 +
49 +CDEPEND="bzip2? ( app-arch/bzip2 )
50 + clamdtop? ( sys-libs/ncurses:0 )
51 + iconv? ( virtual/libiconv )
52 + metadata-analysis-api? ( dev-libs/json-c )
53 + milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
54 + dev-libs/libtommath
55 + >=sys-libs/zlib-1.2.2
56 + !libressl? ( dev-libs/openssl:0 )
57 + libressl? ( dev-libs/libressl )
58 + sys-devel/libtool"
59 +# openssl is now *required* see this link as to why
60 +# http://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
61 +DEPEND="${CDEPEND}
62 + virtual/pkgconfig"
63 +RDEPEND="${CDEPEND}
64 + selinux? ( sec-policy/selinux-clamav )"
65 +
66 +DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
67 +
68 +pkg_setup() {
69 + enewgroup clamav
70 + enewuser clamav -1 -1 /dev/null clamav
71 +}
72 +
73 +src_prepare() {
74 + use ppc64 && append-flags -mminimal-toc
75 + use uclibc && export ac_cv_type_error_t=yes
76 +}
77 +
78 +src_configure() {
79 + econf \
80 + --disable-experimental \
81 + --disable-fanotify \
82 + --enable-id-check \
83 + --with-dbdir="${EPREFIX}"/var/lib/clamav \
84 + --with-system-tommath \
85 + --with-zlib="${EPREFIX}"/usr \
86 + $(use_enable bzip2) \
87 + $(use_enable clamdtop) \
88 + $(use_enable ipv6) \
89 + $(use_enable milter) \
90 + $(use_enable static-libs static) \
91 + $(use_with iconv) \
92 + $(use_with metadata-analysis-api libjson /usr)
93 +}
94 +
95 +src_install() {
96 + default
97 +
98 + rm -rf "${ED}"/var/lib/clamav
99 + newinitd "${FILESDIR}"/clamd.initd-r6 clamd
100 + newconfd "${FILESDIR}"/clamd.conf-r1 clamd
101 +
102 + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
103 + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
104 + systemd_dounit "${FILESDIR}/clamd.service"
105 + systemd_dounit "${FILESDIR}/freshclamd.service"
106 +
107 + keepdir /var/lib/clamav
108 + fowners clamav:clamav /var/lib/clamav
109 + keepdir /var/log/clamav
110 + fowners clamav:clamav /var/log/clamav
111 +
112 + dodir /etc/logrotate.d
113 + insinto /etc/logrotate.d
114 + newins "${FILESDIR}"/clamav.logrotate clamav
115 +
116 + # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
117 + sed -i -e "s:^\(Example\):\# \1:" \
118 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
119 + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
120 + -e "s:.*\(User\) .*:\1 clamav:" \
121 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
122 + -e "s:^\#\(LogTime\).*:\1 yes:" \
123 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
124 + "${ED}"/etc/clamd.conf.sample || die
125 + sed -i -e "s:^\(Example\):\# \1:" \
126 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
127 + -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
128 + -e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
129 + -e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
130 + -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
131 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
132 + "${ED}"/etc/freshclam.conf.sample || die
133 +
134 + if use milter ; then
135 + # MilterSocket one to include ' /' because there is a 2nd line for
136 + # inet: which we want to leave
137 + dodoc "${FILESDIR}"/clamav-milter.README.gentoo
138 + sed -i -e "s:^\(Example\):\# \1:" \
139 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
140 + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
141 + -e "s:.*\(User\) .*:\1 clamav:" \
142 + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
143 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
144 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
145 + "${ED}"/etc/clamav-milter.conf.sample || die
146 + cat >> "${ED}"/etc/conf.d/clamd <<-EOF
147 + MILTER_NICELEVEL=19
148 + START_MILTER=no
149 + EOF
150 +
151 + systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
152 + fi
153 +
154 + for i in clamd freshclam clamav-milter
155 + do
156 + [[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
157 + done
158 +
159 + prune_libtool_files --all
160 +}
161 +
162 +pkg_postinst() {
163 + if use milter ; then
164 + elog "For simple instructions how to setup the clamav-milter read the"
165 + elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
166 + fi
167 + if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
168 + ewarn "You must run freshclam manually to populate the virus database files"
169 + ewarn "before starting clamav for the first time.\n"
170 + fi
171 +}