Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Oct 2012 18:07:20 -0400
From:      Curtis Villamizar <curtis@occnc.com>
To:        curtis@occnc.com
Cc:        Chris Rees <crees@freebsd.org>, Dirk Meyer <dinoex@freebsd.org>, freebsd-ports@freebsd.org
Subject:   Re: patch to build spamass-milter with sendmail-sasl
Message-ID:  <201210182207.q9IM7KfO028863@gateway1.orleans.occnc.com>
In-Reply-To: Your message of "Sat, 25 Aug 2012 17:18:17 EDT." <201208252118.q7PLIHe4011678@gateway2.orleans.occnc.com>

next in thread | previous in thread | raw e-mail | index | archive | help

In message <201208252118.q7PLIHe4011678@gateway2.orleans.occnc.com>
Curtis Villamizar writes:
 
>  
> In message <CADLo83_xKKC4oEJQ1ti1aQR5gq2DadeUh-7VvatQ=5skQR6UtA@mail.gmail.com>
> Chris Rees writes:
>  
> > On 25 August 2012 21:38, Curtis Villamizar <curtis@occnc.com> wrote:
> > >
> > > In message <CADLo839FeQroEt6r12+KgWgoUuj1gcNkanm-hqHVQSC2g8k-Ug@mail.gmail.com>
> > > Chris Rees writes:
> > >
> > >> On 23 August 2012 21:37, Lawrence K. Chen, P.Eng. <lkchen@ksu.edu> wrote:
> > >> > Just the patch I was looking for.
> > >> >
> > >> > ----- Original Message -----
> > >> >>
> > >> >> FYI-
> > >> >>
> > >> >> The mail/spamass-milter port won't build if the sendmail-sasl port
> > >> >> has
> > >> >> been built.  The patch below fixes this.
> > >> >>
> > >> >> The port maintainer is on the Cc.  No bug has been reported.
> > >>
> > >> Thanks for your patch Curtis; I've used it as a base for some further
> > >> tweaks, and sent a PR [1].
> > >>
> > >> Unfortunately you hadn't CC'd the correct maintainer, but this is not
> > >> a problem since the PR will email him for us.
> > >>
> > >> Chris
> > >>
> > >> [1] http://www.freebsd.org/cgi/query-pr.cgi?pr=170943
> > >
> > >
> > > There may be a better way to fix this - eliminate the need for the
> > > sendmail-sasl and sendmail-ldap ports by using the options framework
> > > in the sendmail port.  I used this diff to do that in a later build.
> > > (the first was amd64, the second i386).
> > >
> > > Curtis
> > >
> > >
> > > The following patch is to the Makefile in {/usr/ports/}mail/sendmail
> > > and only makes use of the port options framework to set options rather
> > > than having users either type them on the command line, or edit the
> > > makefile, or use pseudo ports like sendmail-sasl and sendmail-ldap to
> > > set a specific option.  The sendmail-sasl and sendmail-ldap should be
> > > marked as depricated in their makefiles.
> > >
> >  
> > [previous patch trimmed; can be found at [1]]
> >  
> > Ah... the use of slave ports (like -sasl) is to create handy packages
> > for those who use packages, as well as meaning that people can put
> > dependencies on certain OPTIONS.
> >  
> > Also, your code could be a little more brief;
> >  
> > # convert OPTIONS in WITH_* form to SENDMAIL_WITH_*
> > .if defined(WITH_IPV6)
> > SENDMAIL_WITH_IPV6=yes
> > .else
> > SENDMAIL_WITHOUT_IPV6=yes
> > .endif
> >  
> > should be using OPTIONSng, and a for loop:
> >  
> > .for o in ${PORT_OPTIONS}
> > .if ${PORT_OPTIONS:M$o}
> > SENDMAIL_WITH_$o=yes
> > .else
> > SENDMAIL_WITHOUT_$o=yes
> > .endif
> >  
> > To be honest, it's not really good enough to be hacking the Makefile
> > like this; if you would like to try a conversion to new-style OPTIONS
> > I would recommend reading [2], but before you put yourself through
> > this CHECK WITH THE MAINTAINER (CC'd) that such a patch would be
> > accepted!
> >  
> > I'm willing to help off-list if Dirk will accept a patch.
> >  
> > Chris
> >  
> > [1] http://lists.freebsd.org/pipermail/freebsd-ports/2012-August/077775.html
> >  
> > [2] http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-options.html#AEN2638
>  
>  
> Chris,
>  
> Thanks.  I'll create an OPTIONSng patch for the mail/sendmail Makefile
> and send it and just hope it gets accepted.  If not, I'll keep it as a
> local patch.  Its not much work.
>  
> Curtis


Chris, Dirk,

I forgot about the for loop but I did come up with the following patch
that preserved the sendmail-ldap and sendmail-sasl ports as is in case
they are needed for packages, and provides a full set of options in
the sendmail port.

Sorry for the delay.  I put this off until I was going to rebuild from
9.1-RC source anyway and then forgot to send the diffs.

Would you prefer if I resend with the for loop?

Curtis


Diffs are taken relative to the usr/ports/mail directory since three
ports are involved.  The diffs to three existing Makefile are small.
A new Makefile.options file is created (the diff is against an empty
file so touch sendmail/Makefile.options.orig first).



--- sendmail-ldap/Makefile.orig	2012-09-08 12:28:24.000000000 -0400
+++ sendmail-ldap/Makefile	2012-09-13 21:19:45.000000000 -0400
@@ -27,4 +27,5 @@
 .include "${.CURDIR}/Makefile.local"
 .endif
 
+SENDMAIL_PREDEFINED=	yes
 .include "${MASTERDIR}/Makefile"
--- sendmail-sasl/Makefile.orig	2012-09-08 12:28:36.000000000 -0400
+++ sendmail-sasl/Makefile	2012-09-13 21:19:48.000000000 -0400
@@ -25,4 +25,5 @@
 .include "${.CURDIR}/Makefile.local"
 .endif
 
+SENDMAIL_PREDEFINED=	yes
 .include "${MASTERDIR}/Makefile"
--- sendmail/Makefile.orig	2012-09-08 12:26:36.000000000 -0400
+++ sendmail/Makefile	2012-09-13 21:32:05.000000000 -0400
@@ -41,6 +41,11 @@
 PKGMESSAGE=	${WRKSRC}/pkg-message
 MILTER_SOVER?=	4
 
+#  set SENDMAIL_PREDEFINED to avoid OPTIONSng and "make config" step
+.if !defined(SENDMAIL_PREDEFINED)
+.include "Makefile.options"
+.endif
+
 # Options to define Features:
 # SENDMAIL_WITHOUT_IPV6=yes
 # SENDMAIL_WITHOUT_MILTER=yes
--- sendmail/Makefile.options.orig	2012-09-13 21:28:17.000000000 -0400
+++ sendmail/Makefile.options	2012-09-13 21:42:59.000000000 -0400
@@ -0,0 +1,116 @@
+#
+# $FreeBSD$
+#
+#  Use OPTIONSng framework to set options rather than command line
+#
+
+OPTIONS_DEFINE=		IPV6 MILTER MILTER_POOL NIS SHMEM SEM \
+			LA TLS SMTPS SASL SASLAUTHD LDAP BDB \
+			SOCKETMAP CYRUSLOOKUP PICKY_HELO_CHECK \
+			SHARED_MILTER
+
+OPTIONS_DEFAULT=	IPV6 MILTER MILTER_POOL SHMEM SEM \
+			LA TLS SMTPS SASL BDB
+
+IPV6_DESC=		Build with IPv6 support
+MILTER_DESC=		milter (mail filter plugin) interface
+MILTER_POOL_DESC=	milter pool (allow worker pools)
+NIS_DESC=		NIS (aka YP services)
+SHMEM_DESC=		SysV shared memory (SHMEM)
+SEM_DESC=		SysV semaphores (SEM)
+LA_DESC=		Load average support
+TLS_DESC=		transport layer security (TLS)
+SMTPS_DESC=		SMTP security (implies TLS)
+SASL_DESC=		SASL version 2 (implies SOCKETMAP)
+SASLAUTHD_DESC=		SASL authorization daemon
+LDAP_DESC=		LDAP
+BDB_DESC=		Berkeley database (DB4)
+SOCKETMAP_DESC=		trivial SOCKETMAP query protocol
+CYRUSLOOKUP_DESC=	SASL imapd database lookup
+PICKY_HELO_CHECK_DESC=	enable picky SMTP HELO check
+SHARED_MILTER_DESC=	shared milter
+
+.include <bsd.port.options.mk>
+
+# convert OPTIONS in OPTIONSng form to SENDMAIL_WITH_*
+.if ${PORT_OPTIONS:MIPV6}
+SENDMAIL_WITH_IPV6=yes
+.else
+SENDMAIL_WITHOUT_IPV6=yes
+.endif
+.if ${PORT_OPTIONS:MMILTER}
+SENDMAIL_WITH_MILTER=yes
+.else
+SENDMAIL_WITHOUT_MILTER=yes
+.endif
+.if ${PORT_OPTIONS:MMILTER_POOL}
+SENDMAIL_WITH_MILTER_POOL=yes
+.else
+SENDMAIL_WITHOUT_MILTER_POOL=yes
+.endif
+.if ${PORT_OPTIONS:MNIS}
+SENDMAIL_WITH_NIS=yes
+.else
+SENDMAIL_WITHOUT_NIS=yes
+.endif
+.if ${PORT_OPTIONS:MSHMEM}
+SENDMAIL_WITH_SHMEM=yes
+.else
+SENDMAIL_WITHOUT_SHMEM=yes
+.endif
+.if ${PORT_OPTIONS:MSEM}
+SENDMAIL_WITH_SEM=yes
+.else
+SENDMAIL_WITHOUT_SEM=yes
+.endif
+.if ${PORT_OPTIONS:MLA}
+SENDMAIL_WITH_LA=yes
+.else
+SENDMAIL_WITHOUT_LA=yes
+.endif
+.if ${PORT_OPTIONS:MTLS}
+SENDMAIL_WITH_TLS=yes
+.else
+SENDMAIL_WITHOUT_TLS=yes
+.endif
+.if ${PORT_OPTIONS:MSMTPS}
+SENDMAIL_WITH_SMTPS=yes
+.else
+SENDMAIL_WITHOUT_SMTPS=yes
+.endif
+.if ${PORT_OPTIONS:MSASL}
+SENDMAIL_WITH_SASL=yes
+SENDMAIL_WITH_SASL2=yes
+.else
+SENDMAIL_WITHOUT_SASL=yes
+SENDMAIL_WITHOUT_SASL2=yes
+.endif
+.if ${PORT_OPTIONS:MLDAP}
+SENDMAIL_WITH_LDAP=yes
+.else
+SENDMAIL_WITHOUT_LDAP=yes
+.endif
+.if ${PORT_OPTIONS:MBDB}
+SENDMAIL_WITH_BDB=yes
+#SENDMAIL_WITH_BDB_VER=4
+.endif
+.if ${PORT_OPTIONS:MSOCKETMAP}
+SENDMAIL_WITH_SOCKETMAP=yes
+.else
+SENDMAIL_WITHOUT_SOCKETMAP=yes
+.endif
+.if ${PORT_OPTIONS:MCYRUSLOOKUP}
+SENDMAIL_WITH_CYRUSLOOKUP=yes
+.else
+SENDMAIL_WITHOUT_CYRUSLOOKUP=yes
+.endif
+.if ${PORT_OPTIONS:MPICKY_HELO_CHECK}
+SENDMAIL_WITH_PICKY_HELO_CHECK=yes
+.else
+SENDMAIL_WITHOUT_PICKY_HELO_CHECK=yes
+.endif
+.if ${PORT_OPTIONS:MSHARED_MILTER}
+SENDMAIL_WITH_SHARED_MILTER=yes
+.else
+SENDMAIL_WITHOUT_SHARED_MILTER=yes
+.endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210182207.q9IM7KfO028863>