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/files/, app-antivirus/clamav/
Date: Fri, 02 Mar 2018 18:42:19
Message-Id: 1520016109.3ef3729b3b97a44da91368fe40a77a1886e4464d.lordvan@gentoo
1 commit: 3ef3729b3b97a44da91368fe40a77a1886e4464d
2 Author: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 2 18:38:04 2018 +0000
4 Commit: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 2 18:41:49 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ef3729b
7
8 app-antivirus/clamav:
9 adding 0.99.4 security release
10
11 Package-Manager: Portage-2.3.19, Repoman-2.3.6
12
13 app-antivirus/clamav/Manifest | 1 +
14 app-antivirus/clamav/clamav-0.99.4.ebuild | 156 +++++++++++++++++++++
15 .../clamav-0.99.4-pcre2-compile-erroffset.patch | 11 ++
16 3 files changed, 168 insertions(+)
17
18 diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
19 index f30802ee7e0..1296e9f756b 100644
20 --- a/app-antivirus/clamav/Manifest
21 +++ b/app-antivirus/clamav/Manifest
22 @@ -1,2 +1,3 @@
23 DIST clamav-0.99.2.tar.gz 16067497 BLAKE2B 4155e3125ccc45cc6828033f207b6b8d3514253dfb8156428ad4096c0901d5a8500f9dd253b8f40afdc49a6039b647627868f75d51829ab7bd247ada5f3b8383 SHA512 7744ba8a344b163cf98e9737cddfd25d2120b34ee9c4518380e028c9ec3cd50127b198b0dfa9fde30f5ce9aab0c0e6384712fbc11287e77d16ce052fd7b6ac44
24 DIST clamav-0.99.3.tar.gz 16082645 BLAKE2B 3be06e563f17a07e4c7e95eb3efbb61e80858bcb3dffc584f13ec30dc2ef9c5257aec78605f1c03e183b4b7ed5b08343a25b579b2b12e54458694eff624aa01e SHA512 0d3c75d571ed4aa4937ef2b743a39a9a144f5adfd6f56f71046e5a8387b8ed7c3c4d9a4196aa85750f9ec4dc545720fdd659289d0cce086ab13a7cc505a0ab3e
25 +DIST clamav-0.99.4.tar.gz 16083015 BLAKE2B 3c2e7d11ee05fe846f75c3fb6501b5fd809a2e58f8e69c82e493e32fcbc87ca0e5b5f7ab83a0d7e251a5dc8e84aed1475c87c1248b393fa04b6924a2ab32b9bf SHA512 778d5ef510d8d4bdfac5dc33d92469ed4283c414b3d42da6e1a0b13ed70e37755d5c837622dc336bc728ba1f8bf5485fc8a8d3a67a90e9aaa9e4dc71ece0691d
26
27 diff --git a/app-antivirus/clamav/clamav-0.99.4.ebuild b/app-antivirus/clamav/clamav-0.99.4.ebuild
28 new file mode 100644
29 index 00000000000..6df52a55c99
30 --- /dev/null
31 +++ b/app-antivirus/clamav/clamav-0.99.4.ebuild
32 @@ -0,0 +1,156 @@
33 +# Copyright 1999-2018 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +inherit autotools eutils flag-o-matic user systemd
39 +
40 +DESCRIPTION="Clam Anti-Virus Scanner"
41 +HOMEPAGE="http://www.clamav.net/"
42 +SRC_URI="https://www.clamav.net/downloads/production/${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:0= )
58 + sys-devel/libtool
59 + || ( dev-libs/libpcre2 >dev-libs/libpcre-6 )
60 + !!<app-antivirus/clamav-0.99"
61 +# hard block clamav < 0.99 due to linking problems Bug #567680
62 +# openssl is now *required* see this link as to why
63 +# http://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
64 +DEPEND="${CDEPEND}
65 + virtual/pkgconfig"
66 +RDEPEND="${CDEPEND}
67 + selinux? ( sec-policy/selinux-clamav )"
68 +
69 +DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
70 +PATCHES=(
71 + "${FILESDIR}/${P}-pcre2-compile-erroffset.patch"
72 +)
73 +
74 +pkg_setup() {
75 + enewgroup clamav
76 + enewuser clamav -1 -1 /dev/null clamav
77 +}
78 +
79 +src_prepare() {
80 + default
81 +
82 + eautoconf
83 +}
84 +
85 +src_configure() {
86 + use ppc64 && append-flags -mminimal-toc
87 + use uclibc && export ac_cv_type_error_t=yes
88 +
89 + econf \
90 + $(use_enable bzip2) \
91 + $(use_enable clamdtop) \
92 + $(use_enable ipv6) \
93 + $(use_enable milter) \
94 + $(use_enable static-libs static) \
95 + $(use_with iconv) \
96 + $(use_with metadata-analysis-api libjson /usr) \
97 + --cache-file="${S}"/config.cache \
98 + --disable-experimental \
99 + --disable-gcc-vcheck \
100 + --disable-zlib-vcheck \
101 + --enable-id-check \
102 + --with-dbdir="${EPREFIX}"/var/lib/clamav \
103 + --with-system-tommath \
104 + --with-zlib="${EPREFIX}"/usr \
105 + --disable-llvm
106 +}
107 +
108 +src_install() {
109 + default
110 +
111 + rm -rf "${ED}"/var/lib/clamav
112 + newinitd "${FILESDIR}"/clamd.initd-r6 clamd
113 + newconfd "${FILESDIR}"/clamd.conf-r1 clamd
114 +
115 + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
116 + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
117 + systemd_dounit "${FILESDIR}/clamd.service"
118 + systemd_dounit "${FILESDIR}/freshclamd.service"
119 +
120 + keepdir /var/lib/clamav
121 + fowners clamav:clamav /var/lib/clamav
122 + keepdir /var/log/clamav
123 + fowners clamav:clamav /var/log/clamav
124 +
125 + dodir /etc/logrotate.d
126 + insinto /etc/logrotate.d
127 + newins "${FILESDIR}"/clamav.logrotate clamav
128 +
129 + # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
130 + sed -i -e "s:^\(Example\):\# \1:" \
131 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
132 + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
133 + -e "s:.*\(User\) .*:\1 clamav:" \
134 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
135 + -e "s:^\#\(LogTime\).*:\1 yes:" \
136 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
137 + "${ED}"/etc/clamd.conf.sample || die
138 + sed -i -e "s:^\(Example\):\# \1:" \
139 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
140 + -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
141 + -e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
142 + -e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
143 + -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
144 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
145 + "${ED}"/etc/freshclam.conf.sample || die
146 +
147 + if use milter ; then
148 + # MilterSocket one to include ' /' because there is a 2nd line for
149 + # inet: which we want to leave
150 + dodoc "${FILESDIR}"/clamav-milter.README.gentoo
151 + sed -i -e "s:^\(Example\):\# \1:" \
152 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
153 + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
154 + -e "s:.*\(User\) .*:\1 clamav:" \
155 + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
156 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
157 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
158 + "${ED}"/etc/clamav-milter.conf.sample || die
159 + cat >> "${ED}"/etc/conf.d/clamd <<-EOF
160 + MILTER_NICELEVEL=19
161 + START_MILTER=no
162 + EOF
163 +
164 + systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
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/files/clamav-0.99.4-pcre2-compile-erroffset.patch b/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch
191 new file mode 100644
192 index 00000000000..5585ea61453
193 --- /dev/null
194 +++ b/app-antivirus/clamav/files/clamav-0.99.4-pcre2-compile-erroffset.patch
195 @@ -0,0 +1,11 @@
196 +--- clamav-0.99.4/libclamav/regex_pcre.c_orig 2018-03-02 19:10:39.702899702 +0100
197 ++++ clamav-0.99.4/libclamav/regex_pcre.c 2018-03-02 19:09:27.600901912 +0100
198 +@@ -112,7 +112,8 @@
199 + #if USING_PCRE2
200 + int cli_pcre_compile(struct cli_pcre_data *pd, long long unsigned match_limit, long long unsigned match_limit_recursion, unsigned int options, int opt_override)
201 + {
202 +- int errornum, erroffset;
203 ++ int errornum;
204 ++ size_t erroffset;
205 + pcre2_general_context *gctx;
206 + pcre2_compile_context *cctx;