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: Thu, 05 May 2016 10:51:32
Message-Id: 1462445453.6e2bb0d5cd2415b5e548474ff04d00b0be9c4e9e.lordvan@gentoo
1 commit: 6e2bb0d5cd2415b5e548474ff04d00b0be9c4e9e
2 Author: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 5 10:50:53 2016 +0000
4 Commit: Thomas Raschbacher <lordvan <AT> gentoo <DOT> org>
5 CommitDate: Thu May 5 10:50:53 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e2bb0d5
7
8 Version bump + changed SRC_URI
9
10 Package-Manager: portage-2.2.23
11
12 app-antivirus/clamav/Manifest | 1 +
13 app-antivirus/clamav/clamav-0.99.2.ebuild | 142 ++++++++++++++++++++++++++++++
14 2 files changed, 143 insertions(+)
15
16 diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest
17 index b29e461..18a55f7 100644
18 --- a/app-antivirus/clamav/Manifest
19 +++ b/app-antivirus/clamav/Manifest
20 @@ -1,3 +1,4 @@
21 DIST clamav-0.98.7.tar.gz 15118851 SHA256 282417b707740de13cd8f18d4cbca9ddd181cf96b444db2cad98913a5153e272 SHA512 acf01961472c13ccb219420cc3fa3c3e6f8a733edef371dbc04ce5867900aa1535e956ec8ad50d31c8f872a0a1d79fcccac944cd86e29ecdfa4af18f7fd5afb9 WHIRLPOOL c9f2e6f52f07f68bdcccf55ca1aab0bf3deaa6963279459d64ecca076a9ed0ef53c25996b2b673e9746833822df24689a9fab0654064c5ee6ed372a86966fbb6
22 DIST clamav-0.99.1.tar.gz 15990867 SHA256 e144689122d3f91293808c82cbb06b7d3ac9eca7ae29564c5d148ffe7b25d58a SHA512 9beb5c0ebff2aef741bb27811c1f10a7cd5da354ff67272ee8994d87c95e272a5983105af0fe1a734e1fa99f112dc4dddd9d82074a0df6715814817f85a45f4f WHIRLPOOL e2afd7b7d377c1a1af802e780839bb21bcd318035ac858b6cb11545db3673d3f74ba3159b837238982248720379f98ab51e279a8636bbea89331136891e88e5d
23 +DIST clamav-0.99.2.tar.gz 16067497 SHA256 167bd6a13e05ece326b968fdb539b05c2ffcfef6018a274a10aeda85c2c0027a SHA512 7744ba8a344b163cf98e9737cddfd25d2120b34ee9c4518380e028c9ec3cd50127b198b0dfa9fde30f5ce9aab0c0e6384712fbc11287e77d16ce052fd7b6ac44 WHIRLPOOL 371dc56c3ffa0ff40381d451687a9331a0587943a048604c6667e1018fbfe5559b023654d29f47505bd69a1a44f88adfb5b93b7c55c8cbc6f0bbfcbf836bf631
24 DIST clamav-0.99.tar.gz 15968038 SHA256 d2792c8cfadd685fffc40b2199679628815df031fd3149ccf961649fc8787ea9 SHA512 328e66fa412ba61f5e44c839b254c7a84d2ce7821fda6cf29e4ee9532c06e45bdec62f202ca561223e984fff170bfd8280e5cc8e306c09a3017b17e7db3bbf56 WHIRLPOOL 696b425c0d3a6639d627e6dba000a57c4e532232f9f42a564a992c0b459d8041a1947b09548d99b621a5685c78d91045adf4b61731242f55eda2b8d5150fc8b8
25
26 diff --git a/app-antivirus/clamav/clamav-0.99.2.ebuild b/app-antivirus/clamav/clamav-0.99.2.ebuild
27 new file mode 100644
28 index 0000000..08c5f5a
29 --- /dev/null
30 +++ b/app-antivirus/clamav/clamav-0.99.2.ebuild
31 @@ -0,0 +1,142 @@
32 +# Copyright 1999-2016 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +# $Id$
35 +
36 +EAPI=5
37 +
38 +inherit eutils flag-o-matic user systemd
39 +
40 +DESCRIPTION="Clam Anti-Virus Scanner"
41 +HOMEPAGE="http://www.clamav.net/"
42 +# no longer on sf.net from 0.99.2 onwards
43 +SRC_URI="https://www.clamav.net/downloads/production/${P}.tar.gz"
44 +
45 +LICENSE="GPL-2"
46 +SLOT="0"
47 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
48 +IUSE="bzip2 clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs uclibc"
49 +
50 +CDEPEND="bzip2? ( app-arch/bzip2 )
51 + clamdtop? ( sys-libs/ncurses:0 )
52 + iconv? ( virtual/libiconv )
53 + metadata-analysis-api? ( dev-libs/json-c )
54 + milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
55 + dev-libs/libtommath
56 + >=sys-libs/zlib-1.2.2
57 + !libressl? ( dev-libs/openssl:0= )
58 + libressl? ( dev-libs/libressl:0= )
59 + sys-devel/libtool
60 + !!<app-antivirus/clamav-0.99"
61 +# openssl is now *required* see this link as to why
62 +# http://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
63 +DEPEND="${CDEPEND}
64 + virtual/pkgconfig"
65 +RDEPEND="${CDEPEND}
66 + selinux? ( sec-policy/selinux-clamav )"
67 +
68 +DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
69 +
70 +pkg_setup() {
71 + enewgroup clamav
72 + enewuser clamav -1 -1 /dev/null clamav
73 +}
74 +
75 +src_prepare() {
76 + use ppc64 && append-flags -mminimal-toc
77 + use uclibc && export ac_cv_type_error_t=yes
78 +}
79 +
80 +src_configure() {
81 + econf \
82 + --disable-experimental \
83 + --disable-fanotify \
84 + --enable-id-check \
85 + --with-dbdir="${EPREFIX}"/var/lib/clamav \
86 + --with-system-tommath \
87 + --with-zlib="${EPREFIX}"/usr \
88 + $(use_enable bzip2) \
89 + $(use_enable clamdtop) \
90 + $(use_enable ipv6) \
91 + $(use_enable milter) \
92 + $(use_enable static-libs static) \
93 + $(use_with iconv) \
94 + $(use_with metadata-analysis-api libjson /usr)
95 +}
96 +
97 +src_install() {
98 + default
99 +
100 + rm -rf "${ED}"/var/lib/clamav
101 + newinitd "${FILESDIR}"/clamd.initd-r6 clamd
102 + newconfd "${FILESDIR}"/clamd.conf-r1 clamd
103 +
104 + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
105 + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
106 + systemd_dounit "${FILESDIR}/clamd.service"
107 + systemd_dounit "${FILESDIR}/freshclamd.service"
108 +
109 + keepdir /var/lib/clamav
110 + fowners clamav:clamav /var/lib/clamav
111 + keepdir /var/log/clamav
112 + fowners clamav:clamav /var/log/clamav
113 +
114 + dodir /etc/logrotate.d
115 + insinto /etc/logrotate.d
116 + newins "${FILESDIR}"/clamav.logrotate clamav
117 +
118 + # Modify /etc/{clamd,freshclam}.conf to be usable out of the box
119 + sed -i -e "s:^\(Example\):\# \1:" \
120 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
121 + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
122 + -e "s:.*\(User\) .*:\1 clamav:" \
123 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
124 + -e "s:^\#\(LogTime\).*:\1 yes:" \
125 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
126 + "${ED}"/etc/clamd.conf.sample || die
127 + sed -i -e "s:^\(Example\):\# \1:" \
128 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
129 + -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
130 + -e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
131 + -e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
132 + -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
133 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
134 + "${ED}"/etc/freshclam.conf.sample || die
135 +
136 + if use milter ; then
137 + # MilterSocket one to include ' /' because there is a 2nd line for
138 + # inet: which we want to leave
139 + dodoc "${FILESDIR}"/clamav-milter.README.gentoo
140 + sed -i -e "s:^\(Example\):\# \1:" \
141 + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
142 + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
143 + -e "s:.*\(User\) .*:\1 clamav:" \
144 + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
145 + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
146 + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
147 + "${ED}"/etc/clamav-milter.conf.sample || die
148 + cat >> "${ED}"/etc/conf.d/clamd <<-EOF
149 + MILTER_NICELEVEL=19
150 + START_MILTER=no
151 + EOF
152 +
153 + systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
154 + fi
155 +
156 + for i in clamd freshclam clamav-milter
157 + do
158 + [[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
159 + done
160 +
161 + prune_libtool_files --all
162 +}
163 +
164 +pkg_postinst() {
165 + if use milter ; then
166 + elog "For simple instructions how to setup the clamav-milter read the"
167 + elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
168 + fi
169 + if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
170 + ewarn "You must run freshclam manually to populate the virus database files"
171 + ewarn "before starting clamav for the first time.\n"
172 + fi
173 +}