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: Mon, 09 Jul 2018 21:03:04
Message-Id: 1531170162.033c498679dd51aee5170150f28628943ccbdd7f.lordvan@gentoo
1 commit: 033c498679dd51aee5170150f28628943ccbdd7f
2 Author: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 9 21:01:42 2018 +0000
4 Commit: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 9 21:02:42 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=033c4986
7
8 app-antivirus/clamav: version bump
9
10 Package-Manager: Portage-2.3.36, Repoman-2.3.9
11
12 app-antivirus/clamav/Manifest | 1 +
13 app-antivirus/clamav/clamav-0.100.1.ebuild | 167 +++++++++++++++++++++++++++++
14 2 files changed, 168 insertions(+)
15
16 diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
17 index e2e531566b3..42bd11c0a76 100644
18 --- a/app-antivirus/clamav/Manifest
19 +++ b/app-antivirus/clamav/Manifest
20 @@ -1,2 +1,3 @@
21 DIST clamav-0.100.0.tar.gz 16036757 BLAKE2B c51edfb05726e16e2ff1ef1fee9f174af5a0d65396f847a4f6e1246d5844b92eb70896fc598d2c73719b1315ff3c41aca503823431e0918d52f56d29399dd796 SHA512 57e1da86a32fdfb66887c4aeed03008bc070ce3cb6b881db411332f2f2e640b73dca84d990f5886526b3d6bd0c2770c7dcce5b4e7cf48323824c362452593549
22 +DIST clamav-0.100.1.tar.gz 16154415 BLAKE2B df4ddde28b0b263765f4a571a407390b30aa6fe58d07e1b8fe427e70141219fb3d7c5addfbf30a350c6c08324dee1ec3dd80319306df7578ed87138c6513b99d SHA512 13a4e050e030ac3d1cc07b12bdd56c455e266e0b205a4c9bc9f18e53f6d8913a66eed2296abf857f395227ab0ed5c7bc90bc357bcb314dc9e18a9c6177dcc5b2
23 DIST clamav-0.99.4.tar.gz 16083015 BLAKE2B 3c2e7d11ee05fe846f75c3fb6501b5fd809a2e58f8e69c82e493e32fcbc87ca0e5b5f7ab83a0d7e251a5dc8e84aed1475c87c1248b393fa04b6924a2ab32b9bf SHA512 778d5ef510d8d4bdfac5dc33d92469ed4283c414b3d42da6e1a0b13ed70e37755d5c837622dc336bc728ba1f8bf5485fc8a8d3a67a90e9aaa9e4dc71ece0691d
24
25 diff --git a/app-antivirus/clamav/clamav-0.100.1.ebuild b/app-antivirus/clamav/clamav-0.100.1.ebuild
26 new file mode 100644
27 index 00000000000..3928b8054dd
28 --- /dev/null
29 +++ b/app-antivirus/clamav/clamav-0.100.1.ebuild
30 @@ -0,0 +1,167 @@
31 +# Copyright 1999-2018 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +inherit autotools eutils flag-o-matic user systemd
37 +
38 +DESCRIPTION="Clam Anti-Virus Scanner"
39 +HOMEPAGE="https://www.clamav.net/"
40 +SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
41 +
42 +LICENSE="GPL-2"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~arm ~ia64 ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
45 +IUSE="bzip2 doc clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs system-libmspack test uclibc"
46 +
47 +CDEPEND="bzip2? ( app-arch/bzip2 )
48 + clamdtop? ( sys-libs/ncurses:0 )
49 + iconv? ( virtual/libiconv )
50 + metadata-analysis-api? ( dev-libs/json-c:= )
51 + milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
52 + dev-libs/libtommath
53 + >=sys-libs/zlib-1.2.2:=
54 + !libressl? ( dev-libs/openssl:0= )
55 + libressl? ( dev-libs/libressl:0= )
56 + sys-devel/libtool
57 + || ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
58 + system-libmspack? ( dev-libs/libmspack )
59 + !!<app-antivirus/clamav-0.99"
60 +# hard block clamav < 0.99 due to linking problems Bug #567680
61 +# openssl is now *required* see this link as to why
62 +# https://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
63 +DEPEND="${CDEPEND}
64 + virtual/pkgconfig
65 + test? ( dev-libs/check )"
66 +RDEPEND="${CDEPEND}
67 + selinux? ( sec-policy/selinux-clamav )"
68 +
69 +DOCS=( docs/clamdoc.pdf docs/phishsigs_howto.pdf docs/signatures.pdf )
70 +HTML_DOCS=( docs/html )
71 +
72 +PATCHES=(
73 + "${FILESDIR}/clamav-0.100.0_autotools.patch"
74 +)
75 +
76 +pkg_setup() {
77 + enewgroup clamav
78 + enewuser clamav -1 -1 /dev/null clamav
79 +}
80 +
81 +src_prepare() {
82 + default
83 +
84 + eautoconf
85 +}
86 +
87 +src_configure() {
88 + use ppc64 && append-flags -mminimal-toc
89 + use uclibc && export ac_cv_type_error_t=yes
90 +
91 + econf \
92 + $(use_enable bzip2) \
93 + $(use_enable clamdtop) \
94 + $(use_enable ipv6) \
95 + $(use_enable milter) \
96 + $(use_enable static-libs static) \
97 + $(use_enable test check) \
98 + $(use_with iconv) \
99 + $(use_with metadata-analysis-api libjson /usr) \
100 + $(use_with system-libmspack) \
101 + --cache-file="${S}"/config.cache \
102 + --disable-experimental \
103 + --disable-gcc-vcheck \
104 + --disable-zlib-vcheck \
105 + --enable-id-check \
106 + --with-dbdir="${EPREFIX}"/var/lib/clamav \
107 + --with-system-tommath \
108 + --with-zlib="${EPREFIX}"/usr \
109 + --disable-llvm
110 +}
111 +
112 +src_install() {
113 + default
114 +
115 + rm -rf "${ED}"/var/lib/clamav
116 + newinitd "${FILESDIR}"/clamd.initd-r6 clamd
117 + newconfd "${FILESDIR}"/clamd.conf-r1 clamd
118 +
119 + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
120 + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
121 + systemd_dounit "${FILESDIR}/clamd.service"
122 + systemd_dounit "${FILESDIR}/freshclamd.service"
123 +
124 + keepdir /var/lib/clamav
125 + fowners clamav:clamav /var/lib/clamav
126 + keepdir /var/log/clamav
127 + fowners clamav:clamav /var/log/clamav
128 +
129 + dodir /etc/logrotate.d
130 + insinto /etc/logrotate.d
131 + newins "${FILESDIR}"/clamav.logrotate clamav
132 +
133 + # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
134 + sed -i -e "s:^\(Example\):\# \1:" \
135 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
136 + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
137 + -e "s:.*\(User\) .*:\1 clamav:" \
138 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
139 + -e "s:^\#\(LogTime\).*:\1 yes:" \
140 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
141 + "${ED}"/etc/clamd.conf.sample || die
142 + sed -i -e "s:^\(Example\):\# \1:" \
143 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
144 + -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
145 + -e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
146 + -e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
147 + -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
148 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
149 + "${ED}"/etc/freshclam.conf.sample || die
150 +
151 + if use milter ; then
152 + # MilterSocket one to include ' /' because there is a 2nd line for
153 + # inet: which we want to leave
154 + ##dodoc "${FILESDIR}"/clamav-milter.README.gentoo
155 + sed -i -e "s:^\(Example\):\# \1:" \
156 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
157 + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
158 + -e "s:.*\(User\) .*:\1 clamav:" \
159 + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
160 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
161 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
162 + "${ED}"/etc/clamav-milter.conf.sample || die
163 + cat >> "${ED}"/etc/conf.d/clamd <<-EOF
164 + MILTER_NICELEVEL=19
165 + START_MILTER=no
166 + EOF
167 +
168 + systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
169 + fi
170 +
171 + if use doc; then
172 + einstalldocs
173 + doman docs/man/*.[1-8]
174 + fi
175 +
176 + for i in clamd freshclam clamav-milter
177 + do
178 + [[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
179 + done
180 +
181 + prune_libtool_files --all
182 +}
183 +
184 +src_test() {
185 + emake quick-check
186 +}
187 +
188 +pkg_postinst() {
189 + if use milter ; then
190 + elog "For simple instructions how to setup the clamav-milter read the"
191 + elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
192 + fi
193 + if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
194 + ewarn "You must run freshclam manually to populate the virus database files"
195 + ewarn "before starting clamav for the first time.\n"
196 + fi
197 +}