public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/files/, mail-filter/rspamd/
Date: Wed, 16 Jan 2019 03:15:51 +0000 (UTC)	[thread overview]
Message-ID: <1547608544.c334938edc52f23ed95834e3b8a658f2e76c53cb.whissi@gentoo> (raw)

commit:     c334938edc52f23ed95834e3b8a658f2e76c53cb
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 16 03:15:11 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Jan 16 03:15:44 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c334938e

mail-filter/rspamd: bump to v1.8.3

- runscript rewritten

- username used in systemd unit adjusted for Gentoo

- priv escalation via PID file fixed

- dev-util/ragel version constraint removed (package
  is now compatible with ragel-7)

Closes: https://github.com/gentoo/gentoo/pull/10598
Closes: https://github.com/gentoo/gentoo/pull/10561
Closes: https://github.com/gentoo/gentoo/pull/10057
Package-Manager: Portage-2.3.56, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 mail-filter/rspamd/Manifest                        |  1 +
 mail-filter/rspamd/files/rspamd-r1.logrotate       | 16 +++++++
 mail-filter/rspamd/files/rspamd-r6.init            | 55 ++++++++++++++++++++++
 mail-filter/rspamd/files/rspamd.conf               | 26 ++++++++++
 mail-filter/rspamd/files/rspamd.tmpfile            |  1 +
 .../{rspamd-9999.ebuild => rspamd-1.8.3.ebuild}    | 55 +++++++++++++---------
 mail-filter/rspamd/rspamd-9999.ebuild              | 55 +++++++++++++---------
 7 files changed, 165 insertions(+), 44 deletions(-)

diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest
index 2223d7172bb..d45c6ec491a 100644
--- a/mail-filter/rspamd/Manifest
+++ b/mail-filter/rspamd/Manifest
@@ -7,3 +7,4 @@ DIST rspamd-1.7.7.tar.gz 4534430 BLAKE2B 83ba39b80293bf87f397e6b1b1cbec27e7c44f0
 DIST rspamd-1.7.8.tar.gz 4542955 BLAKE2B 78fbb01c51d290f8d88f4c512df248fcbc8e28e00a820ba0d3dc22adf4bb1b54b1923aa5306fde5d4d75c81a9304f220608a6cec3f1077bbb9adfa1ea8bdc2a4 SHA512 43f2350dfa4e0369cd53480bd4c8d0aa3898d7c471540281e7460a264207032aea226c4fd519a26397b9e9e8c8de3951e5a9752e010eabf1b3733a0c3e3086c2
 DIST rspamd-1.7.9.tar.gz 4557492 BLAKE2B f42775ba8157ef4815331c304e3030c522e9ae5e10ef0194da0c7dde105b40fed2ae84b063d78aed37992146311aecc1ac77f64dacdaf3ff11bb85076e8aef7c SHA512 d11d8c03668b85feae665ed491cd156c7430fbad30f42fe44103ea3c3a8bc988e5f8981e784e8f31aa35ba1ff9f7abd23605638e4ee3086a056b22fb3109563e
 DIST rspamd-1.8.1.tar.gz 4286637 BLAKE2B dd202a2f3dab4ef459d978e06231f8fcef3724ea5912c7455d553dc04e2744322b9144ba05a2f6f22a7eb58cd0a967f213bfc76fb273b5425036a5042975ed89 SHA512 98c2d909b7dc19f1c431d4e64444968092a10630ef238d3c8cc2825e7b2d92bee893bc7f9c431f3a6337ef2af4d2a157f0584e7b13fba0540660d7c853bc25cc
+DIST rspamd-1.8.3.tar.gz 4319623 BLAKE2B b7fdd6791df5899710bb1d696a9b94d1840335b6a34d6cdeebc2b5eebe9f4e5b6da3e90ed9ab5e3945aab7ef33f54f048024b51c3de37db1a083ad89c656b456 SHA512 5e20255466fe2cd4842196fb2138732b59911de655e73d9cc13009b5179b84e5a2060083961b35fe40b9f550f8e18067056415a1d803fac54fac000070024c01

