summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-antivirus/fangfrisch')
-rw-r--r--app-antivirus/fangfrisch/Manifest3
-rw-r--r--app-antivirus/fangfrisch/fangfrisch-1.6.1.ebuild (renamed from app-antivirus/fangfrisch/fangfrisch-1.2.0-r1.ebuild)38
-rw-r--r--app-antivirus/fangfrisch/fangfrisch-1.9.0.ebuild78
-rw-r--r--app-antivirus/fangfrisch/files/fangfrisch-has-news.sh82
-rw-r--r--app-antivirus/fangfrisch/files/fangfrisch.conf7
-rw-r--r--app-antivirus/fangfrisch/files/fangfrisch.service14
-rw-r--r--app-antivirus/fangfrisch/files/fangfrisch.timer12
-rw-r--r--app-antivirus/fangfrisch/metadata.xml12
8 files changed, 221 insertions, 25 deletions
diff --git a/app-antivirus/fangfrisch/Manifest b/app-antivirus/fangfrisch/Manifest
index 45c9e0c1f8b6..f4f50ec94210 100644
--- a/app-antivirus/fangfrisch/Manifest
+++ b/app-antivirus/fangfrisch/Manifest
@@ -1 +1,2 @@
-DIST fangfrisch-1.2.0.tar.gz 113088 BLAKE2B 9fb5f4b838e6337128c9e988f5749864cadacb74c9e3006f29cf8b976592af88c00ff5359cd70e4d6901e24cfc01b061861b7b1a563a82d66b2d71c970627c26 SHA512 6f6c0cfc4d840f99186c83e6109c6234ff5bfb44e19bcd3309056347392e46da56e17106259508864b05397d39ea92500ab6863b50d55efc790d88b59f88ee3b
+DIST fangfrisch-1.6.1.gh.tar.gz 113497 BLAKE2B a37b5b29b31a1d0166112b8939e691acc1721a91bda9e364a90c0c8d4ea7b7d3e1a24b8849c9ef4f0632996ed7bbdfc7985ab04c44c8ca4d57df21294867fd32 SHA512 a16b39b6520d80f69c561bc2d56fef28acaca35a9da214be920cdd907f76d3d6674ed4aa1290ad11a9364ede11472594d7e331ecd21924fe23e005ef9501d4ac
+DIST fangfrisch-1.9.0.gh.tar.gz 127572 BLAKE2B c05c68f904a6e7c7d9f9c5b82bb63366f86653cd13a94276108f52e9c523280320c8aa55ba94ecf079ba938a77e11ca7dc557f4c8fd1b1c7f37179c087dd8605 SHA512 08cc36f20884fedb553de905b8faafce99fcef80e3bce7c0b264691b1a8d83b91a582c095b684f6f7a6af77fd4ed0405fa771a74bbeee3f1b255ff74a161d37e
diff --git a/app-antivirus/fangfrisch/fangfrisch-1.2.0-r1.ebuild b/app-antivirus/fangfrisch/fangfrisch-1.6.1.ebuild
index 08c54e83ab3f..fae2bf0d0915 100644
--- a/app-antivirus/fangfrisch/fangfrisch-1.2.0-r1.ebuild
+++ b/app-antivirus/fangfrisch/fangfrisch-1.6.1.ebuild
@@ -1,16 +1,16 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-DISTUTILS_USE_SETUPTOOLS=rdepend
-PYTHON_COMPAT=( python3_{7,8} )
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
-inherit distutils-r1 readme.gentoo-r1
+inherit distutils-r1 readme.gentoo-r1 systemd
DESCRIPTION="Update and verify unofficial Clam Anti-Virus signatures"
HOMEPAGE="https://github.com/rseichter/fangfrisch https://pypi.org/project/fangfrisch/"
-SRC_URI="https://github.com/rseichter/fangfrisch/archive/${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI="https://github.com/rseichter/fangfrisch/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
MY_CONF="/etc/${PN}.conf"
MY_DBDIR="/var/lib/${PN}"
@@ -39,28 +39,36 @@ LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="amd64 x86"
-DEPEND=">=dev-python/requests-2.22.0[${PYTHON_USEDEP}]
- >=dev-python/sqlalchemy-1.3.11[${PYTHON_USEDEP}]"
+# Due to the nature of Fangfrisch, most tests require network
+# connectivity and/or access keys to download signature files.
+PROPERTIES="test_network"
+RESTRICT="test"
+
+DEPEND="
+ >=dev-python/requests-2.22.0[${PYTHON_USEDEP}]
+ >=dev-python/sqlalchemy-1.4.0[${PYTHON_USEDEP}]
+"
RDEPEND="${DEPEND}"
+distutils_enable_tests unittest
+
python_prepare_all() {
sed -i -e '/SQLAlchemy/d' setup.py || die
- # Due to the nature of Fangfrisch, most tests require network
- # connectivity. Upstream CI reports show that the tests are
- # successful, so instead of a pick-and-choose approach, the
- # complete tests directory is removed in this ebuild.
- if [ -d tests ]; then
- rm -r tests || die
- fi
distutils-r1_python_prepare_all
}
python_install_all() {
insinto /etc
doins "${FILESDIR}/${PN}.conf"
+
insinto /etc/cron.d
newins "${FILESDIR}/${PN}.cron" ${PN}
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_dounit "${FILESDIR}/${PN}.timer"
+
distutils-r1_python_install_all
+
readme.gentoo_create_doc
}
diff --git a/app-antivirus/fangfrisch/fangfrisch-1.9.0.ebuild b/app-antivirus/fangfrisch/fangfrisch-1.9.0.ebuild
new file mode 100644
index 000000000000..195bbaa8f563
--- /dev/null
+++ b/app-antivirus/fangfrisch/fangfrisch-1.9.0.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1 readme.gentoo-r1 systemd
+
+DESCRIPTION="Update and verify unofficial Clam Anti-Virus signatures"
+HOMEPAGE="https://github.com/rseichter/fangfrisch https://pypi.org/project/fangfrisch/"
+SRC_URI="https://github.com/rseichter/fangfrisch/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+MY_CONF="/etc/${PN}.conf"
+MY_DBDIR="/var/lib/${PN}"
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS="See https://rseichter.github.io/fangfrisch/ for the official
+documentation.
+
+### Fresh installations:
+
+Modify ${MY_CONF} according to your preferences.
+Assuming you place the database into ${MY_DBDIR}
+(recommended), execute the following commands in a root shell:
+
+mkdir -m 0770 ${MY_DBDIR}
+chgrp clamav ${MY_DBDIR}
+sudo -u clamav -- fangfrisch -c ${MY_CONF} initdb
+
+You can now enable /etc/cron.d/${PN} for periodic updates.
+
+### Updating from a previous release:
+
+Either create a fresh database or manually delete all existing
+database tables, then run the initdb command as shown above."
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+DEPEND="
+ >=dev-python/requests-2.22.0[${PYTHON_USEDEP}]
+ >=dev-python/sqlalchemy-1.4.0[${PYTHON_USEDEP}]
+"
+RDEPEND="${DEPEND}"
+
+distutils_enable_tests unittest
+
+python_prepare_all() {
+ sed -i -e '/SQLAlchemy/d' setup.cfg || die
+ # Mitigate build system warnings, see
+ # https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages
+ cat >>setup.cfg <<EOT
+[options.packages.find]
+exclude =
+ tests
+ tests.*
+EOT
+ distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+ insinto /etc
+ doins "${FILESDIR}/${PN}.conf"
+ insinto /etc/cron.d
+ newins "${FILESDIR}/${PN}.cron" "${PN}"
+ exeinto /etc
+ doexe "${FILESDIR}/${PN}-has-news.sh"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_dounit "${FILESDIR}/${PN}.timer"
+ distutils-r1_python_install_all
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ FORCE_PRINT_ELOG=1 readme.gentoo_print_elog
+}
diff --git a/app-antivirus/fangfrisch/files/fangfrisch-has-news.sh b/app-antivirus/fangfrisch/files/fangfrisch-has-news.sh
new file mode 100644
index 000000000000..7a018d911d32
--- /dev/null
+++ b/app-antivirus/fangfrisch/files/fangfrisch-has-news.sh
@@ -0,0 +1,82 @@
+#!/usr/bin/env bash
+# vim: ts=4 sw=4 noet ft=sh
+#
+# Example script to process Fangfrisch News.
+
+declare -r MAILFROM="noreply"
+declare -r MAILTO="alice@example.com"
+declare -r SUBJECT="Fangfrisch News are available"
+
+# Pick one of the following options and uncomment the 'declare'
+# statements. Otherwise, the script will not run otherwise.
+
+# Option 1: Mutt
+#declare -r MAILAPP="mutt"
+#declare -r MAILAPP_OPT=( "-s" "$SUBJECT" "$MAILTO" )
+
+# Option 2: sendmail
+#declare -r MAILAPP="sendmail"
+#declare -r MAILAPP_OPT=( "-t" )
+#export PATH="$PATH:/usr/sbin"
+
+# Option 3: swaks
+#declare -r MAILAPP="swaks"
+#declare -r MAILAPP_OPT=( "-d" "-" "-f" "$MAILFROM" "-t" "$MAILTO" )
+
+### No changes required below this line ###
+
+set -euo pipefail
+
+die() {
+ echo >&2 "$@"
+ exit 1
+}
+
+usage() {
+ die "Usage: $(basename "$0") {directory}"
+}
+
+gen_header() {
+ cat <<EOT
+From: Fangfrisch News <$MAILFROM>
+To: $MAILTO
+Subject: $SUBJECT
+
+EOT
+# Mail header must end with an empty line!
+}
+
+declare -a NEWSITEMS=()
+
+report_news() {
+ local dir=$1 ni
+ [ -d "$dir" ] || die "$dir is not a directory"
+ while IFS= read -r -d '' ni; do
+ if [ ${#NEWSITEMS[*]} -eq 0 ] && [ "$MAILAPP" != mutt ]; then
+ # Mutt does not need the header, others do.
+ gen_header
+ fi
+ NEWSITEMS+=( "$ni" )
+ echo -e "\n### $(basename "$ni"):\n"
+ cat "$ni"
+ done < <(find "$dir" -maxdepth 1 -type f -name "fangfrisch*.txt" -print0)
+}
+
+main() {
+ local t
+ [ -n "$MAILAPP" ] || die "MAILAPP is undefined, exiting."
+ if tty -s; then
+ # Running in a terminal session
+ t=$(mktemp)
+ # shellcheck disable=SC2064
+ trap "rm $t" EXIT
+ report_news "$@" | tee "$t" || exit 1
+ [ ! -s "$t" ] || "$MAILAPP" "${MAILAPP_OPT[@]}" >/dev/null <"$t"
+ else
+ report_news "$@" 2>&1 | "$MAILAPP" "${MAILAPP_OPT[@]}" >/dev/null
+ [ ${#NEWSITEMS[*]} -eq 0 ] || rm -v "${NEWSITEMS[@]}"
+ fi
+}
+
+[ $# -ge 1 ] || usage
+main "$@"
diff --git a/app-antivirus/fangfrisch/files/fangfrisch.conf b/app-antivirus/fangfrisch/files/fangfrisch.conf
index ded86b9cc981..0fbc71ec16dc 100644
--- a/app-antivirus/fangfrisch/files/fangfrisch.conf
+++ b/app-antivirus/fangfrisch/files/fangfrisch.conf
@@ -7,6 +7,13 @@ log_method = syslog
log_target = /dev/log
on_update_exec = clamdscan --reload
+[fangfrischnews]
+enabled = yes
+# Uncomment/adapt the following to trigger a script in case of news.
+# The bundled example script needs to be manually modified before
+# it can be used!
+# script = /etc/fangfrisch-has-news.sh
+
[malwarepatrol]
enabled = yes
# Replace with your personal Malwarepatrol receipt
diff --git a/app-antivirus/fangfrisch/files/fangfrisch.service b/app-antivirus/fangfrisch/files/fangfrisch.service
new file mode 100644
index 000000000000..5b22decaa627
--- /dev/null
+++ b/app-antivirus/fangfrisch/files/fangfrisch.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Download unofficial ClamAV virus definition files
+ConditionPathExists=/var/lib/fangfrisch/db.sqlite
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+Type=simple
+User=clamav
+WorkingDirectory=/var/lib/fangfrisch
+ExecStart=/usr/bin/fangfrisch -c /etc/fangfrisch.conf refresh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-antivirus/fangfrisch/files/fangfrisch.timer b/app-antivirus/fangfrisch/files/fangfrisch.timer
new file mode 100644
index 000000000000..c63323e3c7d4
--- /dev/null
+++ b/app-antivirus/fangfrisch/files/fangfrisch.timer
@@ -0,0 +1,12 @@
+[Unit]
+Description=Periodically run Fangfrisch
+Requires=fangfrisch.service
+
+[Timer]
+OnCalendar=*:00,10,20,30,40,50
+Persistent=true
+RandomizedDelaySec=10s
+Unit=fangfrisch.service
+
+[Install]
+WantedBy=timers.target
diff --git a/app-antivirus/fangfrisch/metadata.xml b/app-antivirus/fangfrisch/metadata.xml
index 86c7e98f50ea..231538b21f77 100644
--- a/app-antivirus/fangfrisch/metadata.xml
+++ b/app-antivirus/fangfrisch/metadata.xml
@@ -1,14 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="person">
- <email>gentoo@seichter.de</email>
- <name>Ralph Seichter</name>
- </maintainer>
- <maintainer type="person">
- <email>dilfridge@gentoo.org</email>
- <name>Andreas K. Huettel</name>
- </maintainer>
+ <!-- maintainer-needed -->
<longdescription lang="en">
Fangfrisch (German for "freshly caught") is a sibling of the
Clam Anti-Virus freshclam utility. It allows downloading virus
@@ -16,6 +9,7 @@
Sanesecurity, URLhaus and others. Fangfrisch was designed with
security in mind, to be run by an unprivileged user only.
</longdescription>
+ <stabilize-allarches/>
<upstream>
<remote-id type="github">rseichter/fangfrisch</remote-id>
<remote-id type="pypi">fangfrisch</remote-id>