freebsd-ports/mail/milter-greylist/Makefile
Tijl Coosemans 9f8b4bcde3 Support LIBS like LDFLAGS.
- Add LIBS="${LIBS}" to MAKE_ENV and CONFIGURE_ENV.
- Add an option helper for LIBS.
- Adjust all ports that already use LIBS.  Also remove references to
  PTHREAD_CFLAGS and PTHREAD_LIBS while here.
- Some ports did not support having a LIBS environment variable and
  required additional patches.

Somewhat simplified a linker command line looks like:

${CC} ${src_LDFLAGS} ${LDFLAGS} ${src_LIBS} ${LIBS}

where src_LDFLAGS and src_LIBS are controlled by upstream and LDFLAGS and
LIBS can be controlled by us.  If possible -L and -l flags need to be
added to LIBS to make sure they appear after any -L and -l flags set by
upstream.  Many ports currently add -L${LOCALBASE}/lib to LDFLAGS but this
may appear too early on the command line causing installed libraries to
be linked in instead of freshly built ones.

Additional changes:
benchmarks/netio: Replace WITH_IPV6 with an IPV6 option.
comms/gnokii: Replace some patches with USES=pathfix.  Also remove -fPIC.
graphics/gimageview: USES=libtool and install desktop file in DESKTOPDIR.
graphics/visionworkbench: Remove FreeBSD 7 support.
multimedia/libmovtar: New LIB_DEPENDS syntax.
multimedia/opencinematools: Use standard do-build.
net/siproxd: USES=libtool:keepla (port actually needs .la files for plugins)
net-mgmt/nagios: Remove -fPIC.
net-mgmt/nagios4: Remove -fPIC.
print/cups-base: Only add -lssp_nonshared on i386 and OSVERSION < 1000036.
security/p11-kit: Replace PTHREAD_LIBS in CONFIGURE_ENV with
ac_cv_func_pthread_mutexattr_init=no in CONFIGURE_ARGS.  This skips a test
in configure that falsely detects pthread_mutexattr_init in our libc.
sysutils/dar: Fix iconv detection.
x11/rxvt-unicode: Remove -lstdc++ and patch configure to remove a FreeBSD
hack and use $CXX as linker as on other platforms.

PR:		190592
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2014-06-11 14:49:59 +00:00

108 lines
2.8 KiB
Makefile

# Created by: Cyril Guibourg
# $FreeBSD$
PORTNAME= milter-greylist
PORTVERSION= 4.4.3
CATEGORIES= mail
MASTER_SITES= ftp://ftp.espci.fr/pub/milter-greylist/ \
http://fossies.org/unix/privat/
EXTRACT_SUFX= .tgz
MAINTAINER= m.tsatsenko@gmail.com
COMMENT= Easy-to-use greylist milter for sendmail and postfix
LICENSE= BSD3CLAUSE
CONFLICTS= milter-greylist-devel-[1-9]*.*
PKGMESSAGE= ${WRKDIR}/pkg-message
MAKE_JOBS_UNSAFE= yes
##
# 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.
##
OPTIONS_DEFINE= MANPAGES SPF GEOIP CURL LDAP P0F POSTFIX
OPTIONS_DEFAULT= MANPAGES
SPF_DESC= SPF support
CURL_DESC= curl support
P0F_DESC= P0F support
POSTFIX_DESC= Use Postfix instead of Sendmail
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MMANPAGES}
PLIST_FILES+= man/man5/greylist.conf.5.gz \
man/man8/milter-greylist.8.gz
.endif
.if ${PORT_OPTIONS:MSPF}
BUILD_DEPENDS+= libspf2>=1.2.5:${PORTSDIR}/mail/libspf2
CONFIGURE_ARGS+= --with-libspf2=${LOCALBASE}
.endif
.if ${PORT_OPTIONS:MGEOIP}
BUILD_DEPENDS+= GeoIP>=1.4.4:${PORTSDIR}/net/GeoIP
CONFIGURE_ARGS+= --with-libGeoIP=${LOCALBASE}
.endif
.if ${PORT_OPTIONS:MCURL}
BUILD_DEPENDS+= curl>=7.18:${PORTSDIR}/ftp/curl
CONFIGURE_ARGS+= --with-libcurl=${LOCALBASE}
.endif
.if ${PORT_OPTIONS:MLDAP}
USE_OPENLDAP=yes
CONFIGURE_ARGS+= --with-openldap
.endif
.if ${PORT_OPTIONS:MP0F}
RUN_DEPENDS+= p0f:${PORTSDIR}/net-mgmt/p0f
CONFIGURE_ARGS+= --enable-p0f306
.endif
.if ${PORT_OPTIONS:MPOSTFIX}
CONFIGURE_ARGS+= --enable-postfix
.else
LDFLAGS+= ${SENDMAIL_LDFLAGS}
LIBS+= ${SENDMAIL_LDADD}
.endif
RUN_DEPENDS+= ${BUILD_DEPENDS}
CFLAGS+= ${PTHREAD_CFLAGS}
LIBS+= ${PTHREAD_LIBS}
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --with-user=mailnull --with-libmilter=${MILTERBASE} \
--enable-dnsrbl --with-thread-safe-resolver \
--with-dumpfile=/var/milter-greylist/greylist.db
ALL_TARGET= milter-greylist
SUB_FILES+= pkg-message
USE_RC_SUBR= milter-greylist
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/etc/mail
.if ${PORT_OPTIONS:MMANPAGES}
${INSTALL_MAN} ${WRKSRC}/greylist.conf.5 ${STAGEDIR}${PREFIX}/man/man5/
${INSTALL_MAN} ${WRKSRC}/milter-greylist.8 ${STAGEDIR}${PREFIX}/man/man8/
.endif
${INSTALL_PROGRAM} ${WRKSRC}/milter-greylist ${STAGEDIR}${PREFIX}/libexec/
${INSTALL_DATA} ${WRKSRC}/greylist.conf \
${STAGEDIR}${PREFIX}/etc/mail/greylist.conf.sample
post-install:
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}/
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/greylist.conf ${STAGEDIR}${EXAMPLESDIR}/
.endif
.include "${PORTSDIR}/mail/sendmail/bsd.milter.mk"
.include <bsd.port.mk>