diff --git a/mail-filter/rspamd/files/rspamd-r1.logrotate b/mail-filter/rspamd/files/rspamd-r1.logrotate
new file mode 100644
index 00000000000..5cb2fdd55e0
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-r1.logrotate
@@ -0,0 +1,16 @@
+/var/log/rspamd/rspamd.log {
+	daily
+	rotate 4
+	delaycompress
+	compress
+	notifempty
+	missingok
+	postrotate
+		if test -d /run/systemd/system ; then
+			systemctl kill -s USR1 --kill-who=main rspamd.service
+		else
+			test -r /run/rspamd.pid && kill -USR1 $(cat /run/rspamd.pid) &>/dev/null
+		fi
+	endscript
+}
+

diff --git a/mail-filter/rspamd/files/rspamd-r6.init b/mail-filter/rspamd/files/rspamd-r6.init
new file mode 100644
index 00000000000..8c31fd7d027
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-r6.init
@@ -0,0 +1,55 @@
+#!/sbin/openrc-run
+# Copyright 2015-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+RSPAMD_CONFIGFILE=${RSPAMD_CONFIGFILE:-"/etc/rspamd/rspamd.conf"}
+RSPAMD_GROUP=${RSPAMD_GROUP:-rspamd}
+RSPAMD_OPTS=${RSPAMD_OPTS:-""}
+RSPAMD_PIDFILE=${RSPAMD_PIDFILE:-"/run/rspamd.pid"}
+RSPAMD_USER=${RSPAMD_USER:-rspamd}
+
+command="/usr/bin/rspamd"
+command_args="${RSPAMD_OPTS} -c \"${RSPAMD_CONFIGFILE}\" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} --pid \"${RSPAMD_PIDFILE}\""
+start_stop_daemon_args=${RSPAMD_SSDARGS:-"--wait 1000"}
+pidfile="${RSPAMD_PIDFILE}"
+retry=${RSPAMD_TERMTIMEOUT:-"TERM/60/KILL/5"}
+
+required_files="${RSPAMD_CONFIGFILE}"
+
+description="Rapid spam filtering system"
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+description_checkconfig="Validate rspamd's configuration"
+description_reload="Sends rspamd a signal to reload its configuration"
+
+depend() {
+	before mta
+	use dns redis
+}
+
+checkconfig() {
+	${command} -c "${RSPAMD_CONFIGFILE}" -u ${RSPAMD_USER} -g ${RSPAMD_GROUP} -t 1>/dev/null \
+		|| return 1
+}
+
+reload() {
+	checkconfig || return 1
+
+	ebegin "Reloading ${SVCNAME}"
+	start-stop-daemon --signal HUP --pidfile "${pidfile}"
+	eend $?
+}
+
+start_pre() {
+	if [ "${RC_CMD}" != "restart" ]; then
+		checkconfig || return 1
+	fi
+}
+
+stop_pre() {
+	if [ "${RC_CMD}" = "restart" ]; then
+		checkconfig || return 1
+	fi
+}

diff --git a/mail-filter/rspamd/files/rspamd.conf b/mail-filter/rspamd/files/rspamd.conf
new file mode 100644
index 00000000000..f3a65cbb20a
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd.conf
@@ -0,0 +1,26 @@
+# /etc/conf.d/rspamd
+
+# Configuration file
+#RSPAMD_CONFIGFILE="/etc/rsyslog.conf"
+
+# PID file
+# If you should ever change this, remember to update
+# "/etc/logrotate.d/rspamd", too.
+#RSPAMD_PIDFILE="/run/rspamd.pid"
+
+# You can use this configuration option to pass additional options to the
+# start-stop-daemon, see start-stop-daemon(8) for more details.
+# Per default we wait 1000ms after we have started the service to ensure
+# that the daemon is really up and running.
+#RSPAMD_SSDARGS="--wait 1000"
+
+# The termination timeout (start-stop-daemon parameter "retry") ensures
+# that the service will be terminated within a given time (60 + 5 seconds
+# per default) when you are stopping the service.
+#RSPAMD_TERMTIMEOUT="TERM/60/KILL/5"
+
+# Options to rspamd
+# See rspamd(8) for more details
+# Notes:
+# * Do not specify another CONFIGFILE but use the variable above to change the location
+#RSPAMD_OPTS=""

diff --git a/mail-filter/rspamd/files/rspamd.tmpfile b/mail-filter/rspamd/files/rspamd.tmpfile
new file mode 100644
index 00000000000..9f7a2c46c31
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd.tmpfile
@@ -0,0 +1 @@
+d /run/rspamd 0755 rspamd rspamd

