git: 47bb7f2e7fee - main - mail/libopensmtpd: Library for writing opensmtpd filters

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 05 Oct 2025 13:45:37 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=47bb7f2e7fee8d801ba9f697316c9040555603ec

commit 47bb7f2e7fee8d801ba9f697316c9040555603ec
Author:     Matthieu Valleton <mvalleton@seos.fr>
AuthorDate: 2025-10-01 15:59:14 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-10-05 13:44:07 +0000

    mail/libopensmtpd: Library for writing opensmtpd filters
    
    This library provides an event-based interface for writing OpenSMTPd
    filters. It is used by the opensmtpd-filter-dkimsign port as well as
    several other filters that do not have ports.
    
    WWW: https://imperialat.at/dev/libopensmtpd/
    
    PR:             283822
---
 mail/Makefile                        |  1 +
 mail/libopensmtpd/Makefile           | 34 ++++++++++++++++++++++++++++++++++
 mail/libopensmtpd/distinfo           |  3 +++
 mail/libopensmtpd/files/patch-ioev.c | 11 +++++++++++
 mail/libopensmtpd/pkg-descr          |  3 +++
 mail/libopensmtpd/pkg-plist          |  5 +++++
 6 files changed, 57 insertions(+)

diff --git a/mail/Makefile b/mail/Makefile
index dde4a69eddde..aba4803ad97c 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -181,6 +181,7 @@
     SUBDIR += libesmtp
     SUBDIR += libetpan
     SUBDIR += libmilter
+    SUBDIR += libopensmtpd
     SUBDIR += libpst
     SUBDIR += libsieve
     SUBDIR += libspamtest
diff --git a/mail/libopensmtpd/Makefile b/mail/libopensmtpd/Makefile
new file mode 100644
index 000000000000..64a054778500
--- /dev/null
+++ b/mail/libopensmtpd/Makefile
@@ -0,0 +1,34 @@
+PORTNAME=	libopensmtpd
+DISTVERSION=	0.7
+CATEGORIES=	mail
+MASTER_SITES=	https://imperialat.at/releases/
+
+MAINTAINER=	mvalleton@seos.fr
+COMMENT=	Library for writing opensmtpd filters
+WWW=		https://imperialat.at/dev/libopensmtpd/
+
+LICENSE=	ISCL
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	opensmtpd>=6.6.0:mail/opensmtpd
+LIB_DEPENDS=	libevent.so:devel/libevent
+
+USES=		gmake localbase:ldflags uidfix
+USE_LDCONFIG=	yes
+
+MAKEFILE=	Makefile.gnu
+MAKE_ARGS=	NEED_STRLCAT=0 \
+		NEED_STRLCPY=0 \
+		NEED_STRTONUM=0
+
+# Makefile doesn't install the .so libraries or opensmtpd.h, and
+# Makefile.gnu uses GNU-specific options to install, so we can't
+# use either. So we just have to install the files manually then
+do-install:
+	${INSTALL_DATA} ${WRKSRC}/opensmtpd.h ${STAGEDIR}${PREFIX}/include/
+	${INSTALL_MAN} ${WRKSRC}/osmtpd_run.3 ${STAGEDIR}${PREFIX}/share/man/man3/
+	${INSTALL_LIB} ${WRKSRC}/libopensmtpd.so.0.1.0 ${STAGEDIR}${PREFIX}/lib/libopensmtpd.so.0.1.0
+	${RLN} libopensmtpd.so.0.1.0 ${STAGEDIR}${PREFIX}/lib/libopensmtpd.so.0
+	${RLN} libopensmtpd.so.0.1.0 ${STAGEDIR}${PREFIX}/lib/libopensmtpd.so
+
+.include <bsd.port.mk>
diff --git a/mail/libopensmtpd/distinfo b/mail/libopensmtpd/distinfo
new file mode 100644
index 000000000000..d2d851868c25
--- /dev/null
+++ b/mail/libopensmtpd/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1735830966
+SHA256 (libopensmtpd-0.7.tar.gz) = cdd6d5e11a7063f9265da43a42309c646554b8b68b03982ca8472dbe2b08a613
+SIZE (libopensmtpd-0.7.tar.gz) = 34942
diff --git a/mail/libopensmtpd/files/patch-ioev.c b/mail/libopensmtpd/files/patch-ioev.c
new file mode 100644
index 000000000000..6f8f4395467c
--- /dev/null
+++ b/mail/libopensmtpd/files/patch-ioev.c
@@ -0,0 +1,11 @@
+--- ioev.c.orig	2019-11-14 17:46:37 UTC
++++ ioev.c
+@@ -21,6 +21,8 @@
+ #include <sys/queue.h>
+ #include <sys/socket.h>
+ 
++#include <netinet/in.h>
++
+ #include <err.h>
+ #include <errno.h>
+ #include <event.h>
diff --git a/mail/libopensmtpd/pkg-descr b/mail/libopensmtpd/pkg-descr
new file mode 100644
index 000000000000..f4a15f259cd7
--- /dev/null
+++ b/mail/libopensmtpd/pkg-descr
@@ -0,0 +1,3 @@
+This library provides an event-based interface for writing OpenSMTPd
+filters. It is used by the opensmtpd-filter-dkimsign port as well as
+several other filters that do not have ports.
diff --git a/mail/libopensmtpd/pkg-plist b/mail/libopensmtpd/pkg-plist
new file mode 100644
index 000000000000..8edfac208244
--- /dev/null
+++ b/mail/libopensmtpd/pkg-plist
@@ -0,0 +1,5 @@
+include/opensmtpd.h
+lib/libopensmtpd.so
+lib/libopensmtpd.so.0
+lib/libopensmtpd.so.0.1.0
+share/man/man3/osmtpd_run.3.gz