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: Sun, 14 Oct 2018 11:53:43
Message-Id: 1539517988.ece77c37f680f60efa93039359ec0fbd27344f98.lordvan@gentoo
1 commit: ece77c37f680f60efa93039359ec0fbd27344f98
2 Author: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 14 11:52:20 2018 +0000
4 Commit: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 14 11:53:08 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ece77c37
7
8 app-antivirus/clamav: revbump for systemd file fix
9
10 Closes: https://bugs.gentoo.org/592668
11 Signed-off-by: Thomas Raschbacher <lordvan <AT> gentoo.org>
12 Package-Manager: Portage-2.3.50, Repoman-2.3.11
13
14 app-antivirus/clamav/clamav-0.100.1-r1.ebuild | 165 ++++++++++++++++++++++++++
15 app-antivirus/clamav/clamav-0.99.4-r2.ebuild | 157 ++++++++++++++++++++++++
16 2 files changed, 322 insertions(+)
17
18 diff --git a/app-antivirus/clamav/clamav-0.100.1-r1.ebuild b/app-antivirus/clamav/clamav-0.100.1-r1.ebuild
19 new file mode 100644
20 index 00000000000..2f4bd0aa4fd
21 --- /dev/null
22 +++ b/app-antivirus/clamav/clamav-0.100.1-r1.ebuild
23 @@ -0,0 +1,165 @@
24 +# Copyright 1999-2018 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=6
28 +
29 +inherit autotools eutils flag-o-matic user systemd
30 +
31 +DESCRIPTION="Clam Anti-Virus Scanner"
32 +HOMEPAGE="https://www.clamav.net/"
33 +SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
34 +
35 +LICENSE="GPL-2"
36 +SLOT="0"
37 +KEYWORDS="amd64 ~arm hppa ia64 ~ppc ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
38 +IUSE="bzip2 doc clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs system-libmspack test uclibc"
39 +
40 +CDEPEND="bzip2? ( app-arch/bzip2 )
41 + clamdtop? ( sys-libs/ncurses:0 )
42 + iconv? ( virtual/libiconv )
43 + metadata-analysis-api? ( dev-libs/json-c:= )
44 + milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
45 + >=sys-libs/zlib-1.2.2:=
46 + !libressl? ( dev-libs/openssl:0= )
47 + libressl? ( dev-libs/libressl:0= )
48 + sys-devel/libtool
49 + || ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
50 + system-libmspack? ( dev-libs/libmspack )
51 + !!<app-antivirus/clamav-0.99"
52 +# hard block clamav < 0.99 due to linking problems Bug #567680
53 +# openssl is now *required* see this link as to why
54 +# https://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
55 +DEPEND="${CDEPEND}
56 + virtual/pkgconfig
57 + test? ( dev-libs/check )"
58 +RDEPEND="${CDEPEND}
59 + selinux? ( sec-policy/selinux-clamav )"
60 +
61 +DOCS=( docs/clamdoc.pdf docs/phishsigs_howto.pdf docs/signatures.pdf )
62 +HTML_DOCS=( docs/html )
63 +
64 +PATCHES=(
65 + "${FILESDIR}/clamav-0.100.0_autotools.patch"
66 +)
67 +
68 +pkg_setup() {
69 + enewgroup clamav
70 + enewuser clamav -1 -1 /dev/null clamav
71 +}
72 +
73 +src_prepare() {
74 + default
75 +
76 + eautoconf
77 +}
78 +
79 +src_configure() {
80 + use ppc64 && append-flags -mminimal-toc
81 + use uclibc && export ac_cv_type_error_t=yes
82 +
83 + econf \
84 + $(use_enable bzip2) \
85 + $(use_enable clamdtop) \
86 + $(use_enable ipv6) \
87 + $(use_enable milter) \
88 + $(use_enable static-libs static) \
89 + $(use_enable test check) \
90 + $(use_with iconv) \
91 + $(use_with metadata-analysis-api libjson /usr) \
92 + $(use_with system-libmspack) \
93 + --cache-file="${S}"/config.cache \
94 + --disable-experimental \
95 + --disable-gcc-vcheck \
96 + --disable-zlib-vcheck \
97 + --enable-id-check \
98 + --with-dbdir="${EPREFIX}"/var/lib/clamav \
99 + --with-zlib="${EPREFIX}"/usr \
100 + --disable-llvm
101 +}
102 +
103 +src_install() {
104 + default
105 +
106 + rm -rf "${ED}"/var/lib/clamav
107 + newinitd "${FILESDIR}"/clamd.initd-r6 clamd
108 + newconfd "${FILESDIR}"/clamd.conf-r1 clamd
109 +
110 + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
111 + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
112 + systemd_dounit "${FILESDIR}/clamd.service"
113 + systemd_dounit "${FILESDIR}/freshclamd.service"
114 +
115 + keepdir /var/lib/clamav
116 + fowners clamav:clamav /var/lib/clamav
117 + keepdir /var/log/clamav
118 + fowners clamav:clamav /var/log/clamav
119 +
120 + dodir /etc/logrotate.d
121 + insinto /etc/logrotate.d
122 + newins "${FILESDIR}"/clamav.logrotate clamav
123 +
124 + # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
125 + sed -i -e "s:^\(Example\):\# \1:" \
126 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
127 + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
128 + -e "s:.*\(User\) .*:\1 clamav:" \
129 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
130 + -e "s:^\#\(LogTime\).*:\1 yes:" \
131 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
132 + "${ED}"/etc/clamd.conf.sample || die
133 + sed -i -e "s:^\(Example\):\# \1:" \
134 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
135 + -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
136 + -e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
137 + -e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
138 + -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
139 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
140 + "${ED}"/etc/freshclam.conf.sample || die
141 +
142 + if use milter ; then
143 + # MilterSocket one to include ' /' because there is a 2nd line for
144 + # inet: which we want to leave
145 + ##dodoc "${FILESDIR}"/clamav-milter.README.gentoo
146 + sed -i -e "s:^\(Example\):\# \1:" \
147 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
148 + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
149 + -e "s:.*\(User\) .*:\1 clamav:" \
150 + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
151 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
152 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
153 + "${ED}"/etc/clamav-milter.conf.sample || die
154 + cat >> "${ED}"/etc/conf.d/clamd <<-EOF
155 + MILTER_NICELEVEL=19
156 + START_MILTER=no
157 + EOF
158 +
159 + systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
160 + fi
161 +
162 + if use doc; then
163 + einstalldocs
164 + doman docs/man/*.[1-8]
165 + fi
166 +
167 + for i in clamd freshclam clamav-milter
168 + do
169 + [[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
170 + done
171 +
172 + prune_libtool_files --all
173 +}
174 +
175 +src_test() {
176 + emake quick-check
177 +}
178 +
179 +pkg_postinst() {
180 + if use milter ; then
181 + elog "For simple instructions how to setup the clamav-milter read the"
182 + elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
183 + fi
184 + if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
185 + ewarn "You must run freshclam manually to populate the virus database files"
186 + ewarn "before starting clamav for the first time.\n"
187 + fi
188 +}
189
190 diff --git a/app-antivirus/clamav/clamav-0.99.4-r2.ebuild b/app-antivirus/clamav/clamav-0.99.4-r2.ebuild
191 new file mode 100644
192 index 00000000000..9e65d1d592f
193 --- /dev/null
194 +++ b/app-antivirus/clamav/clamav-0.99.4-r2.ebuild
195 @@ -0,0 +1,157 @@
196 +# Copyright 1999-2018 Gentoo Authors
197 +# Distributed under the terms of the GNU General Public License v2
198 +
199 +EAPI=6
200 +
201 +inherit autotools eutils flag-o-matic user systemd
202 +
203 +DESCRIPTION="Clam Anti-Virus Scanner"
204 +HOMEPAGE="https://www.clamav.net/"
205 +SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
206 +
207 +LICENSE="GPL-2"
208 +SLOT="0"
209 +KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
210 +IUSE="bzip2 clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs test uclibc"
211 +
212 +CDEPEND="bzip2? ( app-arch/bzip2 )
213 + clamdtop? ( sys-libs/ncurses:0 )
214 + iconv? ( virtual/libiconv )
215 + metadata-analysis-api? ( dev-libs/json-c:= )
216 + milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
217 + >=sys-libs/zlib-1.2.2:=
218 + !libressl? ( dev-libs/openssl:0= )
219 + libressl? ( dev-libs/libressl:0= )
220 + sys-devel/libtool
221 + || ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
222 + !!<app-antivirus/clamav-0.99"
223 +# hard block clamav < 0.99 due to linking problems Bug #567680
224 +# openssl is now *required* see this link as to why
225 +# https://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
226 +DEPEND="${CDEPEND}
227 + virtual/pkgconfig
228 + test? ( dev-libs/check )"
229 +RDEPEND="${CDEPEND}
230 + selinux? ( sec-policy/selinux-clamav )"
231 +
232 +DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
233 +PATCHES=(
234 + "${FILESDIR}"/${PN}-0.99.4-fix-newer-zlib.patch
235 + "${FILESDIR}/${P}-pcre2-compile-erroffset.patch"
236 +)
237 +
238 +pkg_setup() {
239 + enewgroup clamav
240 + enewuser clamav -1 -1 /dev/null clamav
241 +}
242 +
243 +src_prepare() {
244 + default
245 +
246 + eautoconf
247 +}
248 +
249 +src_configure() {
250 + use ppc64 && append-flags -mminimal-toc
251 + use uclibc && export ac_cv_type_error_t=yes
252 +
253 + econf \
254 + $(use_enable bzip2) \
255 + $(use_enable clamdtop) \
256 + $(use_enable ipv6) \
257 + $(use_enable milter) \
258 + $(use_enable static-libs static) \
259 + $(use_enable test check) \
260 + $(use_with iconv) \
261 + $(use_with metadata-analysis-api libjson /usr) \
262 + --cache-file="${S}"/config.cache \
263 + --disable-experimental \
264 + --disable-gcc-vcheck \
265 + --disable-zlib-vcheck \
266 + --enable-id-check \
267 + --with-dbdir="${EPREFIX}"/var/lib/clamav \
268 + --with-zlib="${EPREFIX}"/usr \
269 + --disable-llvm
270 +}
271 +
272 +src_install() {
273 + default
274 +
275 + rm -rf "${ED}"/var/lib/clamav
276 + newinitd "${FILESDIR}"/clamd.initd-r6 clamd
277 + newconfd "${FILESDIR}"/clamd.conf-r1 clamd
278 +
279 + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
280 + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
281 + systemd_dounit "${FILESDIR}/clamd.service"
282 + systemd_dounit "${FILESDIR}/freshclamd.service"
283 +
284 + keepdir /var/lib/clamav
285 + fowners clamav:clamav /var/lib/clamav
286 + keepdir /var/log/clamav
287 + fowners clamav:clamav /var/log/clamav
288 +
289 + dodir /etc/logrotate.d
290 + insinto /etc/logrotate.d
291 + newins "${FILESDIR}"/clamav.logrotate clamav
292 +
293 + # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
294 + sed -i -e "s:^\(Example\):\# \1:" \
295 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
296 + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
297 + -e "s:.*\(User\) .*:\1 clamav:" \
298 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
299 + -e "s:^\#\(LogTime\).*:\1 yes:" \
300 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
301 + "${ED}"/etc/clamd.conf.sample || die
302 + sed -i -e "s:^\(Example\):\# \1:" \
303 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
304 + -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
305 + -e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
306 + -e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
307 + -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
308 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
309 + "${ED}"/etc/freshclam.conf.sample || die
310 +
311 + if use milter ; then
312 + # MilterSocket one to include ' /' because there is a 2nd line for
313 + # inet: which we want to leave
314 + dodoc "${FILESDIR}"/clamav-milter.README.gentoo
315 + sed -i -e "s:^\(Example\):\# \1:" \
316 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
317 + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
318 + -e "s:.*\(User\) .*:\1 clamav:" \
319 + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
320 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
321 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
322 + "${ED}"/etc/clamav-milter.conf.sample || die
323 + cat >> "${ED}"/etc/conf.d/clamd <<-EOF
324 + MILTER_NICELEVEL=19
325 + START_MILTER=no
326 + EOF
327 +
328 + systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
329 + fi
330 +
331 + for i in clamd freshclam clamav-milter
332 + do
333 + [[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
334 + done
335 +
336 + prune_libtool_files --all
337 +}
338 +
339 +src_test() {
340 + emake quick-check
341 +}
342 +
343 +pkg_postinst() {
344 + if use milter ; then
345 + elog "For simple instructions how to setup the clamav-milter read the"
346 + elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
347 + fi
348 + if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
349 + ewarn "You must run freshclam manually to populate the virus database files"
350 + ewarn "before starting clamav for the first time.\n"
351 + fi
352 +}