summaryrefslogtreecommitdiff
path: root/net/unbound/Makefile
blob: da9b6b1f7152d53696e8e515ceaad4496466e7a6 (plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# $NetBSD: Makefile,v 1.19 2011/12/20 14:02:02 pettai Exp $

DISTNAME=	unbound-1.4.14
CATEGORIES=	net
MASTER_SITES=	http://www.unbound.net/downloads/

MAINTAINER=	joerg@NetBSD.org
HOMEPAGE=	http://www.unbound.net/
COMMENT=	DNS resolver and recursive server
LICENSE=	modified-bsd

PKG_DESTDIR_SUPPORT=	user-destdir

BUILD_DEFS+=	VARBASE

GNU_CONFIGURE=	yes
USE_LIBTOOL=	yes
USE_TOOLS+=	gmake

CONFIGURE_ARGS+=	--with-ldns=${BUILDLINK_PREFIX.ldns}
CONFIGURE_ARGS+=	--with-libexpat=${BUILDLINK_PREFIX.expat}
CONFIGURE_ARGS+=	--with-pidfile=${VARBASE}/run/unbound.pid
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFBASE}
CONFIGURE_ARGS+=	--enable-allsymbols

# Add the same logic as for ldns, so sha2/gost is configured automatically
CHECK_BUILTIN.openssl=	yes
.include "../../security/openssl/builtin.mk"
CHECK_BUILTIN.openssl=	no
.include "../../security/openssl/buildlink3.mk"

PLIST_VARS+=            sha2 gost
.if defined(USE_BUILTIN.openssl) && !empty(USE_BUILTIN.openssl:M[yY][eE][sS])
PLIST_VARS.gost!=       \
        if ${PKG_ADMIN} pmatch 'openssl>=1.0.0' ${BUILTIN_PKG.openssl:Q}; then \
                ${ECHO} "yes";                                          \
        else                                                            \
                ${ECHO} "no";                                           \
        fi
PLIST_VARS.sha2!=       \
        if ${PKG_ADMIN} pmatch 'openssl>=0.9.8' ${BUILTIN_PKG.openssl:Q}; then \
                ${ECHO} "yes";                                          \
        else                                                            \
                ${ECHO} "no";                                           \
        fi
.else
PLIST_VARS.gost!=       \
        if ${PKG_INFO} -qe 'openssl>=1.0.0'; then                       \
                ${ECHO} yes;                                            \
        else                                                            \
                ${ECHO} no;                                             \
        fi
PLIST_VARS.sha2!=       \
        if ${PKG_INFO} -qe 'openssl>=0.9.8'; then                       \
                ${ECHO} yes;                                            \
        else                                                            \
                ${ECHO} no;                                             \
        fi
.endif
.if ${PLIST_VARS.gost} == "yes"
CONFIGURE_ARGS+=        --enable-gost
.else
CONFIGURE_ARGS+=        --disable-gost
.endif
.if ${PLIST_VARS.sha2} == "yes"
CONFIGURE_ARGS+=        --enable-sha2
.else
CONFIGURE_ARGS+=        --disable-sha2
.endif

SUBST_CLASSES+=		paths
SUBST_STAGE.paths=	post-configure
SUBST_MESSAGE.paths=	Fixing path names
SUBST_FILES.paths=	doc/example.conf doc/*.5 doc/*.8
SUBST_SED.paths=	-e "s|/usr/local|${PREFIX}|"

INSTALL_MAKE_FLAGS+=	\
    configfile=${PREFIX}/share/examples/unbound/unbound.conf

PKG_SYSCONFSUBDIR=	unbound

CONF_FILES+=	share/examples/unbound/unbound.conf \
	${PKG_SYSCONFDIR}/unbound.conf

RCD_SCRIPTS=	unbound

UNBOUND_USER?=	unbound
UNBOUND_GROUP?=	unbound

PKG_GROUPS=	${UNBOUND_GROUP}
PKG_USERS=	${UNBOUND_USER}:${UNBOUND_GROUP}

.include "options.mk"

.include "../../textproc/expat/buildlink3.mk"
.include "../../net/ldns/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"