mail-filter/milter-regex: Replacement for outdated ebuild

This is a replacement for the milter-regex 1.9 ebuild. Version
1.9 was released seven years ago, and the old ebuild was based
on EAPI 4. The new ebuild for milter-regex 2.2 (released a few
days ago) uses EAPI 7.

Bug: https://bugs.gentoo.org/666758
Package-Manager: Portage-2.3.49, Repoman-2.3.10
Signed-off-by: Ralph Seichter <gentoo@seichter.de>
Signed-off-by: Craig Andrews <candrews@gentoo.org>
This commit is contained in:
Ralph Seichter
2018-09-28 18:04:54 +02:00
committed by Craig Andrews
parent 666f075f33
commit a199b66a67
6 changed files with 137 additions and 6 deletions

View File

@@ -1 +1,2 @@
DIST milter-regex-1.9.tar.gz 19880 BLAKE2B 8934eb4f78f168b6f4f93b3a7e70b896c6518cd1228ea8fe387184a718a002f051f5084a7a7f4d07c9e7832fe1c9e9bc907661c4e765dde938b7c6049c8772e6 SHA512 55cb97eba01220eb57c29498a090152c05d259abbe6f771e47a67499e7c2a1d4121ec9d0bce84cc8b6490bcd20dea8eaaba753e61f1ce9002edd8440b13f7148
DIST milter-regex-2.2.tar.gz 20496 BLAKE2B 75cd668e8f75a62bb16d1e38d089465e1e9b49a7441594cb8f77279c9e29f1b90c7b452595f8653b81167fbed8f10e8322ccec51374446938ca43b245cbfa440 SHA512 c2f94d1d9897e2a3f62639343ff9272d28c044f25c59e10f12f37250aa0e5426174cb2a74850993246628e828d21f5cba8567de65a225235eac1969836e41f28

View File

@@ -0,0 +1,38 @@
--- a/Makefile.linux 2011-07-16 16:51:34.000000000 +0300
+++ a/Makefile.linux 2012-08-05 18:15:30.906378968 +0300
@@ -6,28 +6,27 @@
# see milter-regex.init for an init script for RedHat/Fedora
# (contributed by admin@2ka.mipt.ru)
-CFLAGS= -g
-LDFLAGS= -L/usr/lib/libmilter -lmilter -lpthread
+LIBS= -lmilter -lpthread
all: milter-regex milter-regex.cat8
milter-regex: milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o
- gcc -o milter-regex milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o $(LDFLAGS)
+ $(CC) $(LDFLAGS) -o milter-regex milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o $(LIBS)
milter-regex.o: milter-regex.c eval.h
- gcc $(CFLAGS) -c milter-regex.c
+ $(CC) $(CFLAGS) -c milter-regex.c
eval.o: eval.c eval.h
- gcc $(CFLAGS) -c eval.c
+ $(CC) $(CFLAGS) -c eval.c
strlcat.o: strlcat.c
- gcc $(CFLAGS) -c strlcat.c
+ $(CC) $(CFLAGS) -c strlcat.c
strlcpy.o: strlcpy.c
- gcc $(CFLAGS) -c strlcpy.c
+ $(CC) $(CFLAGS) -c strlcpy.c
y.tab.o: y.tab.c
- gcc $(CFLAGS) -c y.tab.c
+ $(CC) $(CFLAGS) -c y.tab.c
y.tab.c: parse.y
yacc -d parse.y

View File

@@ -0,0 +1,13 @@
# Config file.
MR_CONF="/etc/milter-regex.conf"
# Process and socket owner, socket group, socket permissions.
MR_USER="milter"
MR_GROUP="milter"
MR_PERM="0660"
MR_RUNDIR="/run/milter-regex"
MR_SOCKET="${MR_RUNDIR}/socket"
# Additional options for logging etc.
MR_OPTS=""

View File

@@ -0,0 +1,14 @@
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/bin/milter-regex"
command_args="-c ${MR_CONF} -u ${MR_USER} -p unix:${MR_SOCKET} -P ${MR_PERM} -U ${MR_USER} -G ${MR_GROUP} ${MR_OPTS}"
depend() {
before postfix sendmail
}
start_pre() {
checkpath --directory --mode 0755 --owner ${MR_USER}:${MR_GROUP} ${MR_RUNDIR}
}

View File

@@ -1,10 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>net-mail@gentoo.org</email>
<name>Net-Mail</name>
</maintainer>
<longdescription>milter-regex is a very simple milter-based plugin that rejects or discards messages matching
regular expressions. It doesn't add much processing overhead, so even a busy mail server can afford to run it.</longdescription>
<maintainer type="person">
<email>gentoo@seichter.de</email>
<name>Ralph Seichter</name>
</maintainer>
<maintainer type="project">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<maintainer type="project">
<email>net-mail@gentoo.org</email>
<name>Net-Mail</name>
</maintainer>
<longdescription>
milter-regex is a very simple milter-based plugin that rejects or
discards messages matching regular expressions. It doesn't add much
processing overhead, so even a busy mail server can afford to run it.
</longdescription>
<upstream>
<doc>https://www.benzedrine.ch/milter-regex.html</doc>
</upstream>
</pkgmetadata>

View File

@@ -0,0 +1,51 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs user
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="|| ( mail-filter/libmilter mail-mta/sendmail )"
DEPEND="${RDEPEND}
virtual/yacc"
PATCHES=( "${FILESDIR}/${P}-gentoo.patch" )
src_compile() {
emake CC="$(tc-getCC)" -f Makefile.linux all
}
src_install() {
dobin ${PN}
insinto /etc
newins rules ${PN}.conf
newconfd "${FILESDIR}/${PN}-conf-${PV}" ${PN}
newinitd "${FILESDIR}/${PN}-init-${PV}" ${PN}
doman *.8
}
pkg_preinst() {
# For consistency with mail-milter/spamass-milter (see bug #280571).
# While the milter process requires an owner, a home directory is not
# necessary because no data is written.
enewgroup milter
enewuser milter -1 -1 /var/lib/milter milter
}
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')"
}