1 |
commit: 6ea3e65696e4fb24521636eaf18d8d400ad3d17b |
2 |
Author: Wolfram Schlich <wschlich <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 1 08:03:26 2016 +0000 |
4 |
Commit: Wolfram Schlich <wschlich <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 1 08:03:41 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ea3e656 |
7 |
|
8 |
app-antivirus/skyldav: initial import from my overlay |
9 |
|
10 |
Package-Manager: portage-2.2.27 |
11 |
|
12 |
app-antivirus/skyldav/Manifest | 1 + |
13 |
app-antivirus/skyldav/files/skyldav-0.5-conf.patch | 27 +++++ |
14 |
.../skyldav/files/skyldav-0.5-examples.patch | 11 +++ |
15 |
.../skyldav/files/skyldav-0.5-syslog.patch | 22 +++++ |
16 |
app-antivirus/skyldav/files/skyldav.confd | 11 +++ |
17 |
app-antivirus/skyldav/files/skyldav.initd | 26 +++++ |
18 |
app-antivirus/skyldav/files/skyldav.service-r1 | 15 +++ |
19 |
app-antivirus/skyldav/files/skyldav.service.conf | 3 + |
20 |
app-antivirus/skyldav/files/skyldav.tmpfilesd | 2 + |
21 |
app-antivirus/skyldav/metadata.xml | 11 +++ |
22 |
app-antivirus/skyldav/skyldav-0.5-r1.ebuild | 109 +++++++++++++++++++++ |
23 |
11 files changed, 238 insertions(+) |
24 |
|
25 |
diff --git a/app-antivirus/skyldav/Manifest b/app-antivirus/skyldav/Manifest |
26 |
new file mode 100644 |
27 |
index 0000000..f729e27 |
28 |
--- /dev/null |
29 |
+++ b/app-antivirus/skyldav/Manifest |
30 |
@@ -0,0 +1 @@ |
31 |
+DIST skyldav-0.5.tar.gz 105274 SHA256 308b7a15b920a33c2c381aeb607db5bece9560e0a85e3e65c2df0d153413f4cc SHA512 24b9e3805574a2498b1e250cde790d6263f6f751546ad906303099bad5e722430568b1081764843a3c52f38730e8f26132f32058bea33c18f19673ac9147c323 WHIRLPOOL 77e77c25eaf3d0d3add4e1b03366c75dd1acdf8152d2987af61418a4793b1b0873cd0088e2bfd00c9864316e3b6e068c4bc96bc064cfec706a1b1b0c318d3aa1 |
32 |
|
33 |
diff --git a/app-antivirus/skyldav/files/skyldav-0.5-conf.patch b/app-antivirus/skyldav/files/skyldav-0.5-conf.patch |
34 |
new file mode 100644 |
35 |
index 0000000..8255f7a |
36 |
--- /dev/null |
37 |
+++ b/app-antivirus/skyldav/files/skyldav-0.5-conf.patch |
38 |
@@ -0,0 +1,27 @@ |
39 |
+diff -urN skyldav-0.5.orig/examples/etc/skyldav.conf skyldav-0.5/examples/etc/skyldav.conf |
40 |
+--- skyldav-0.5.orig/examples/etc/skyldav.conf 2015-02-15 20:32:57.000000000 +0100 |
41 |
++++ skyldav-0.5/examples/etc/skyldav.conf 2016-01-21 14:02:27.656666425 +0100 |
42 |
+@@ -19,14 +19,21 @@ |
43 |
+ |
44 |
+ # Directories that shall not be scanned (including subdirectories) |
45 |
+ # EXCLUDE_PATH = /var/noscan, /opt/noscan |
46 |
++EXCLUDE_PATH = /usr/portage, /var/db/pkg, /var/tmp/portage, /var/tmp/binpkgs |
47 |
+ |
48 |
+ # File systems that are local, virus scan results may be cached. |
49 |
+ # LOCAL_FS = ext3, ext4, iso9660, tmpfs, vfat |
50 |
+-LOCAL_FS = ext3, ext4, iso9660, tmpfs, vfat |
51 |
++LOCAL_FS = ext2, ext3, ext4, xfs, zfs, btrfs, reiserfs, vfat, ntfs, iso9660, tmpfs |
52 |
+ |
53 |
+ # File systems that shall not be marked for virus scan. |
54 |
+ # NOMARK_FS = proc, sysfs |
55 |
+-NOMARK_FS = proc, sysfs, cifs |
56 |
++# |
57 |
++# Do not exclude devtmpfs and configs, as userspace could write malware onto them. |
58 |
++# CIFS is also known to cause problems due to a background daemon, so we exclude it here |
59 |
++# (https://github.com/xypron/skyldav/commit/63b01b912d3eed80f3db92aec8647770546f5c1c). |
60 |
++# Note that FUSE file systems are automatically excluded from scanning |
61 |
++# (https://github.com/xypron/skyldav/issues/3). |
62 |
++NOMARK_FS = proc, sysfs, devpts, debugfs, securityfs, cgroup, rpc_pipefs, mqueue, autofs, cifs |
63 |
+ |
64 |
+ # Mounts that shall not be marked for virus scan. |
65 |
+ # NOMARK_MNT = /mnt/noscan |
66 |
|
67 |
diff --git a/app-antivirus/skyldav/files/skyldav-0.5-examples.patch b/app-antivirus/skyldav/files/skyldav-0.5-examples.patch |
68 |
new file mode 100644 |
69 |
index 0000000..5c61468 |
70 |
--- /dev/null |
71 |
+++ b/app-antivirus/skyldav/files/skyldav-0.5-examples.patch |
72 |
@@ -0,0 +1,11 @@ |
73 |
+diff -urN skyldav-0.5.orig/Makefile.am skyldav-0.5/Makefile.am |
74 |
+--- skyldav-0.5.orig/Makefile.am 2015-02-15 20:32:57.000000000 +0100 |
75 |
++++ skyldav-0.5/Makefile.am 2016-01-21 14:11:14.883632470 +0100 |
76 |
+@@ -9,7 +9,6 @@ |
77 |
+ rm -rf doc/doxygen |
78 |
+ |
79 |
+ install-data-local: \ |
80 |
+- install-skyldav-examples \ |
81 |
+ install-skyldav-conf \ |
82 |
+ install-skyldavnotify-desktop |
83 |
+ |
84 |
|
85 |
diff --git a/app-antivirus/skyldav/files/skyldav-0.5-syslog.patch b/app-antivirus/skyldav/files/skyldav-0.5-syslog.patch |
86 |
new file mode 100644 |
87 |
index 0000000..2e72ce2 |
88 |
--- /dev/null |
89 |
+++ b/app-antivirus/skyldav/files/skyldav-0.5-syslog.patch |
90 |
@@ -0,0 +1,22 @@ |
91 |
+diff -urN skyldav-0.5.orig/src/skyldav/Messaging.cc skyldav-0.5/src/skyldav/Messaging.cc |
92 |
+--- skyldav-0.5.orig/src/skyldav/Messaging.cc 2015-02-15 20:32:57.000000000 +0100 |
93 |
++++ skyldav-0.5/src/skyldav/Messaging.cc 2016-01-21 14:17:12.492010594 +0100 |
94 |
+@@ -118,15 +118,17 @@ |
95 |
+ break; |
96 |
+ case INFORMATION: |
97 |
+ type = "I"; |
98 |
+- syslog(LOG_NOTICE, "%s", message.c_str()); |
99 |
++ syslog(LOG_INFO, "%s", message.c_str()); |
100 |
+ std::cout << message << std::endl; |
101 |
+ break; |
102 |
+ case DEBUG: |
103 |
+ type = "D"; |
104 |
++ syslog(LOG_DEBUG, "%s", message.c_str()); |
105 |
+ std::cout << message << std::endl; |
106 |
+ return; |
107 |
+ default: |
108 |
+ type = " "; |
109 |
++ syslog(LOG_NOTICE, "%s", message.c_str()); |
110 |
+ std::cout << message << std::endl; |
111 |
+ break; |
112 |
+ } |
113 |
|
114 |
diff --git a/app-antivirus/skyldav/files/skyldav.confd b/app-antivirus/skyldav/files/skyldav.confd |
115 |
new file mode 100644 |
116 |
index 0000000..aad4d23 |
117 |
--- /dev/null |
118 |
+++ b/app-antivirus/skyldav/files/skyldav.confd |
119 |
@@ -0,0 +1,11 @@ |
120 |
+# Copyright 1999-2013 Gentoo Foundation |
121 |
+# Distributed under the terms of the GNU General Public License v2 |
122 |
+# $Header: $ |
123 |
+ |
124 |
+# Config file for /etc/init.d/skyldav |
125 |
+ |
126 |
+# Options to pass to the skyldav daemon. |
127 |
+# Option -d for daemonizing is always passed! |
128 |
+# See the skyldav(1) man page for more info. |
129 |
+ |
130 |
+#SKYLDAV_OPTS="-m 1" |
131 |
|
132 |
diff --git a/app-antivirus/skyldav/files/skyldav.initd b/app-antivirus/skyldav/files/skyldav.initd |
133 |
new file mode 100755 |
134 |
index 0000000..fd4bf09 |
135 |
--- /dev/null |
136 |
+++ b/app-antivirus/skyldav/files/skyldav.initd |
137 |
@@ -0,0 +1,26 @@ |
138 |
+#!/sbin/runscript |
139 |
+# Copyright 1999-2013 Gentoo Foundation |
140 |
+# Distributed under the terms of the GNU General Public License v2 |
141 |
+# $Header: $ |
142 |
+ |
143 |
+SKYLDAV_BIN="/usr/sbin/skyldav" |
144 |
+SKYLDAV_OPTS="${SKYLDAV_OPTS:--m 2}" |
145 |
+SKYLDAV_CONFIGFILE="/etc/skyldav.conf" |
146 |
+SKYLDAV_PIDFILE_DIR="${SKYLDAV_PIDFILE_DIR:-/var/run/${RC_SVCNAME}}" |
147 |
+SKYLDAV_PIDFILE="${SKYLDAV_PIDFILE:-${SKYLDAV_PIDFILE_DIR}/${RC_SVCNAME}.pid}" |
148 |
+ |
149 |
+name="${SKYLDAV_BIN##*/}" |
150 |
+command="${SKYLDAV_BIN}" |
151 |
+command_args="-d ${SKYLDAV_OPTS}" |
152 |
+pidfile="${SKYLDAV_PIDFILE}" |
153 |
+description="Skyld AV is an anti-virus on-access scanner based upon Clam AV and fanotify" |
154 |
+required_files="${SKYLDAV_CONFIG}" |
155 |
+ |
156 |
+depend() { |
157 |
+ use logger |
158 |
+ need localmount |
159 |
+} |
160 |
+ |
161 |
+start_pre() { |
162 |
+ checkpath -d -m 0755 -o root:root "${SKYLDAV_PIDFILE_DIR}" |
163 |
+} |
164 |
|
165 |
diff --git a/app-antivirus/skyldav/files/skyldav.service-r1 b/app-antivirus/skyldav/files/skyldav.service-r1 |
166 |
new file mode 100644 |
167 |
index 0000000..decd788 |
168 |
--- /dev/null |
169 |
+++ b/app-antivirus/skyldav/files/skyldav.service-r1 |
170 |
@@ -0,0 +1,15 @@ |
171 |
+[Unit] |
172 |
+Description=SkyldAV anti-virus on-access scanning daemon based upon Clam AV and fanotify |
173 |
+Requires=local-fs.target clamd.service |
174 |
+After=local-fs.target clamd.service |
175 |
+Before=multi-user.target |
176 |
+ |
177 |
+[Service] |
178 |
+Type=simple |
179 |
+Environment="SKYLDAV_MESSAGE_LEVEL=2" |
180 |
+ExecStart=/usr/sbin/skyldav -d -m ${SKYLDAV_MESSAGE_LEVEL} |
181 |
+#KillMode=process |
182 |
+#KillSignal=SIGTERM |
183 |
+ |
184 |
+[Install] |
185 |
+WantedBy=multi-user.target |
186 |
|
187 |
diff --git a/app-antivirus/skyldav/files/skyldav.service.conf b/app-antivirus/skyldav/files/skyldav.service.conf |
188 |
new file mode 100644 |
189 |
index 0000000..79c23a3 |
190 |
--- /dev/null |
191 |
+++ b/app-antivirus/skyldav/files/skyldav.service.conf |
192 |
@@ -0,0 +1,3 @@ |
193 |
+[Service] |
194 |
+# skyldav message level (-m) |
195 |
+#Environment="SKYLDAV_MESSAGE_LEVEL=1" |
196 |
|
197 |
diff --git a/app-antivirus/skyldav/files/skyldav.tmpfilesd b/app-antivirus/skyldav/files/skyldav.tmpfilesd |
198 |
new file mode 100644 |
199 |
index 0000000..a4f7cdc |
200 |
--- /dev/null |
201 |
+++ b/app-antivirus/skyldav/files/skyldav.tmpfilesd |
202 |
@@ -0,0 +1,2 @@ |
203 |
+# skyldav runtime directory for skyldav.pid and log (used by skyldavnotify) |
204 |
+d /run/skyldav 0755 root root - |
205 |
|
206 |
diff --git a/app-antivirus/skyldav/metadata.xml b/app-antivirus/skyldav/metadata.xml |
207 |
new file mode 100644 |
208 |
index 0000000..63306ff |
209 |
--- /dev/null |
210 |
+++ b/app-antivirus/skyldav/metadata.xml |
211 |
@@ -0,0 +1,11 @@ |
212 |
+<?xml version="1.0" encoding="UTF-8"?> |
213 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
214 |
+<pkgmetadata> |
215 |
+ <maintainer type="person"> |
216 |
+ <email>wschlich@g.o</email> |
217 |
+ <name>Wolfram Schlich</name> |
218 |
+ </maintainer> |
219 |
+ <upstream> |
220 |
+ <remote-id type="github">xypron/skyldav</remote-id> |
221 |
+ </upstream> |
222 |
+</pkgmetadata> |
223 |
|
224 |
diff --git a/app-antivirus/skyldav/skyldav-0.5-r1.ebuild b/app-antivirus/skyldav/skyldav-0.5-r1.ebuild |
225 |
new file mode 100644 |
226 |
index 0000000..3175fc8 |
227 |
--- /dev/null |
228 |
+++ b/app-antivirus/skyldav/skyldav-0.5-r1.ebuild |
229 |
@@ -0,0 +1,109 @@ |
230 |
+# Copyright 1999-2016 Gentoo Foundation |
231 |
+# Distributed under the terms of the GNU General Public License v2 |
232 |
+# $Id$ |
233 |
+ |
234 |
+EAPI=5 |
235 |
+ |
236 |
+inherit flag-o-matic linux-info linux-mod autotools-utils readme.gentoo-r1 systemd |
237 |
+ |
238 |
+DESCRIPTION="Skyld AV: on-access scanning daemon for ClamAV using fanotify" |
239 |
+HOMEPAGE="http://xypron.github.io/skyldav/" |
240 |
+ |
241 |
+## github release tarball |
242 |
+MY_PV=${PV/_rc/rc} |
243 |
+MY_P="${PN}-${MY_PV}" |
244 |
+SRC_URI="https://github.com/xypron/skyldav/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz" |
245 |
+ |
246 |
+## selfmade tarball |
247 |
+#MY_PVR=${PVR/_rc/rc} |
248 |
+#MY_P="${PN}-${MY_PVR}" |
249 |
+#SRC_URI="http://dev.gentoo.org/~wschlich/src/${CATEGORY}/${PN}/${MY_P}.tar.gz" |
250 |
+ |
251 |
+## github commit tarball |
252 |
+#MY_GIT_COMMIT="49bdb5e710b5a77c38ceb87da6015afb7009f1f9" |
253 |
+#MY_P="xypron-${PN}-${MY_GIT_COMMIT:0:7}" |
254 |
+#SRC_URI="https://github.com/xypron/${PN}/tarball/${MY_GIT_COMMIT} -> ${PF}.tar.gz" |
255 |
+ |
256 |
+S="${WORKDIR}/${MY_P}" |
257 |
+ |
258 |
+KEYWORDS="~amd64 ~x86" |
259 |
+SLOT="0" |
260 |
+LICENSE="Apache-2.0" |
261 |
+IUSE="libnotify systemd" |
262 |
+ |
263 |
+RDEPEND=">=app-antivirus/clamav-0.97.8 |
264 |
+ sys-apps/util-linux |
265 |
+ sys-libs/libcap |
266 |
+ libnotify? ( |
267 |
+ media-libs/libcanberra[gtk] |
268 |
+ x11-libs/libnotify |
269 |
+ x11-libs/gtk+:2 |
270 |
+ )" |
271 |
+DEPEND="${RDEPEND} |
272 |
+ sys-devel/autoconf-archive" |
273 |
+ |
274 |
+## autotools-utils.eclass settings |
275 |
+AUTOTOOLS_AUTORECONF="1" |
276 |
+AUTOTOOLS_IN_SOURCE_BUILD="1" |
277 |
+DOCS=( AUTHORS NEWS README ) |
278 |
+PATCHES=( |
279 |
+ "${FILESDIR}/${P}-syslog.patch" |
280 |
+ "${FILESDIR}/${P}-examples.patch" |
281 |
+ "${FILESDIR}/${P}-conf.patch" |
282 |
+) |
283 |
+ |
284 |
+pkg_setup() { |
285 |
+ linux-info_pkg_setup |
286 |
+ kernel_is ge 3 8 0 || die "Linux 3.8.0 or newer recommended" |
287 |
+ CONFIG_CHECK="FANOTIFY FANOTIFY_ACCESS_PERMISSIONS" |
288 |
+ check_extra_config |
289 |
+ |
290 |
+ ## define contents for README.gentoo |
291 |
+ if use systemd; then |
292 |
+ DOC_CONTENTS='SkyldAV provides a systemd service.'$'\n' |
293 |
+ DOC_CONTENTS+='Please edit the systemd service config file to match your needs:'$'\n' |
294 |
+ DOC_CONTENTS+='/etc/systemd/system/skyldav.service.d/00gentoo.conf'$'\n' |
295 |
+ DOC_CONTENTS+='# systemctl daemon-reload'$'\n' |
296 |
+ DOC_CONTENTS+='# systemctl restart skyldav.service'$'\n' |
297 |
+ DOC_CONTENTS+='Example for enabling the SkyldAV service:'$'\n' |
298 |
+ DOC_CONTENTS+='# systemctl enable skyldav.service'$'\n' |
299 |
+ else |
300 |
+ DOC_CONTENTS='SkyldAV provides an init script for OpenRC.'$'\n' |
301 |
+ DOC_CONTENTS+='Please edit the init script config file to match your needs:'$'\n' |
302 |
+ DOC_CONTENTS+='/etc/conf.d/skyldav'$'\n' |
303 |
+ DOC_CONTENTS+='Example for enabling the SkyldAV init script:'$'\n' |
304 |
+ DOC_CONTENTS+='# rc-update add skyldav default'$'\n' |
305 |
+ fi |
306 |
+} |
307 |
+ |
308 |
+src_configure() { |
309 |
+ local myeconfargs=( |
310 |
+ $(use_with libnotify notification) |
311 |
+ ) |
312 |
+ autotools-utils_src_configure |
313 |
+} |
314 |
+ |
315 |
+src_install() { |
316 |
+ autotools-utils_src_install |
317 |
+ |
318 |
+ ## install systemd service or OpenRC init scripts |
319 |
+ if use systemd; then |
320 |
+ systemd_newunit "${FILESDIR}/skyldav.service-r1" skyldav.service |
321 |
+ systemd_install_serviced "${FILESDIR}"/skyldav.service.conf |
322 |
+ systemd_newtmpfilesd "${FILESDIR}"/skyldav.tmpfilesd skyldav.conf |
323 |
+ else |
324 |
+ newinitd "${FILESDIR}/${PN}.initd" ${PN} |
325 |
+ newconfd "${FILESDIR}/${PN}.confd" ${PN} |
326 |
+ fi |
327 |
+ |
328 |
+ ## create README.gentoo from ${DOC_CONTENTS} |
329 |
+ DISABLE_AUTOFORMATTING=1 readme.gentoo_create_doc |
330 |
+} |
331 |
+ |
332 |
+pkg_postinst() { |
333 |
+ ## workaround for /usr/lib/tmpfiles.d/skyldav.conf |
334 |
+ ## not getting processed until the next reboot |
335 |
+ if use systemd; then |
336 |
+ install -d -m 0755 -o root -g root /run/skyldav |
337 |
+ fi |
338 |
+} |