diff --git a/mail-filter/rspamd/rspamd-9999.ebuild b/mail-filter/rspamd/rspamd-1.8.3.ebuild
similarity index 72%
copy from mail-filter/rspamd/rspamd-9999.ebuild
copy to mail-filter/rspamd/rspamd-1.8.3.ebuild
index 40d3b529082..64cb537424f 100644
--- a/mail-filter/rspamd/rspamd-9999.ebuild
+++ b/mail-filter/rspamd/rspamd-1.8.3.ebuild
@@ -1,26 +1,20 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
-if [[ ${PV} == *9999 ]] ; then
-	SCM="git-r3"
-	EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
-fi
-
-inherit cmake-utils pax-utils systemd user ${SCM}
-
-DESCRIPTION="Rapid spam filtering system"
-HOMEPAGE="https://github.com/vstakhov/rspamd"
+inherit cmake-utils pax-utils systemd tmpfiles user
 
 if [[ ${PV} == *9999 ]] ; then
-	SRC_URI=""
-	KEYWORDS=""
+	EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
+	inherit git-r3
 else
 	SRC_URI="https://github.com/vstakhov/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz"
 	KEYWORDS="~amd64 ~x86"
 fi
 
+DESCRIPTION="Rapid spam filtering system"
+HOMEPAGE="https://github.com/vstakhov/rspamd"
 LICENSE="Apache-2.0"
 SLOT="0"
 IUSE="cpu_flags_x86_ssse3 fann gd jemalloc +jit libressl pcre2 +torch"
@@ -32,7 +26,7 @@ RDEPEND="dev-db/sqlite:3
 	dev-libs/libevent:=
 	net-libs/libnsl
 	sys-apps/file
-	<dev-util/ragel-7.0
+	dev-util/ragel
 	cpu_flags_x86_ssse3? ( dev-libs/hyperscan )
 	fann? ( sci-mathematics/fann )
 	gd? ( media-libs/gd[jpeg] )
@@ -49,6 +43,14 @@ pkg_setup() {
 	enewuser rspamd -1 -1 /var/lib/rspamd rspamd
 }
 
