ports/85795: [PATCH] Fix mail/milter-greylist with sendmail from ports and add option to bild it with libspf2

Oleg Sharoiko os at rsu.ru
Tue Sep 6 13:40:20 UTC 2005


>Number:         85795
>Category:       ports
>Synopsis:       [PATCH] Fix mail/milter-greylist with sendmail from ports and add option to bild it with libspf2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 06 13:40:19 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Oleg Sharoiko
>Release:        FreeBSD 5.4-RELEASE-p1 i386
>Organization:
Computer Center of Rostov State University
>Environment:
System: FreeBSD asterix.r61.net 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #0: Sat May 14 10:12:27 MSD 2005 and at asterix.rsu.ru:/usr/obj/usr/src/sys/asterix.2xp4.RELENG_5_4.2005-05-14 i386


	
>Description:
	When sendmail has been installed from ports but not from the base
	system mail/milter-greylist can not find libmilter.

	Attached patch fixes this by adding WITH_SENDMAIL_BASE and
	WITH_SENDMAIL_PORT options. The default is to use base sendmail
	in case it has milter support and mail/sendmail otherwise.

	Pathc also adds optional support for building with libspf2

>How-To-Repeat:
	Install base system without sendmail
	Install sendmail from mail/sendmail
	Try to build mail/milter-greylist

>Fix:
--- Makefile.orig	Tue Sep  6 17:02:22 2005
+++ Makefile	Tue Sep  6 17:16:46 2005
@@ -15,24 +15,59 @@
 MAINTAINER=	aragorn+ports at teaser.fr
 COMMENT=	Easy-to-use greylist milter for sendmail
 
+CONFLICTS=	milter-greylist-devel-[1-9]*.*
+
+##
+# Use the following quirks to choose which sendmail to use (ports or system):
+#
+#   WITH_SENDMAIL_BASE=yes
+# or
+#   WITH_SENDMAIL_PORT=yes
+#
+# If unspecified, check for an up-to-date system version but give an
+# installed port preference over it.
+#
+
 MAN5=		greylist.conf.5
 MAN8=		milter-greylist.8
 
+.include <bsd.port.pre.mk>
+
+.if !defined(WITH_SENDMAIL_BASE) && \
+    !defined(WITH_SENDMAIL_PORT) && \
+    !exists(${LOCALBASE}/lib/libmilter.a)
+WITH_SENDMAIL_BASE=yes
+.endif
+
+.if defined(WITH_SENDMAIL_BASE)
+.if exists(/usr/lib/libmilter.a)
+MILTERBASE=	/usr
+.else
+BROKEN= "Base system sendmail not found or too old, rebuild with WITH_SENDMAIL_PORT=yes"
+.endif
+.else
+BUILD_DEPENDS+=	${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
+MILTERBASE?=	${LOCALBASE}
+.endif
+
+.if defined(WITH_LIBSPF2)
+BUILD_DEPENDS+=	${LOCALBASE}/lib/libspf2.so:${PORTSDIR}/mail/libspf2
+CONFIGURE_ARGS+=	--with-libspf2=${LOCALBASE}
+.endif
+
 CFLAGS+=	${PTHREAD_CFLAGS}
 LIBS+=		${PTHREAD_LIBS}
 
 GNU_CONFIGURE=	yes
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
-CONFIGURE_ARGS+=	--with-user=smmsp
-CONFIGURE_ENV+=	CFLAGS="${CFLAGS}" LIBS="${LIBS}"
+CONFIGURE_ARGS+=	--with-user=smmsp --with-libmilter=${MILTERBASE}
+CONFIGURE_ENV+=	CFLAGS="${CFLAGS}" LIBS="${LIBS} "
 
 ALL_TARGET=	milter-greylist
 
 USE_RC_SUBR=	yes
 RC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
 
-CONFLICTS=	milter-greylist-devel-[1-9]*.*
-
 post-extract:
 	@${SED}	${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
 		${FILESDIR}/milter-greylist.sh > ${WRKSRC}/milter-greylist.sh
@@ -73,4 +108,4 @@
 
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list