From 77398e424e45d9e98c1cef3c43bdadb9d56e81ef Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 10 Nov 2019 13:21:36 +0000 Subject: gentoo resync : 10.11.2019 --- app-antivirus/clamav-unofficial-sigs/Manifest | 7 +- .../clamav-unofficial-sigs-6.0.1-r2.ebuild | 81 ++++++++++++++++++++++ .../clamav-unofficial-sigs-6.0.1.ebuild | 65 ----------------- .../files/clamav-unofficial-sigs.crond | 19 +++++ .../files/clamav-unofficial-sigs.service | 15 ++++ .../files/clamav-unofficial-sigs.timer | 12 ++++ app-antivirus/clamav-unofficial-sigs/metadata.xml | 8 +++ 7 files changed, 140 insertions(+), 67 deletions(-) create mode 100644 app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1-r2.ebuild delete mode 100644 app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1.ebuild create mode 100644 app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.crond create mode 100644 app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.service create mode 100644 app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.timer (limited to 'app-antivirus/clamav-unofficial-sigs') diff --git a/app-antivirus/clamav-unofficial-sigs/Manifest b/app-antivirus/clamav-unofficial-sigs/Manifest index 6ba2073dd802..e8fd00bcea0a 100644 --- a/app-antivirus/clamav-unofficial-sigs/Manifest +++ b/app-antivirus/clamav-unofficial-sigs/Manifest @@ -1,7 +1,10 @@ AUX clamav-unofficial-sigs.8 4568 BLAKE2B 3bb0a56c11d733d0727c38588fb1b9b38b679e32cf9ac0b2c277f623e3a3508df2aa0ac65497fa0026d43a629ec69a0cad386ca57b9cb8178b30b3061fc2abf1 SHA512 8e688281c6918ea8c13f5d76c63fee65b6e3378ca1d2e92033a741b7f02d12607d838484075e0d3ae8d99680a5b235acee062fc80c63f7e5577cfee575b56573 +AUX clamav-unofficial-sigs.crond 737 BLAKE2B 7cb2bf223cdae522a8af401ff04e40a1bd20ce3dd1170a51243ca21ce79836719db6c41bc12fc2675958e3008cd1753c30ed695ebe13777fd9fc2a60c429a308 SHA512 da3d4ab9c83a606861135398e37bd5892ccbd962a407960410a7973fbe0a209cd51ab79a3787577062142885ceb014c6be683b3a0b3bf2bebf0aab09e28e2481 AUX clamav-unofficial-sigs.logrotate 109 BLAKE2B 662b268f5332f088670fb762dd5162c0fccba68ca3fad5d089f2330057f1d52c35785924e56a8174c3d9c2d7d6c9232f3d41adb83c2cd88c55d096b764781ed8 SHA512 3d79caf1bbc29218aacda9c6c411b6b9e827644c3a89a3a1b9e0d89baeb7927cdbda3322c9b5a5186e53f0efa598e165d10cfa698936a687bd6279f6e3866830 +AUX clamav-unofficial-sigs.service 433 BLAKE2B 11844035c7679c5c5d08ac91ce2da56c054614e36c7ced7ed30d94324e16487eebb98b16eb1ddbf1824ca32cedc25b0152d4c2e38511d8e01a498b7ce471efdb SHA512 7a4669a25995743d1d7a6a952854e77a544b59dd9207ae99da1c26552ba197f48f4b4c77600183e7e0af848944e7b7700ba79037d9802bd063be7aed82203e9f +AUX clamav-unofficial-sigs.timer 336 BLAKE2B e7abc9f011becab462dd23147843bb7e3ab23fee13babd41e8958eeab42db018980cdee1404cdeafde0e2ac87a4fde0ee9aa53e90de0bf191a12d688ebc715e3 SHA512 a921b065671bb053f135a4a44e268d4002acf1a42373304253fd3595fa414df9cbfd91c7a54b4be30012879c9446e0e2de7ca86833b6c03775e434a41ecb0e5d DIST clamav-unofficial-sigs-5.6.2.tar.gz 50931 BLAKE2B 6fea42f8f76ae5344c2b96c9203d2b09e755573d03f2b9d3d9ee2a488150fbb6f598e052b730daf12c551920a71fd8daad1dc10002fca12fa4a74554cf7d445e SHA512 79978db065a22d778490d0a2673f5a0bb7ab73e42de64563e7d26ac23459f7e5b2e73b0548e1ea6483e3c5f43eed65cdbc6814037cc0c46a339366a0150e5427 DIST clamav-unofficial-sigs-6.0.1.tar.gz 52262 BLAKE2B 9523da749e88c5e93f0986d7d4a234c3b1eff7c207ceb266e63cd76d7cffdf4a85aedf90aa746f7e1c82be97018f40896bbaa2dfd8f749f3c167d3bff74293d7 SHA512 d4f619628c9b2804a6d5ad533adaad72e323bb0604334c045cf92fc550ffb114493653d097b68337b33f51dc1215dc073b4ec9dc42abea8707cb03aefa40b289 EBUILD clamav-unofficial-sigs-5.6.2.ebuild 1829 BLAKE2B dfdde92f921a0ab51e48d9167245b2f50d8b34678655712a68c92ac57f58ca3f4fb94b04259233662805c702721e47fb723e85ab4f2dedacf01c7131e89387e3 SHA512 b8d2e4ee32b4e5d265562ad591f885d22cb960dfda66a083d58f7cab702e345fc233b62cb74d3a1d21e3a9d1e67ddbdcc9e10026645403b7c4213593bbef4540 -EBUILD clamav-unofficial-sigs-6.0.1.ebuild 1831 BLAKE2B c51bc4ae433b836349bb2fba2d4d4bbe2a83275777d3f8feb09d8e004826f793390ab77f6496977ed56519afa0ac9fa486e679ce58005d98dcf35725766fcc7a SHA512 33f1cbcd9b7049ecf2cd11a0b52c419bfb0cffcd59ba889038795d6b4626353e3303a68af68fafd92fbb4e156681bdfe827a50dbdc30515090e1765fe510c9aa -MISC metadata.xml 383 BLAKE2B 3640860216d88ba2817e3c23aea1bd8a6269319ee2f3efeeb384503e60f08d672d1fdbfb5add18b36027b54fd73e75b6a71c00cb97d88049c1c5935be93df2ef SHA512 05f6d2f4047ee61b977dc999baae20c7b607bd22182c23a1a9435c1e9a3e5c5a13189cc9976a01d4dc4f82024d907804e8263c4cbbfa1f8c994ea30a1e74addc +EBUILD clamav-unofficial-sigs-6.0.1-r2.ebuild 2445 BLAKE2B 58a18284d29ab13cfd26fa82ae03feef9135711fcb32de6765b103d5f5e2ab7629cb430e6b28ecb81c3d0d831410a4474130967908991aabebca837b29a2d278 SHA512 7f41a62f46d899652f982270551cfaf8bc1f14892bf95ac17a02cbf8ec85117a39986daac62b20c48c72771084ad50aedc313868dc5937c7bd62d2b256e0777f +MISC metadata.xml 699 BLAKE2B f053d76f76bc2c2f38308ba59f7cff4c991ab16a62ea63c255e543ff1ba4964cf24be6c3cf5b9f4dea82579d637c84d8c072bbc475f4d6b12665d35d00b0e7d1 SHA512 8a1a737b5012f5489cb24230f20d757f861da8ec125bd19e2aa22a5fb7f932e36d17ca771796e3eb167d3141487851e83d3a83d45e3c6a5a05ab0ce4b7738e0b diff --git a/app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1-r2.ebuild b/app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1-r2.ebuild new file mode 100644 index 000000000000..694d3dc7418e --- /dev/null +++ b/app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1-r2.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit user systemd + +DESCRIPTION="Download and install third-party clamav signatures" +HOMEPAGE="https://github.com/extremeshok/clamav-unofficial-sigs" +SRC_URI="https://github.com/extremeshok/clamav-unofficial-sigs/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="cron" + +# The script relies on either net-misc/socat, or Perl's +# IO::Socket::UNIX. We already depend on Perl, and Gentoo's Perl ships +# with IO::Socket::UNIX, so we can leave out net-misc/socat here. +RDEPEND="${DEPEND} + app-crypt/gnupg + dev-lang/perl + net-dns/bind-tools + || ( net-misc/wget net-misc/curl )" + +src_install() { + dosbin "${PN}.sh" + + # The script's working directory (set in the conf file). By default, + # it runs as clamav/clamav. We set the owner/group later, in + # pkg_preinst, after the user/group is sure to exist (because we + # create them otherwise). + keepdir "/var/lib/${PN}" + + insinto /etc/logrotate.d + doins "${FILESDIR}/${PN}.logrotate" + + insinto "/etc/${PN}" + doins config/{master,user}.conf + newins config/os.gentoo.conf os.conf + + doman "${FILESDIR}/${PN}.8" + dodoc README.md + + if use cron; then + # Beware, this directory is not completely standard. However, + # we need this to run as "clamav" with a non-default shell and + # home directory (bug 694054), and this seems like the most + # reliable way to accomplish that. + insinto "/etc/cron.d" + newins "${FILESDIR}/${PN}.crond" "${PN}" + else + dodoc "${FILESDIR}/${PN}.crond" + fi + + # Install the systemd service and timer unconditionally, because + # the timer is disabled by default (and won't annoy people until + # after they've configured the script). + systemd_dounit "${FILESDIR}/${PN}".{service,timer} +} + +pkg_preinst() { + # Should agree with app-antivirus/clamav. We don't actually need + # clamav to function, so it isn't one of our dependencies, and + # that's why we might need to create its user ourselves. + enewgroup clamav + enewuser clamav -1 -1 /dev/null clamav + fowners clamav:clamav "/var/lib/${PN}" +} + +pkg_postinst() { + elog '' + elog "You will need to select databases in /etc/${PN}/master.conf." + elog "For details, please see the ${PN}(8) manual page." + elog '' + elog 'An up-to-date description of the available Sanesecurity' + elog 'databases is available at,' + elog '' + elog ' http://sanesecurity.com/usage/signatures/' + elog '' +} diff --git a/app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1.ebuild b/app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1.ebuild deleted file mode 100644 index 6fc6ec0b574c..000000000000 --- a/app-antivirus/clamav-unofficial-sigs/clamav-unofficial-sigs-6.0.1.ebuild +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit user - -DESCRIPTION="Download and install third-party clamav signatures" -HOMEPAGE="https://github.com/extremeshok/${PN}" -SRC_URI="https://github.com/extremeshok/clamav-unofficial-sigs/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -# The script relies on either net-misc/socat, or Perl's -# IO::Socket::UNIX. We already depend on Perl, and Gentoo's Perl ships -# with IO::Socket::UNIX, so we can leave out net-misc/socat here. -RDEPEND="${DEPEND} - app-crypt/gnupg - dev-lang/perl - net-dns/bind-tools - || ( net-misc/wget net-misc/curl )" - -src_install() { - dosbin "${PN}.sh" - - # The script's working directory (set in the conf file). By default, - # it runs as clamav/clamav. We set the owner/group later, in - # pkg_preinst, after the user/group is sure to exist (because we - # create them otherwise). - keepdir "/var/lib/${PN}" - - insinto /etc/logrotate.d - doins "${FILESDIR}/${PN}.logrotate" - - insinto "/etc/${PN}" - doins config/{master,user}.conf - newins config/os.gentoo.conf os.conf - - doman "${FILESDIR}/${PN}.8" - dodoc README.md -} - -pkg_preinst() { - # Should agree with app-antivirus/clamav. We don't actually need - # clamav to function, so it isn't one of our dependencies, and - # that's why we might need to create its user ourselves. - enewgroup clamav - enewuser clamav -1 -1 /dev/null clamav - fowners clamav:clamav "/var/lib/${PN}" -} - -pkg_postinst() { - elog '' - elog "You will need to select databases in /etc/${PN}/master.conf." - elog "For details, please see the ${PN}(8) manual page." - elog '' - elog 'An up-to-date description of the available Sanesecurity' - elog 'databases is available at,' - elog '' - elog ' http://sanesecurity.com/usage/signatures/' - elog '' -} diff --git a/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.crond b/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.crond new file mode 100644 index 000000000000..49ef1db3034b --- /dev/null +++ b/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.crond @@ -0,0 +1,19 @@ +# +# Run clamav-unofficial-sigs hourly. +# +# This file should be copied to /etc/cron.d rather than, say, +# /etc/cron.hourly because it needs to run as the clamav user (to +# alter the databases), but the default settings for that user in +# Gentoo are insufficient (see bug 694054). +# +# In particular, the clamav user needs a Bash shell and a home +# directory since clamav-unofficial-sigs is written in Bash and +# because otherwise cron will complain about trying to chdir to a +# nonexistent home directory. When run out of /etc/cron.d, we can set +# HOME and SHELL to appropriate values, unlike with scripts in +# /etc/cron.hourly. +# +HOME=/var/lib/clamav-unofficial-sigs +SHELL=/bin/bash + +01 * * * * clamav /usr/sbin/clamav-unofficial-sigs.sh diff --git a/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.service b/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.service new file mode 100644 index 000000000000..ed9fa7e9f04d --- /dev/null +++ b/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.service @@ -0,0 +1,15 @@ +# +# Service file corresponding to clamav-unofficial-sigs.timer. +# Upstream provides a similar file, but with the wrong path +# and running as root, so it's just less of a headache to +# include our own. +# + +[Unit] +Description=ClamAV unofficial signature update service +Documentation=man:clamav-unofficial-sigs(8) + +[Service] +ExecStart=bash /usr/sbin/clamav-unofficial-sigs.sh +User=clamav +WorkingDirectory=/var/lib/clamav-unofficial-sigs diff --git a/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.timer b/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.timer new file mode 100644 index 000000000000..299ffd841329 --- /dev/null +++ b/app-antivirus/clamav-unofficial-sigs/files/clamav-unofficial-sigs.timer @@ -0,0 +1,12 @@ +# +# Run clamav-unofficial-sigs.service every hour, at 45 minutes past the hour. +# We do not include an [Install] section because this package does not +# technically depend on clamav to function. +# + +[Unit] +Description=ClamAV unofficial signature update timer +Documentation=man:clamav-unofficial-sigs(8) + +[Timer] +OnCalendar=*-*-* *:45:00 diff --git a/app-antivirus/clamav-unofficial-sigs/metadata.xml b/app-antivirus/clamav-unofficial-sigs/metadata.xml index cb13edbbb596..828e566ffcab 100644 --- a/app-antivirus/clamav-unofficial-sigs/metadata.xml +++ b/app-antivirus/clamav-unofficial-sigs/metadata.xml @@ -4,6 +4,14 @@ mjo@gentoo.org + + + Install an hourly cron job to /etc/cron.d that runs the + updates as the clamav user (instead of root), with an + appropriate home directory and shell. The same cron job + is installed as documentation when this flag is disabled. + + unofficial-sigs extremeshok/clamav-unofficial-sigs -- cgit v1.2.3