+src_prepare() {
+	cmake-utils_src_prepare
+
+	sed -i -e 's/User=_rspamd/User=rspamd/g' \
+		rspamd.service \
+		|| die
+}
+
 src_configure() {
 	local mycmakeargs=(
 		-DCONFDIR=/etc/rspamd
@@ -66,22 +68,31 @@ src_configure() {
 	cmake-utils_src_configure
 }
 
+src_test() {
+	cmake-utils_src_test
+}
+
 src_install() {
 	cmake-utils_src_install
-	newinitd "${FILESDIR}/rspamd.init-r5" rspamd
+
+	newconfd "${FILESDIR}"/rspamd.conf rspamd
+	newinitd "${FILESDIR}/rspamd-r6.init" rspamd
+	systemd_newunit rspamd.service rspamd.service
+
+	newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf
 
 	# Remove mprotect for JIT support
 	if use jit; then
-		pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-*
+		pax-mark m "${ED%/}"/usr/bin/rspamd-* "${ED%/}"/usr/bin/rspamadm-*
 	fi
 
-	keepdir /var/lib/rspamd
-	keepdir /var/log/rspamd
-
-	fowners rspamd:rspamd /var/lib/rspamd /var/log/rspamd
-
 	insinto /etc/logrotate.d
-	newins "${FILESDIR}/rspamd.logrotate" rspamd
+	newins "${FILESDIR}"/rspamd-r1.logrotate rspamd
 
-	systemd_newunit rspamd.service rspamd.service
+	diropts -o rspamd -g rspamd
+	keepdir /var/{lib,log}/rspamd
+}
+
+pkg_postinst() {
+	tmpfiles_process "${PN}.conf"
 }

diff --git a/mail-filter/rspamd/rspamd-9999.ebuild b/mail-filter/rspamd/rspamd-9999.ebuild
index 40d3b529082..64cb537424f 100644
--- a/mail-filter/rspamd/rspamd-9999.ebuild
+++ b/mail-filter/rspamd/rspamd-9999.ebuild
@@ -1,26 +1,20 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
-if [[ ${PV} == *9999 ]] ; then
-	SCM="git-r3"
-	EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
-fi
-
-inherit cmake-utils pax-utils systemd user ${SCM}
-
-DESCRIPTION="Rapid spam filtering system"
-HOMEPAGE="https://github.com/vstakhov/rspamd"
+inherit cmake-utils pax-utils systemd tmpfiles user
 
 if [[ ${PV} == *9999 ]] ; then
-	SRC_URI=""
-	KEYWORDS=""
+	EGIT_REPO_URI="https://github.com/vstakhov/rspamd.git"
+	inherit git-r3
 else
 	SRC_URI="https://github.com/vstakhov/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz"
 	KEYWORDS="~amd64 ~x86"
 fi
 
+DESCRIPTION="Rapid spam filtering system"
+HOMEPAGE="https://github.com/vstakhov/rspamd"
 LICENSE="Apache-2.0"
 SLOT="0"
 IUSE="cpu_flags_x86_ssse3 fann gd jemalloc +jit libressl pcre2 +torch"
@@ -32,7 +26,7 @@ RDEPEND="dev-db/sqlite:3
 	dev-libs/libevent:=
 	net-libs/libnsl
 	sys-apps/file
-	<dev-util/ragel-7.0
+	dev-util/ragel
 	cpu_flags_x86_ssse3? ( dev-libs/hyperscan )
 	fann? ( sci-mathematics/fann )
 	gd? ( media-libs/gd[jpeg] )
@@ -49,6 +43,14 @@ pkg_setup() {
 	enewuser rspamd -1 -1 /var/lib/rspamd rspamd
 }
 
+src_prepare() {
+	cmake-utils_src_prepare
+
+	sed -i -e 's/User=_rspamd/User=rspamd/g' \
+		rspamd.service \
+		|| die
+}
+
 src_configure() {
 	local mycmakeargs=(
 		-DCONFDIR=/etc/rspamd
@@ -66,22 +68,31 @@ src_configure() {
 	cmake-utils_src_configure
 }
 
+src_test() {
+	cmake-utils_src_test
+}
+
 src_install() {
 	cmake-utils_src_install
-	newinitd "${FILESDIR}/rspamd.init-r5" rspamd
+
+	newconfd "${FILESDIR}"/rspamd.conf rspamd
+	newinitd "${FILESDIR}/rspamd-r6.init" rspamd
+	systemd_newunit rspamd.service rspamd.service
+
+	newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf
 
 	# Remove mprotect for JIT support
 	if use jit; then
-		pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-*
+		pax-mark m "${ED%/}"/usr/bin/rspamd-* "${ED%/}"/usr/bin/rspamadm-*
 	fi
 
-	keepdir /var/lib/rspamd
-	keepdir /var/log/rspamd
-
-	fowners rspamd:rspamd /var/lib/rspamd /var/log/rspamd
-
 	insinto /etc/logrotate.d
-	newins "${FILESDIR}/rspamd.logrotate" rspamd
+	newins "${FILESDIR}"/rspamd-r1.logrotate rspamd
 
-	systemd_newunit rspamd.service rspamd.service
+	diropts -o rspamd -g rspamd
+	keepdir /var/{lib,log}/rspamd
+}
+
+pkg_postinst() {
+	tmpfiles_process "${PN}.conf"
 }


             reply	other threads:[~2019-01-16  3:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16  3:15 Thomas Deutschmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-05-29 10:59 [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/files/, mail-filter/rspamd/ Andreas Sturmlechner
2023-01-26  7:23 Sam James
2022-12-24  8:59 Andreas Sturmlechner
2022-11-06  6:17 Sam James
2021-08-22  2:50 Sam James
2021-01-09 12:33 Sam James
2021-01-09 12:33 Sam James
2021-01-09 12:33 Sam James
2020-11-20 10:12 Joonas Niilola
2020-11-20 10:12 Joonas Niilola
2020-10-07 15:58 Sam James
2020-10-02  7:32 Joonas Niilola
2020-10-02  7:32 Joonas Niilola
2020-04-04  8:06 Joonas Niilola
2018-03-29 13:41 Dirkjan Ochtman
2017-05-05  9:40 Dirkjan Ochtman
2017-01-03 19:00 Dirkjan Ochtman
2016-12-18 15:41 Dirkjan Ochtman
2016-01-30 15:29 Dirkjan Ochtman
2015-12-26 13:21 Dirkjan Ochtman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1547608544.c334938edc52f23ed95834e3b8a658f2e76c53cb.whissi@gentoo \
    --to=whissi@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox