summaryrefslogtreecommitdiff
path: root/dns/ldns/Makefile
blob: a8c8d4100043e224b0c9b12fda17df71617c1455 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Created by: Konstantin Saurbier <saurbier@math.uni-bielefeld.de>
# $FreeBSD$

PORTNAME=	ldns
PORTVERSION=	1.7.0
PORTREVISION=	1
CATEGORIES=	dns
MASTER_SITES=	http://www.nlnetlabs.nl/downloads/ldns/ \
		LOCAL/ehaupt

MAINTAINER=	jaap@NLnetLabs.nl
COMMENT=	Library for programs conforming to DNS RFCs and drafts

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

GNU_CONFIGURE=	yes
USES=		cpe gmake libtool ssl perl5
USE_PERL5=	build
CPE_VENDOR=	nlnetlabs
USE_LDCONFIG=	yes

CONFIGURE_ARGS+=	--with-ssl=${OPENSSLBASE} --disable-dane-ta-usage

.if ! (defined(BUILD_PYLDNS) || defined(BUILD_P5PERL))
OPTIONS_DEFINE=	DOXYGEN EXAMPLES DRILL
OPTIONS_DEFAULT=	DRILL

DRILL_DESC=	With drill program

.endif

DOXYGEN_BUILD_DEPENDS=	doxygen:devel/doxygen
HTMLDOCS=	doc/html/*

OPTIONS_DEFINE+=	GOST DANETAUSAGE \
		RRTYPENINFO RRTYPERKEY RRTYPETA RRTYPEAVC 

DANETAUSAGE_DESC=	Enable ta uasage, requires openssl >= 1.1.0
GOST_DESC=		GOST signatures enabled, requires openssl >= 1.0.0
RRTYPENINFO_DESC=	Enable draft RR type ninfo.
RRTYPERKEY_DESC=	Enable draft RR type rkey.
RRTYPETA_DESC=		Enable draft RR type ta.
RRTYPEAVC_DESC=		Enable draft RR type avc.

OPTIONS_SUB=	yes

DANETAUSAGE_CONFIGURE_ENABLE=	dane-ta-usage
DANETAUSAGE_IMPLIES=		RRTYPETA
GOST_CONFIGURE_ENABLE=		gost
RRTYPENINFO_CONFIGURE_ENABLE=	rrtype-ninfo
RRTYPERKEY_CONFIGURE_ENABLE=	rrtype-rkey
RRTYPETA_CONFIGURE_ENABLE=	rrtype-ta
RRTYPEAVC_CONFIGURE_ENABLE=	rrtype-avc
EXAMPLES_CONFIGURE_WITH=	examples
DRILL_CONFIGURE_WITH=		drill
DRILL_INSTALL_TARGET=	install-drill
EXAMPLES_INSTALL_TARGET=	install-examples

.if defined(BUILD_PYLDNS)
USES+=		python
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
ALL_TARGET=	pyldns
INSTALL_TARGET=	install-pyldns

CONFIGURE_ARGS+=--with-pyldns
LIB_DEPENDS+=	libldns.so:dns/ldns
BUILD_DEPENDS+=	${LOCALBASE}/bin/swig:devel/swig13
CFLAGS+=	-I${OPENSSLINC}

post-patch:
	@${REINPLACE_CMD} \
		-e 's=-I./include/ldns=-I${LOCALBASE}/include/ldns=' \
		${WRKSRC}/Makefile.in
.elif defined(BUILD_P5PERL)
USES+=		perl5
USE_PERL5=	build run
PKGNAMEPREFIX=	p5-DNS-

ALL_TARGET=	p5-dns-ldns
INSTALL_TARGET=	install-p5-dns-ldns

CONFIGURE_ARGS+=--with-p5-dns-ldns
LIB_DEPENDS+=	libldns.so:dns/ldns
RUN_DEPENDS=	p5-Test-Exception>=0:devel/p5-Test-Exception \
		p5-Devel-CheckLib>=0:devel/p5-Devel-CheckLib
BUILD_DEPENDS=${RUN_DEPENDS}

post-patch:
	@${SED} -i '' -e 's=-I./include/ldns=-I${LOCALBASE}/include/ldns=' ${WRKSRC}/Makefile.in

post-install:
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/DNS/LDNS/LDNS.so
.else
ALL_TARGET=	all
INSTALL_TARGET=	install-lib install-h install-config

.endif # BUILD_PYLDNS || BUILD_P5PERL

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MDANETAUSAGE} && ${SSL_DEFAULT} != openssl-devel
BROKEN=		this option requires openssl >= 1.1.0
.endif

.if ! ${PORT_OPTIONS:MGOST}
NO_GOST=	--disable-gost
.endif

.if ! (defined(BUILD_PYLDNS) || defined(BUILD_P5PERL))

post-build:
.if ${PORT_OPTIONS:MDOXYGEN}
	@(cd  ${WRKSRC}; ${MAKE_CMD} doxygen)
.endif

post-install:
	${INSTALL_DATA} ${WRKSRC}/packaging/libldns.pc \
		 ${STAGEDIR}${PREFIX}/libdata/pkgconfig
	${INSTALL_MAN} ${WRKSRC}/packaging/ldns-config.1 \
		${STAGEDIR}${PREFIX}/man/man1
	${INSTALL_MAN} ${WRKSRC}/doc/man/man3/ldns_*.3 \
		${STAGEDIR}${PREFIX}/man/man3
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}.so.2
.if ${PORT_OPTIONS:MDRILL}
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/drill
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
	for p in ldns-chaos ldns-compare-zones ldns-dane ldns-dpa ldns-gen-zone ldns-key2ds \
		ldns-keyfetcher ldns-keygen ldns-mx ldns-notify ldns-nsec3-hash \
		ldns-read-zone ldns-resolver ldns-revoke ldns-rrsig ldns-signzone \
		ldns-test-edns ldns-testns ldns-update ldns-verify-zone ldns-version \
		ldns-walk ldns-zcat ldns-zsplit ldnsd; do \
			${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/$$p; done
.endif
.if ${PORT_OPTIONS:MDOXYGEN}
	${MKDIR} ${STAGEDIR}${DOCSDIR}/html
	${INSTALL_DATA} ${HTMLDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}/html
.endif

.endif # BUILD_PYLDNS || BUILD_P5PERL

.include <bsd.port.post.mk>