mail/filtermail fails to build with 13.0-CURRENT

Mike Clarke jmc-freebsd2 at milibyte.co.uk
Wed Jul 1 14:52:34 UTC 2020


On Monday, 29 June 2020 21:43:28 BST Jung-uk Kim wrote:
> I just checked the upstream and it seems the problem does not exist any
> more after this commit.
> 
> https://sourceforge.net/p/mailfilter/code/ci/52e08609da8133e2cc0acd1961ebc1
> e1537f0c54
> 
> Most applications should have similar fixes because all major Linux
> distros are using Flex 2.6 now.  If you are maintaining such
> applications, you should update the ports, add devel/flex to
> BUILD_DEPENDS, and set FLEX=${LOCALBASE}/bin/flex for releng/stable
> branches.

Thanks Jung-uk Kim, your info got me moving along the right track.

I've patched the port to upgrade it to 0.8.6 and incorporated your 
suggestions about devel/flex for releng/stable. I also needed to 
conditionally add CPPFLAGS+= -I${LOCALBASE}/include/flex to prevent flex 
2.5.37 from the rev 12 base system from being used.

With these changes filtermail 0.8.6 now builds and works on both 12.1-RELEASE 
and 13.0-CURRENT but before I go ahead and submit a patch there's a point I'm 
a bit concerned about.

I've successfully followed all the steps for testing the port in section 3.4 
of the Porter's Handbook except for the final step, make package (as user), 
which failed. Initially it was because I did not have write access to the 
port directory. After temporarily running chmod a+w filtermail I was able to 
build the package but the final step of copying it to /usr/ports/packages/
All/filtermail-0.8.6.txz not surprisingly failed. I'm puzzled why there is 
this requirement to be able to build as a user when the default permissions 
on the ports directories prevent this for unprivileged users.

I'm fairly confident that my patches to the port are working OK but this is a 
task I rarely get involved with so I've appended the Makefile to this email 
in case anybody can spot anything I've not done correctly.

I made the dependency of textproc/flex conditional on OSVERSION < 1300000. I 
suppose that will only be correct if flex was in base from the start of 13.0-
CURRENT, if not is there a more specific value I should test against?

# $FreeBSD: head/mail/filtermail/Makefile 436247 2017-03-15 14:45:30Z mat $

PORTNAME=	filtermail
PORTVERSION=	0.8.6
CATEGORIES=	mail
MASTER_SITES=	http://sourceforge.net/projects/mailfilter/files/Mailfilter/
DISTNAME=	mailfilter-${PORTVERSION}

MAINTAINER=	jmc-filtermail at milibyte.co.uk
COMMENT=	Filter mail on a POP3 server: saves downloading spam

LICENSE=	GPLv3

.include <bsd.port.options.mk>
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1300000
BUILD_DEPENDS= ${LOCALBASE}/bin/flex:textproc/flex
.endif

USES=		bison gmake ssl

# This port is filtermail, but the author called it mailfilter. To avoid a
#  clash with another port called mailfilter, we change all files
#  installed by this port from the form *mailfilter* to the form
#  *filtermail*, and similarly the names in the man pages.

EXTRACT_CMD=	${GZIP_CMD}
EXTRACT_BEFORE_ARGS=	-dc
EXTRACT_AFTER_ARGS=	| ${SED} 's/[mM][aA][iI][lL][fF][iI][lL][tT][eE][rR]/
filtermail/g' | ${TAR} -xf -

WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}

GNU_CONFIGURE=	yes
MAKE_JOBS_UNSAFE=	yes

CPPFLAGS+=	-I${LOCALBASE}/include
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1300000
CPPFLAGS+=      -I${LOCALBASE}/include/flex
FLEX=${LOCALBASE}/bin/flex
.endif
LDFLAGS+=	-L${LOCALBASE}/lib

PLIST_FILES=	bin/${PORTNAME} \
		man/man1/${PORTNAME}.1.gz \
		man/man5/${PORTNAME}ex.5.gz \
		man/man5/${PORTNAME}rc.5.gz

post-patch:
	@${REINPLACE_CMD} -e 's|filtermail.sourceforge|
mailfilter.sourceforge|g' ${WRKSRC}/README

post-extract:
	@${RM} ${WRKSRC}/src/getopt.h

.include <bsd.port.mk>


-- 
Mike Clarke




More information about the freebsd-ports mailing list