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