On 8/24/19 8:56 PM, Martijn van Duren wrote:
> 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?
> 
So combining this one with Antoine's request to put everything in
mail/opensmtpd-filters, this is what I came up with.

Only thing missing is the automatic rename on upgrade, which I can't
figure out how to achieve.

Index: 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
--- go.port.mk  4 May 2019 21:46:16 -0000       1.22
+++ go.port.mk  26 Aug 2019 06:08:06 -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

Attachment: opensmtpd-filters.tar.gz
Description: application/gzip

Reply via email to