From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- app-antivirus/skyldav/Manifest | 11 +++ app-antivirus/skyldav/files/skyldav-conf.patch | 21 ++++ app-antivirus/skyldav/files/skyldav-examples.patch | 11 +++ app-antivirus/skyldav/files/skyldav.confd | 10 ++ app-antivirus/skyldav/files/skyldav.initd | 25 +++++ app-antivirus/skyldav/files/skyldav.service-r1 | 15 +++ app-antivirus/skyldav/files/skyldav.service.conf | 3 + app-antivirus/skyldav/files/skyldav.tmpfilesd | 2 + app-antivirus/skyldav/metadata.xml | 11 +++ app-antivirus/skyldav/skyldav-0.7.ebuild | 107 +++++++++++++++++++++ 10 files changed, 216 insertions(+) create mode 100644 app-antivirus/skyldav/Manifest create mode 100644 app-antivirus/skyldav/files/skyldav-conf.patch create mode 100644 app-antivirus/skyldav/files/skyldav-examples.patch create mode 100644 app-antivirus/skyldav/files/skyldav.confd create mode 100755 app-antivirus/skyldav/files/skyldav.initd create mode 100644 app-antivirus/skyldav/files/skyldav.service-r1 create mode 100644 app-antivirus/skyldav/files/skyldav.service.conf create mode 100644 app-antivirus/skyldav/files/skyldav.tmpfilesd create mode 100644 app-antivirus/skyldav/metadata.xml create mode 100644 app-antivirus/skyldav/skyldav-0.7.ebuild (limited to 'app-antivirus/skyldav') diff --git a/app-antivirus/skyldav/Manifest b/app-antivirus/skyldav/Manifest new file mode 100644 index 000000000000..9e2ea8aa1727 --- /dev/null +++ b/app-antivirus/skyldav/Manifest @@ -0,0 +1,11 @@ +AUX skyldav-conf.patch 1090 SHA256 cb9dfb0bb4f819a97831181285cbda69f32ae51c59a0b49497aaf72463f50f7b SHA512 5e628905f5e638889da761a5ce4e9e1c1a5e4c52a40ee2da0ceceb4706140e9836d37bcf8d5bc78da0fd74be4dc40032300a0d9584ecb431fe71583091ba3c4e WHIRLPOOL 23608d85b577667af0486a61fc9f716fff17ef145fec26bd3a9c4f8a5b019beef3d1673b99281be83942d7d9e1e3b36b7788e6f3c10f76e90e4b025f05efc58a +AUX skyldav-examples.patch 349 SHA256 60cf3a623b86349ce7fae4f943d37f4e5e090152d28d08f6044ba7e991338ee7 SHA512 b31e227825f5ea695ff8b957e95611d63f7157959fc610edb23c90b6bec69739f6e11288fcc9f19043492cf749c8aa5f8bafe875638e996e58731b354bcc6618 WHIRLPOOL d99d80e2ffae03897cc44beb8595bc192c9732814746ad00e94346fa5f5300010291c42e1e2a120e74fb86f68f7eae7e5a2219c6366a94d6cd2ebd4418340814 +AUX skyldav.confd 301 SHA256 d40a3920ba1f200e833504ab59a666b281d3ec7b3540409c2304e22c9e613a54 SHA512 1b1e1d803761c0ca94937bde03d31831bdd82bac36e374db4fba089fbd44dbe4fef8a9d9aecdd503f12aeb6aba641d48cdc8e27b74d82a8061ba34b915194c0c WHIRLPOOL 9036c2e2b64204f6fc9ab4489ca48eb030b562afdb654607f80f62a5b90b972c7730b7795e6714ee4f065ec3109dcce3d684adeeb0e267f28fd5692276a15c0b +AUX skyldav.initd 743 SHA256 ea5c2d31bdecd3c830ba6b00af500a4f0beaa734bb336332a23e17a3400cddfe SHA512 485ef14b7636fc9514388d66525d03dae460cdb20814335684ef47a6217d035d235a900d219b54e5ea6867ed4339797bdc1f03ba02b8547429445ea28918a6ad WHIRLPOOL 6c038d5335e1f7e77165351c94e31146985fdbe4c7840ca55ed6195a4d910fcde052373cc0c740f0375856aa542e62c4838c72c04d5af96f75950585465b8876 +AUX skyldav.service-r1 392 SHA256 17f49ee3b23883ae8f67ffe896f7655e545f72660f31ef4573363d555501116a SHA512 40da1fc4925076396a4fe75449bae3231d75cfaa4dc8cd5f1b2d7518804a78d37d7d4e87c371d58191b2cc20273b86dc93a79c24b867ab6ef493a2ebb5d9b5a7 WHIRLPOOL f98912d455faa4799c2aa71f0f290759b36e2bcee091b2b83b739913e86a224f98c88fa35031135eb7ee692319280fddf51e88a6dfacfad011cc6ef2abd26725 +AUX skyldav.service.conf 78 SHA256 f604cf7dfb8f16673f0629de5cd917499219777302886ca52c50d1a457ab2711 SHA512 04089de87d2c842cd9f9103cd81ea999b55239c616a731107fd7d8f40fffdc7bd6bcb168cb322a00bece72e3422ed423782f0377bb63e89731b776df145e63cc WHIRLPOOL 426f520fae82f50aef3befcf94c2696fba44abcff17b13098808863665dd748a28807318a04e2633b2a15d6dce68e6679357542d5d85023dd2c472fc9e27c07e +AUX skyldav.tmpfilesd 108 SHA256 df4c94c0a93f642790ef92f42923ca2f3231e60441c41ea19cf04b943fd44f96 SHA512 a30f18083dbdd613d735fc632b43a45bdb61a63a91fef4306afe379cf1dc398974caa72b11d0cff4e62765c5c8ea43212a9e366a95ca902d53f04248527d8e83 WHIRLPOOL 115c695f94e696bc09e40a0ceabbf2d9ef2b51553f89760ec86e86a031b71123b7b88353782a052e02421abbb13f72fa376da143e87314e40480fb7d0616b020 +DIST skyldav-0.7.tar.gz 244444 SHA256 e238706fd923cc3da685b27ef6d89bd49200d56102eba11dc279a47b93840a6d SHA512 008988ca7ab24ea8b77377e7a639ddc0a26149eab41af1d429cf8f870320617feda01ec2c9403493a3bb0bd5cd0c8cad94701bcb6c28993f2d9739e1a1b36c0b WHIRLPOOL b8612e3d835b0ef086f17fc430b671fdded6f5e7d53a0340638a95db59d2c0d79496c56962bdbbf9371f9a5389ec70751e2aee460244af462f618d46d6a2574d +EBUILD skyldav-0.7.ebuild 3188 SHA256 1dce6b09ac3835703031169b7f5ed51553fc5c670fbf9a75afc560105b67809a SHA512 b9b829dc59fda88c932bcdd8d937ac679fd492e0a0cf405ae9ad1f3268651495a988223b60a9eeeac13cd66f2d3b80b98088a03d1c110fdab412c4d00d09ee76 WHIRLPOOL fe1677d08c8c3fae6c6b4674efbea659d5fbc2655313cc2c2e30e86ce83b6056f3d4e0d296d2b1b9454ba4c3500ef6fea5b432cf2b91dc86bf568d6d02caba5f +MISC ChangeLog 1347 SHA256 49608ad37978051267dba4471e01816db9d1d92733e43ff4465b8f7c384adcdb SHA512 8304269ecb328ba9a9c357983c3ff11ca11cbfa9d75e71488652f75dd0d27a62129bece9ab3fc6a2c55a9d446073f07830026ad97cdde1a530b7ebfb54ccd3a3 WHIRLPOOL a0bee09f3a40bcc1f05e9e75064c99d75abe8349b3711be2e5ddb6e582307f14fa959e86d33d08177a1cbd3650a4f9bcb647c17b4bfc9a0956d70efa4b30e6d0 +MISC metadata.xml 339 SHA256 faff10bb6ba560d9a36cb33cf9cd8ea8235363c89c974959ca27db19d7d21c61 SHA512 e949752a0886d6bb0783d2039a58444fe3809c1fd9393bd2f7ad26efc711c375d3fee9f335ece66161ffabc7f55435e028010eef3af84f88d26d8529bde5fb98 WHIRLPOOL 4a53ad5ebbd7e0ebe1f7ce14c7d281e5208c546cf18166e77021a642ee49810f08d080d2a5cbc4e04143092fbb585f31805ff47f7fecff2ae5bbfc98270a0ea1 diff --git a/app-antivirus/skyldav/files/skyldav-conf.patch b/app-antivirus/skyldav/files/skyldav-conf.patch new file mode 100644 index 000000000000..ed5b2058f6a6 --- /dev/null +++ b/app-antivirus/skyldav/files/skyldav-conf.patch @@ -0,0 +1,21 @@ +diff -urN skyldav-0.7.orig/examples/etc/skyldav.conf skyldav-0.7/examples/etc/skyldav.conf +--- skyldav-0.7.orig/examples/etc/skyldav.conf 2016-06-12 18:39:51.000000000 +0200 ++++ skyldav-0.7/examples/etc/skyldav.conf 2017-02-21 15:12:06.875945224 +0100 +@@ -22,6 +22,9 @@ + + # Directories that shall not be scanned (including subdirectories) + # EXCLUDE_PATH = /var/noscan, /opt/noscan ++# ++# Exclude various portage directories for performance reasons ++EXCLUDE_PATH = /usr/portage, /var/cache/edb, /var/db/pkg, /var/tmp/portage, /var/tmp/binpkgs, /var/log/portage + + # File systems that are local, virus scan results may be cached. + # LOCAL_FS = ext3, ext4, iso9660, tmpfs, vfat +@@ -31,6 +34,7 @@ + # File systems that shall not be marked for virus scan. + # Cifs uses a background daemon which causes problems when scanned. + # Exclusion of fuse file systems is hard coded. ++# Do not exclude devtmpfs and configfs, as userspace could write malware onto them! + # NOMARK_FS = proc, sysfs + NOMARK_FS = proc, sysfs, devpts, debugfs, securityfs, cgroup, rpc_pipefs + NOMARK_FS = mqueue, autofs, cifs diff --git a/app-antivirus/skyldav/files/skyldav-examples.patch b/app-antivirus/skyldav/files/skyldav-examples.patch new file mode 100644 index 000000000000..b62e78cc9698 --- /dev/null +++ b/app-antivirus/skyldav/files/skyldav-examples.patch @@ -0,0 +1,11 @@ +diff -urN skyldav-0.7.orig/Makefile.am skyldav-0.7/Makefile.am +--- skyldav-0.7.orig/Makefile.am 2016-06-12 18:39:51.000000000 +0200 ++++ skyldav-0.7/Makefile.am 2017-02-21 15:11:35.709518793 +0100 +@@ -9,7 +9,6 @@ + rm -rf doc/doxygen + + install-data-local: \ +- install-skyldav-examples \ + install-skyldav-conf \ + install-skyldavnotify-desktop + diff --git a/app-antivirus/skyldav/files/skyldav.confd b/app-antivirus/skyldav/files/skyldav.confd new file mode 100644 index 000000000000..87829b658ebe --- /dev/null +++ b/app-antivirus/skyldav/files/skyldav.confd @@ -0,0 +1,10 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Config file for /etc/init.d/skyldav + +# Options to pass to the skyldav daemon. +# Option -d for daemonizing is always passed! +# See the skyldav(1) man page for more info. + +#SKYLDAV_OPTS="-m 1" diff --git a/app-antivirus/skyldav/files/skyldav.initd b/app-antivirus/skyldav/files/skyldav.initd new file mode 100755 index 000000000000..539cd4f083cd --- /dev/null +++ b/app-antivirus/skyldav/files/skyldav.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +SKYLDAV_BIN="/usr/sbin/skyldav" +SKYLDAV_OPTS="${SKYLDAV_OPTS:--m 2}" +SKYLDAV_CONFIGFILE="/etc/skyldav.conf" +SKYLDAV_PIDFILE_DIR="${SKYLDAV_PIDFILE_DIR:-/var/run/${RC_SVCNAME}}" +SKYLDAV_PIDFILE="${SKYLDAV_PIDFILE:-${SKYLDAV_PIDFILE_DIR}/${RC_SVCNAME}.pid}" + +name="${SKYLDAV_BIN##*/}" +command="${SKYLDAV_BIN}" +command_args="-d ${SKYLDAV_OPTS}" +pidfile="${SKYLDAV_PIDFILE}" +description="Skyld AV is an anti-virus on-access scanner based upon Clam AV and fanotify" +required_files="${SKYLDAV_CONFIG}" + +depend() { + use logger + need localmount +} + +start_pre() { + checkpath -d -m 0755 -o root:root "${SKYLDAV_PIDFILE_DIR}" +} diff --git a/app-antivirus/skyldav/files/skyldav.service-r1 b/app-antivirus/skyldav/files/skyldav.service-r1 new file mode 100644 index 000000000000..decd788a9f83 --- /dev/null +++ b/app-antivirus/skyldav/files/skyldav.service-r1 @@ -0,0 +1,15 @@ +[Unit] +Description=SkyldAV anti-virus on-access scanning daemon based upon Clam AV and fanotify +Requires=local-fs.target clamd.service +After=local-fs.target clamd.service +Before=multi-user.target + +[Service] +Type=simple +Environment="SKYLDAV_MESSAGE_LEVEL=2" +ExecStart=/usr/sbin/skyldav -d -m ${SKYLDAV_MESSAGE_LEVEL} +#KillMode=process +#KillSignal=SIGTERM + +[Install] +WantedBy=multi-user.target diff --git a/app-antivirus/skyldav/files/skyldav.service.conf b/app-antivirus/skyldav/files/skyldav.service.conf new file mode 100644 index 000000000000..79c23a3ff05d --- /dev/null +++ b/app-antivirus/skyldav/files/skyldav.service.conf @@ -0,0 +1,3 @@ +[Service] +# skyldav message level (-m) +#Environment="SKYLDAV_MESSAGE_LEVEL=1" diff --git a/app-antivirus/skyldav/files/skyldav.tmpfilesd b/app-antivirus/skyldav/files/skyldav.tmpfilesd new file mode 100644 index 000000000000..a4f7cdc47423 --- /dev/null +++ b/app-antivirus/skyldav/files/skyldav.tmpfilesd @@ -0,0 +1,2 @@ +# skyldav runtime directory for skyldav.pid and log (used by skyldavnotify) +d /run/skyldav 0755 root root - diff --git a/app-antivirus/skyldav/metadata.xml b/app-antivirus/skyldav/metadata.xml new file mode 100644 index 000000000000..63306ff3a6d0 --- /dev/null +++ b/app-antivirus/skyldav/metadata.xml @@ -0,0 +1,11 @@ + + + + + wschlich@gentoo.org + Wolfram Schlich + + + xypron/skyldav + + diff --git a/app-antivirus/skyldav/skyldav-0.7.ebuild b/app-antivirus/skyldav/skyldav-0.7.ebuild new file mode 100644 index 000000000000..0a0ef09e08fb --- /dev/null +++ b/app-antivirus/skyldav/skyldav-0.7.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit flag-o-matic linux-info linux-mod autotools-utils readme.gentoo-r1 systemd + +DESCRIPTION="Skyld AV: on-access scanning daemon for ClamAV using fanotify" +HOMEPAGE="http://xypron.github.io/skyldav/" + +## github release tarball +MY_PV=${PV/_rc/rc} +MY_P="${PN}-${MY_PV}" +SRC_URI="https://github.com/xypron/skyldav/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz" + +## selfmade tarball +#MY_PVR=${PVR/_rc/rc} +#MY_P="${PN}-${MY_PVR}" +#SRC_URI="https://dev.gentoo.org/~wschlich/src/${CATEGORY}/${PN}/${MY_P}.tar.gz" + +## github commit tarball +#MY_GIT_COMMIT="49bdb5e710b5a77c38ceb87da6015afb7009f1f9" +#MY_P="xypron-${PN}-${MY_GIT_COMMIT:0:7}" +#SRC_URI="https://github.com/xypron/${PN}/tarball/${MY_GIT_COMMIT} -> ${PF}.tar.gz" + +S="${WORKDIR}/${MY_P}" + +KEYWORDS="~amd64 ~x86" +SLOT="0" +LICENSE="Apache-2.0" +IUSE="libnotify systemd" + +RDEPEND=">=app-antivirus/clamav-0.97.8 + sys-apps/util-linux + sys-libs/libcap + libnotify? ( + media-libs/libcanberra[gtk] + x11-libs/libnotify + x11-libs/gtk+:2 + )" +DEPEND="${RDEPEND} + sys-devel/autoconf-archive" + +## autotools-utils.eclass settings +AUTOTOOLS_AUTORECONF="1" +AUTOTOOLS_IN_SOURCE_BUILD="1" +DOCS=( AUTHORS NEWS README ) +PATCHES=( + "${FILESDIR}/${PN}-examples.patch" + "${FILESDIR}/${PN}-conf.patch" +) + +pkg_setup() { + linux-info_pkg_setup + kernel_is ge 3 8 0 || die "Linux 3.8.0 or newer recommended" + CONFIG_CHECK="FANOTIFY FANOTIFY_ACCESS_PERMISSIONS" + check_extra_config + + ## define contents for README.gentoo + if use systemd; then + DOC_CONTENTS='Skyld AV provides a systemd service.'$'\n' + DOC_CONTENTS+='Please edit the systemd service config file to match your needs:'$'\n' + DOC_CONTENTS+='/etc/systemd/system/skyldav.service.d/00gentoo.conf'$'\n' + DOC_CONTENTS+='# systemctl daemon-reload'$'\n' + DOC_CONTENTS+='# systemctl restart skyldav.service'$'\n' + DOC_CONTENTS+='Example for enabling the Skyld AV service:'$'\n' + DOC_CONTENTS+='# systemctl enable skyldav.service'$'\n' + else + DOC_CONTENTS='Skyld AV provides an init script for OpenRC.'$'\n' + DOC_CONTENTS+='Please edit the init script config file to match your needs:'$'\n' + DOC_CONTENTS+='/etc/conf.d/skyldav'$'\n' + DOC_CONTENTS+='Example for enabling the Skyld AV init script:'$'\n' + DOC_CONTENTS+='# rc-update add skyldav default'$'\n' + fi +} + +src_configure() { + local myeconfargs=( + $(use_with libnotify notification) + ) + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + ## install systemd service or OpenRC init scripts + if use systemd; then + systemd_newunit "${FILESDIR}/skyldav.service-r1" skyldav.service + systemd_install_serviced "${FILESDIR}"/skyldav.service.conf + systemd_newtmpfilesd "${FILESDIR}"/skyldav.tmpfilesd skyldav.conf + else + newinitd "${FILESDIR}/${PN}.initd" ${PN} + newconfd "${FILESDIR}/${PN}.confd" ${PN} + fi + + ## create README.gentoo from ${DOC_CONTENTS} + DISABLE_AUTOFORMATTING=1 readme.gentoo_create_doc +} + +pkg_postinst() { + ## workaround for /usr/lib/tmpfiles.d/skyldav.conf + ## not getting processed until the next reboot + if use systemd; then + install -d -m 0755 -o root -g root /run/skyldav + fi +} -- cgit v1.2.3