summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Seichter <github@seichter.de>2019-12-12 23:14:45 +0100
committerJoonas Niilola <juippis@gentoo.org>2019-12-21 17:06:25 +0200
commitbedc1e25d4210aaa580c3068193c7369f58059bc (patch)
tree45bb550480df90871702239c693a16af25a352fa /mail-filter/milter-regex
parentacct-user/milter-regex: new user 438 (diff)
downloadgentoo-bedc1e25d4210aaa580c3068193c7369f58059bc.tar.gz
gentoo-bedc1e25d4210aaa580c3068193c7369f58059bc.tar.bz2
gentoo-bedc1e25d4210aaa580c3068193c7369f58059bc.zip
mail-filter/milter-regex: Bump to version 2.7
The new version implements a "-t" command line option, allowing configuration files being tested for correctness before launch. This new feature is now used in the init.d file. The ebuild no longer relies on user.eclass but uses a acct-user dependency, as per GLEP81. Package-Manager: Portage-2.3.79, Repoman-2.3.16 Signed-off-by: Ralph Seichter <gentoo@seichter.de> Closes: https://github.com/gentoo/gentoo/pull/13964 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'mail-filter/milter-regex')
-rw-r--r--mail-filter/milter-regex/Manifest1
-rw-r--r--mail-filter/milter-regex/files/milter-regex-init31
-rw-r--r--mail-filter/milter-regex/milter-regex-2.7.ebuild46
3 files changed, 78 insertions, 0 deletions
diff --git a/mail-filter/milter-regex/Manifest b/mail-filter/milter-regex/Manifest
index 3858d0ac6d16..9c6e95abdebf 100644
--- a/mail-filter/milter-regex/Manifest
+++ b/mail-filter/milter-regex/Manifest
@@ -1 +1,2 @@
DIST milter-regex-2.6.tar.gz 20517 BLAKE2B d98587146010d60a062833d8529af2788d657141e19c249e97bf5c847ffa01d6c76f42b6c8413f957fbeb9843ad38281ba8257aef10d0f1bd414726c416533da SHA512 33afa9a314ff2a2f14a301a85fa142e6e4166ffb77e8d18632b094c7873397e037ee6c5d3d1c248bfbb23037c45a15f21fb0cebcbb0f90c69b3d985aad37f169
+DIST milter-regex-2.7.tar.gz 20579 BLAKE2B e48c5747537d439372d8f473d9b39e337501c24b46d52e13f727b32ee29bb58f266e45ecabad01937f5e56a4a773659daf34d12c6728b6700679b04a2cb595d0 SHA512 d698a7c35768846bcc87a31167cf9a5c41c99d8fa3f3cb5c231e100a7e149d9bca6fc689ece805bd80688787b6d3fa0d9ace49592e1d6c53a25fc2086ebf9962
diff --git a/mail-filter/milter-regex/files/milter-regex-init b/mail-filter/milter-regex/files/milter-regex-init
new file mode 100644
index 000000000000..d20b6fa8a30c
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-init
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/usr/bin/milter-regex"
+command_args="-c ${MR_CONF} -r ${pidfile} -u ${MR_USER} -p ${MR_SOCKET} -P ${MR_PERM} -U ${MR_USER} -G ${MR_GROUP} ${MR_OPTS}"
+extra_commands="configtest"
+description_configtest="Test configuration file correctness."
+
+depend() {
+ before mta
+}
+
+configtest() {
+ ebegin "Checking configuration file ${MR_CONF}"
+ ${command} -d -t -c "${MR_CONF}" || eend "Configuration errors found"
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ checkpath --directory --mode 0755 --owner ${MR_USER}:${MR_GROUP} ${MR_RUNDIR}
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}
diff --git a/mail-filter/milter-regex/milter-regex-2.7.ebuild b/mail-filter/milter-regex/milter-regex-2.7.ebuild
new file mode 100644
index 000000000000..8576fdf270f3
--- /dev/null
+++ b/mail-filter/milter-regex/milter-regex-2.7.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="A milter-based regular expression filter"
+HOMEPAGE="https://www.benzedrine.ch/milter-regex.html"
+SRC_URI="https://www.benzedrine.ch/${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="acct-user/milter-regex
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+DEPEND="${RDEPEND}
+ virtual/yacc"
+
+src_prepare() {
+ eapply "${FILESDIR}/${PN}-2.6-gentoo.patch"
+ eapply_user
+ # Change default user
+ sed -i -e 's/_\(milter-regex\)/\1/g' ${PN}.[8c]
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" -f Makefile.linux all
+}
+
+src_install() {
+ dobin ${PN}
+ insinto /etc
+ newins rules ${PN}.conf
+ newconfd "${FILESDIR}/${PN}-conf-2.6" ${PN}
+ newinitd "${FILESDIR}/${PN}-init" ${PN}
+ doman *.8
+}
+
+pkg_postinst() {
+ elog "Postfix configuration example (add to main.cf or master.cf):"
+ elog " smtpd_milters=unix:/run/milter-regex/socket"
+ elog "Sendmail configuration example:"
+ elog " INPUT_MAIL_FILTER(\`${PN}',\`S=unix:/run/milter-regex/socket,T=S:30s;R:2m')"
+}