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