On 8/24/19 10:39 AM, Stuart Henderson wrote:
> On 2019/08/24 10:02, Gilles Chehade wrote:
>> On Sat, Aug 24, 2019 at 06:49:59AM +0200, Martijn van Duren wrote:
>>> On 8/24/19 6:07 AM, Martijn van Duren wrote:
>>>> Briefly discussed with gilles@.
>>>>
>>>> I would like to move the filters to libexec/smtpd for two reasons.
>>>> 1) filters are not commandline applications and I don't want them in my
>>>> $PATH.
>>>> 2) opensmtpd-extras already used this location, so it's only consistent
>>>> to install there as well.
>>>>
>>>> Diff below works for me and based on go.port.mk I don't see any other
>>>> way to change the install directory (except for changing go.port.mk)
>>>>
>>>> OK?
>>>>
>>>> martijn@
>>>>
>>> Missed revision bump...
>>>
>>
>> ok with the idea but I'm not comfortable enough with ports to know
>> if the way you did is the proper way, ports newbie here :-)
>
> I think this should use its own do-install target rather than override
> MODGO_INSTALL_TARGET.
>
Not saying we shouldn't go the do-install route, but just throwing out
an idea. If you're opposed I'll write the do-install patch.
Main reason: less code in port Makefile and might be used by other ports
in the future.
thoughts?
Index: lang/go/go.port.mk
===================================================================
RCS file: /cvs/ports/lang/go/go.port.mk,v
retrieving revision 1.22
diff -u -p -r1.22 go.port.mk
--- lang/go/go.port.mk 4 May 2019 21:46:16 -0000 1.22
+++ lang/go/go.port.mk 24 Aug 2019 18:53:52 -0000
@@ -27,6 +27,7 @@ MAKE_ENV += GOCACHE="${MODGO_GOCACHE}"
MODGO_CMD ?= ${SETENV} ${MAKE_ENV} go
MODGO_BUILD_CMD = ${MODGO_CMD} install ${MODGO_FLAGS}
MODGO_TEST_CMD = ${MODGO_CMD} test ${MODGO_FLAGS} ${MODGO_TEST_FLAGS}
+MODGO_BINDIR ?= bin
.if ! empty(MODGO_LDFLAGS)
MODGO_BUILD_CMD += -ldflags="${MODGO_LDFLAGS}"
@@ -57,8 +58,9 @@ MODGO_FLAGS += -x
INSTALL_STRIP =
.if ${MODGO_TYPE:L:Mbin}
-MODGO_INSTALL_TARGET = ${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/* \
- ${PREFIX}/bin;
+MODGO_INSTALL_TARGET = ${INSTALL_PROGRAM_DIR} ${PREFIX}/${MODGO_BINDIR} && \
+ ${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/* \
+ ${PREFIX}/${MODGO_BINDIR};
.endif
# Go source files serve the purpose of libraries, so sources should be included
Index: mail/opensmtpd-filter-rspamd/Makefile
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-rspamd/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- mail/opensmtpd-filter-rspamd/Makefile 13 Aug 2019 18:40:10 -0000
1.1.1.1
+++ mail/opensmtpd-filter-rspamd/Makefile 24 Aug 2019 18:53:52 -0000
@@ -3,6 +3,7 @@
COMMENT = rspamd integration to the OpenSMTPD daemon
V = 0.1.0
+REVISION = 0
DISTNAME = filter-rspamd-${V}
CATEGORIES = mail
@@ -18,6 +19,7 @@ PERMIT_PACKAGE = Yes
WANTLIB = c pthread
MODULES = lang/go
MODGO_TYPE = bin
+MODGO_BINDIR = libexec/smtpd
NO_TEST = Yes
ALL_TARGET = filter-rspamd
Index: mail/opensmtpd-filter-rspamd/pkg/PLIST
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-rspamd/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- mail/opensmtpd-filter-rspamd/pkg/PLIST 13 Aug 2019 18:40:10 -0000
1.1.1.1
+++ mail/opensmtpd-filter-rspamd/pkg/PLIST 24 Aug 2019 18:53:52 -0000
@@ -1,3 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/08/13 18:40:10 gilles Exp $
-@bin bin/filter-rspamd
+libexec/smtpd/
+@bin libexec/smtpd/filter-rspamd
share/doc/pkg-readmes/${PKGSTEM}
Index: mail/opensmtpd-filter-rspamd/pkg/README
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-rspamd/pkg/README,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 README
--- mail/opensmtpd-filter-rspamd/pkg/README 13 Aug 2019 18:40:10 -0000
1.1.1.1
+++ mail/opensmtpd-filter-rspamd/pkg/README 24 Aug 2019 18:53:52 -0000
@@ -8,7 +8,7 @@ To use filter-rspamd, you must declare i
Edit the /etc/mail/smtpd.conf file to declare the filter:
- filter "rspamd" proc-exec "${PREFIX}/bin/filter-rspamd"
+ filter "rspamd" proc-exec "${PREFIX}/libexec/smtpd/filter-rspamd"
Then add the filter to each listener that should be filtered:
Index: mail/opensmtpd-filter-senderscore/Makefile
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-senderscore/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- mail/opensmtpd-filter-senderscore/Makefile 19 Aug 2019 21:21:17 -0000
1.1.1.1
+++ mail/opensmtpd-filter-senderscore/Makefile 24 Aug 2019 18:53:52 -0000
@@ -3,6 +3,7 @@
COMMENT = SenderScore integration to the OpenSMTPD daemon
V = 0.1.0
+REVISION = 0
DISTNAME = filter-senderscore-${V}
CATEGORIES = mail
@@ -18,6 +19,7 @@ PERMIT_PACKAGE = Yes
WANTLIB = c pthread
MODULES = lang/go
MODGO_TYPE = bin
+MODGO_BINDIR = libexec/smtpd
NO_TEST = Yes
ALL_TARGET = filter-senderscore
Index: mail/opensmtpd-filter-senderscore/pkg/PLIST
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-senderscore/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- mail/opensmtpd-filter-senderscore/pkg/PLIST 19 Aug 2019 21:21:17 -0000
1.1.1.1
+++ mail/opensmtpd-filter-senderscore/pkg/PLIST 24 Aug 2019 18:53:52 -0000
@@ -1,3 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2019/08/19 21:21:17 gilles Exp $
-@bin bin/filter-senderscore
+libexec/smtpd/
+@bin libexec/smtpd/filter-senderscore
share/doc/pkg-readmes/${PKGSTEM}
Index: mail/opensmtpd-filter-senderscore/pkg/README
===================================================================
RCS file: /cvs/ports/mail/opensmtpd-filter-senderscore/pkg/README,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 README
--- mail/opensmtpd-filter-senderscore/pkg/README 19 Aug 2019 21:21:17
-0000 1.1.1.1
+++ mail/opensmtpd-filter-senderscore/pkg/README 24 Aug 2019 18:53:52
-0000
@@ -9,7 +9,7 @@ To use filter-senderscore, you must decl
Edit the /etc/mail/smtpd.conf file to declare the filter:
filter "senderscore" \
- proc-exec "${PREFIX}/bin/filter-senderscore [...]"
+ proc-exec "${PREFIX}/libexec/smtpd/filter-senderscore [...]"
The following options may be passed to filter-senderscore: