aboutsummaryrefslogtreecommitdiff
path: root/dns/powerdns-recursor/Makefile
blob: fddc0b8c3901717554de17fb97f1a2124566432e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# New ports collection makefile for:	powerdns-recursor
# Date Created:				14.Nov 2006
# Whom:					sten@blinkenlights.nl
#
# $FreeBSD$
#

PORTNAME=	powerdns-recursor
PORTVERSION=	3.1.4
PORTREVISION=	3
CATEGORIES=	dns ipv6
MASTER_SITES=	http://downloads.powerdns.com/releases/ \
		http://mirrors.evolva.ro/powerdns.com/releases/
DISTNAME=	pdns-recursor-${PORTVERSION}

MAINTAINER=	sten@blinkenlights.nl
COMMENT=	An advanced DNS recursor

BUILD_DEPENDS=	bjam:${PORTSDIR}/devel/boost

USE_BZIP2=	yes
USE_GMAKE=	yes
USE_GCC=	3.4

OPTIONS=	STATIC	"Enable Full STATIC" off

CXXFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

MAKE_ENV+=	CXX="${CXX}" CC="${CC}"

MAN8=		rec_control.8 pdns_recursor.8
SUB_FILES=	pkg-message

.include <bsd.port.pre.mk>

USE_RC_SUBR+=	pdns-recursor

.if defined(WITH_STATIC)
MAKE_ENV+=STATIC=full
PLIST_SUB+=	STATIC="@comment "
.else
MAKE_ENV+=STATIC=semi
PLIST_SUB+=	STATIC=""
.endif

.if ${OSVERSION} < 500000
BROKEN=		Does not compile on 4.x
.endif

.if exists(/usr/include/ucontext.h) && ${OSVERSION} >= 500000
UCONTEXT!=	${AWK} '/setcontext/ { print "YES" }' \
		/usr/include/ucontext.h
.if ${UCONTEXT} == ""
BROKEN=		requires setcontext()
.endif
.endif

post-patch:
	@${REINPLACE_CMD} -e 's;SBINDIR=/usr/sbin/;SBINDIR=${PREFIX}/sbin/;' \
	   -e 's;BINDIR=/usr/bin/;BINDIR=${PREFIX}/bin/;' \
	   -e 's;CONFIGDIR="/etc/powerdns/";CONFIGDIR=${PREFIX}/etc/pdns/;' \
		${WRKSRC}/Makefile
	@${REINPLACE_CMD} -e 's;"/etc/powerdns/";"${PREFIX}/etc/pdns/";' \
		${WRKSRC}/config.h

pre-install:
		@${ECHO} "==>  Creating custom user to run pdns_recursor..."
		@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL

post-install:
.if !exists(${PREFIX}/etc/pdns/recursor.conf)
	${INSTALL_DATA} ${PREFIX}/etc/pdns/recursor.conf-dist \
		${PREFIX}/etc/pdns/recursor.conf
.endif
	@${INSTALL_MAN} ${WRKSRC}/*.8 ${PREFIX}/man/man8/
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>