public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/fangfrisch/, app-antivirus/fangfrisch/files/
@ 2020-03-07 21:48 Andreas K. Hüttel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas K. Hüttel @ 2020-03-07 21:48 UTC (permalink / raw
  To: gentoo-commits

commit:     5ac8bf8b6356551985345cb3881a191433b1716e
Author:     Ralph Seichter <github <AT> seichter <DOT> de>
AuthorDate: Sat Feb 22 13:19:52 2020 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Mar  7 21:47:40 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ac8bf8b

app-antivirus/fangfrisch: New package

Update and verify unofficial Clam Anti-Virus signatures.
Designed as a secure and easy-to-configure replacement for
clamav-unofficial-sigs.

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
Closes: https://github.com/gentoo/gentoo/pull/14740
Signed-off-by: Andreas K. Huettel <dilfridge <AT> gentoo.org>

 app-antivirus/fangfrisch/Manifest                |  1 +
 app-antivirus/fangfrisch/fangfrisch-1.0.1.ebuild | 47 ++++++++++++++++++++++++
 app-antivirus/fangfrisch/files/fangfrisch.conf   | 22 +++++++++++
 app-antivirus/fangfrisch/files/fangfrisch.cron   |  4 ++
 app-antivirus/fangfrisch/metadata.xml            | 23 ++++++++++++
 5 files changed, 97 insertions(+)

diff --git a/app-antivirus/fangfrisch/Manifest b/app-antivirus/fangfrisch/Manifest
new file mode 100644
index 00000000000..1986a4e4749
--- /dev/null
+++ b/app-antivirus/fangfrisch/Manifest
@@ -0,0 +1 @@
+DIST fangfrisch-1.0.1.tar.gz 93770 BLAKE2B 00334a8ede062a6cb62305b3881eb520ab13a1acb77e1adf9f5c3158b73760f2867e9326d1985b8eeba89232c7af5a7841f42e27a389d2eb7c4226d964b5a416 SHA512 c1ec85f58a24ccbce701cd7695a94ed0fadadae8cd384590fa801003b6f77417f95e9656a51c59f09ca30589f855c2a5a03f8445e689c3ba8b39a044b0c38d98

diff --git a/app-antivirus/fangfrisch/fangfrisch-1.0.1.ebuild b/app-antivirus/fangfrisch/fangfrisch-1.0.1.ebuild
new file mode 100644
index 00000000000..3348a1f01ef
--- /dev/null
+++ b/app-antivirus/fangfrisch/fangfrisch-1.0.1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python3_{7,8} )
+
+inherit distutils-r1 readme.gentoo-r1
+
+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"
+DOC_CONTENTS="
+Before enabling /etc/cron.d/${PN} you need to configure Fangfrisch and
+manually run the 'initdb' command once.
+
+See https://rseichter.github.io/fangfrisch/ for more information.
+"
+
+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}]"
+RDEPEND="${DEPEND}"
+
+distutils_enable_tests unittest
+
+python_prepare_all() {
+	sed -i -e '/SQLAlchemy/d' setup.py || die
+	distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+	insinto /etc
+	doins "${FILESDIR}/${PN}.conf"
+	insinto /etc/cron.d
+	newins "${FILESDIR}/${PN}.cron" ${PN}
+	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.conf b/app-antivirus/fangfrisch/files/fangfrisch.conf
new file mode 100644
index 00000000000..d1641f56540
--- /dev/null
+++ b/app-antivirus/fangfrisch/files/fangfrisch.conf
@@ -0,0 +1,22 @@
+# See https://rseichter.github.io/fangfrisch/ for detailed documentation
+
+[DEFAULT]
+db_url = sqlite:////var/lib/fangfrisch/db.sqlite
+local_directory = /var/lib/clamav
+on_update_exec = clamdscan --reload
+
+[malwarepatrol]
+enabled = yes
+# Replace with your personal Malwarepatrol receipt
+receipt = abcd1234
+
+[sanesecurity]
+enabled = yes
+
+[securiteinfo]
+enabled = yes
+# Replace with your personal SecuriteInfo customer ID
+customer_id = abcdef123456
+
+[urlhaus]
+enabled = yes

diff --git a/app-antivirus/fangfrisch/files/fangfrisch.cron b/app-antivirus/fangfrisch/files/fangfrisch.cron
new file mode 100644
index 00000000000..55595c8e20c
--- /dev/null
+++ b/app-antivirus/fangfrisch/files/fangfrisch.cron
@@ -0,0 +1,4 @@
+# HOME=/var/lib/fangfrisch
+# LOG_LEVEL=WARNING
+# minute hour day-of-month month day-of-week user command
+# */10 * * * * clamav fangfrisch -c /etc/fangfrisch.conf refresh

diff --git a/app-antivirus/fangfrisch/metadata.xml b/app-antivirus/fangfrisch/metadata.xml
new file mode 100644
index 00000000000..86c7e98f50e
--- /dev/null
+++ b/app-antivirus/fangfrisch/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://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>
+	<longdescription lang="en">
+		Fangfrisch (German for "freshly caught") is a sibling of the
+		Clam Anti-Virus freshclam utility. It allows downloading virus
+		definition files that are not official ClamAV canon, e.g. from
+		Sanesecurity, URLhaus and others. Fangfrisch was designed with
+		security in mind, to be run by an unprivileged user only.
+	</longdescription>
+	<upstream>
+		<remote-id type="github">rseichter/fangfrisch</remote-id>
+		<remote-id type="pypi">fangfrisch</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-antivirus/fangfrisch/, app-antivirus/fangfrisch/files/
@ 2022-03-08 13:18 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2022-03-08 13:18 UTC (permalink / raw
  To: gentoo-commits

commit:     fc53bc2a3e6c00e77e9c313752bcda26eb99a5e6
Author:     Ralph Seichter <github <AT> seichter <DOT> de>
AuthorDate: Mon Mar  7 19:03:48 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar  8 13:17:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc53bc2a

app-antivirus/fangfrisch: Add systemd unit files

Ebuild now includes a systemd service and timer.

Closes: https://bugs.gentoo.org/834697
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
Closes: https://github.com/gentoo/gentoo/pull/24442
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../fangfrisch/fangfrisch-1.5.0-r1.ebuild          | 71 ++++++++++++++++++++++
 app-antivirus/fangfrisch/files/fangfrisch.service  | 14 +++++
 app-antivirus/fangfrisch/files/fangfrisch.timer    | 12 ++++
 3 files changed, 97 insertions(+)

diff --git a/app-antivirus/fangfrisch/fangfrisch-1.5.0-r1.ebuild b/app-antivirus/fangfrisch/fangfrisch-1.5.0-r1.ebuild
new file mode 100644
index 000000000000..7f825da973c9
--- /dev/null
+++ b/app-antivirus/fangfrisch/fangfrisch-1.5.0-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8,9,10} )
+
+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"
+
+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.
+
+### Alternative: Updating from release 1.0.1:
+
+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.3.11[${PYTHON_USEDEP}]"
+RDEPEND="${DEPEND}"
+
+python_prepare_all() {
+	sed -i -e '/SQLAlchemy/d' setup.py || die
+	# Due to the nature of Fangfrisch, most tests require network
+	# connectivity and/or access keys to download signature files.
+	# Also, my own 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.	--RS
+	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
+}
+
+pkg_postinst() {
+	FORCE_PRINT_ELOG=1 readme.gentoo_print_elog
+}

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-08 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08 13:18 [gentoo-commits] repo/gentoo:master commit in: app-antivirus/fangfrisch/, app-antivirus/fangfrisch/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2020-03-07 21:48 Andreas K. Hüttel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox