commit:     2dfc2acbfa522a31a773c916822caba20cfe3222
Author:     Guillaume Castagnino <casta <AT> xwing <DOT> info>
AuthorDate: Sun Nov 14 13:01:23 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Nov 24 08:07:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dfc2acb

mail-filter/spampd: bump to 2.61

- add systemd support with gentoo override
- grab patch from Fedora

Note: perl is needed at build (moving from RDEPEND) for manpage
generation (pod2man)

Closes: https://bugs.gentoo.org/761855
Signed-off-by: Guillaume Castagnino <casta <AT> xwing.info>
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Closes: https://github.com/gentoo/gentoo/pull/22947
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 mail-filter/spampd/Manifest                        |  1 +
 mail-filter/spampd/files/init                      |  8 ++--
 .../spampd/files/spampd-2.61-no-pid-file.patch     | 11 ++++++
 mail-filter/spampd/files/spampd.service            | 11 ++++++
 mail-filter/spampd/files/spampd.service.conf       |  5 +++
 mail-filter/spampd/spampd-2.61.ebuild              | 46 ++++++++++++++++++++++
 6 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/mail-filter/spampd/Manifest b/mail-filter/spampd/Manifest
index 5c8eb31c7cee..223906db8157 100644
--- a/mail-filter/spampd/Manifest
+++ b/mail-filter/spampd/Manifest
@@ -1 +1,2 @@
 DIST spampd-2.42.tar.gz 202504 BLAKE2B 
9ad74d3199345ba54c613fa928cfd177fded551ca304dd22c802b996b95e2905d40d92bfa25d7c64b823b2357c657f283c9550b635f3188fbbb42fb793cd2b8d
 SHA512 
5c44b5902efd6c628fb62887b755012b137940d7d687f5d9489e5f96623d6eeca5f3641a76fe3b2ce8585040c3661e19df981c612cdb1a767b4a46fec982fa4e
+DIST spampd-2.61.tar.gz 246956 BLAKE2B 
de2b428fbed80ba6d65bd2b249a3adfb00cd0a33df21b71676da1949b680dbfee72412ae2c752f4e5dcf9f7f7349ae59ce94f81b2abae5fd4de34d3a92954fbb
 SHA512 
e2f84c4b24648d4f4db70174f04b72981faa1c54ffc4bbc433d14c730ef4ad7fd4cd3772a476f25be0bee103e951700d038634d14848f1eb90849d1a6655199b

diff --git a/mail-filter/spampd/files/init b/mail-filter/spampd/files/init
index 7a5171e46034..339a938d9c7d 100644
--- a/mail-filter/spampd/files/init
+++ b/mail-filter/spampd/files/init
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # Note: spampd configuration file is /etc/conf.d/spampd
@@ -10,14 +10,14 @@ depend() {
 
 start() {
        ebegin "Starting spampd"
-       start-stop-daemon --start --quiet \
-               --exec /usr/sbin/spampd -- --pid=/var/run/spampd.pid \
+       start-stop-daemon --start --quiet --interpreted \
+               --exec /usr/sbin/spampd -- --pid=/run/spampd.pid \
                        ${SPAMPD_OPTS}
        eend $? "Failed to start spampd"
 }
 
 stop() {
        ebegin "Stopping spampd"
-       start-stop-daemon --stop --quiet --pidfile /var/run/spampd.pid
+       start-stop-daemon --stop --quiet  --retry 60 --pidfile /run/spampd.pid
        eend $? "Failed to stop spampd"
 }

diff --git a/mail-filter/spampd/files/spampd-2.61-no-pid-file.patch 
b/mail-filter/spampd/files/spampd-2.61-no-pid-file.patch
new file mode 100644
index 000000000000..b5151e11f8a5
--- /dev/null
+++ b/mail-filter/spampd/files/spampd-2.61-no-pid-file.patch
@@ -0,0 +1,11 @@
+diff -ruN spampd-2.61-v/spampd.pl spampd-2.61/spampd.pl
+--- spampd-2.61-v/spampd.pl    2021-08-07 06:01:37.000000000 +1000
++++ spampd-2.61/spampd.pl      2021-08-13 03:48:34.527166029 +1000
+@@ -761,6 +761,7 @@
+ 
+   # Set misc. options based on other options.
+   $srv_p->{setsid}= 0 if !$srv_p->{background};
++  $srv_p->{pid_file} = undef if !$srv_p->{background};
+   $sa_p->{home_dir_for_helpers} = $sa_p->{userstate_dir};
+   $sa_p->{username} = $srv_p->{user};
+ }

diff --git a/mail-filter/spampd/files/spampd.service 
b/mail-filter/spampd/files/spampd.service
new file mode 100644
index 000000000000..78ef5520323c
--- /dev/null
+++ b/mail-filter/spampd/files/spampd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=SpamAssassin Proxy Daemon
+Before=mail-transfer-agent.target
+After=syslog.target network.target
+
+[Service]
+ExecStart=/usr/sbin/spampd --nodetach $SPAMPD_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target

diff --git a/mail-filter/spampd/files/spampd.service.conf 
b/mail-filter/spampd/files/spampd.service.conf
new file mode 100644
index 000000000000..1c2d9c1154e1
--- /dev/null
+++ b/mail-filter/spampd/files/spampd.service.conf
@@ -0,0 +1,5 @@
+[Service]
+User=mail
+Group=mail
+Environment="SPAMPD_OPTS=--host=localhost:10025 --relayhost=localhost:10026 
--tagall --set-envelope-from"
+

diff --git a/mail-filter/spampd/spampd-2.61.ebuild 
b/mail-filter/spampd/spampd-2.61.ebuild
new file mode 100644
index 000000000000..213b260d1f58
--- /dev/null
+++ b/mail-filter/spampd/spampd-2.61.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit systemd
+
+DESCRIPTION="spampd is a program to scan messages for Unsolicited Commercial 
E-mail content"
+HOMEPAGE="http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm";
+SRC_URI="https://github.com/mpaperno/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="acct-group/mail
+       acct-user/mail
+       dev-lang/perl
+       dev-perl/Net-Server
+       mail-filter/spamassassin
+       virtual/perl-IO-Socket-IP"
+DEPEND="${RDEPEND}"
+BDEPEND=""
+
+PATCHES=(
+       "${FILESDIR}/${P}-no-pid-file.patch"
+)
+
+src_compile() {
+       mv ${PN}.pl ${PN}
+       pod2man ${PN}.pod > ${PN}.1
+}
+
+src_install() {
+       dosbin ${PN}
+
+       dodoc changelog.txt
+       doman ${PN}.1
+
+       newinitd "${FILESDIR}"/init spampd
+       newconfd "${FILESDIR}"/conf spampd
+
+       systemd_dounit "${FILESDIR}/${PN}.service"
+       systemd_install_serviced "${FILESDIR}/${PN}.service.conf"
+}

Reply via email to