aboutsummaryrefslogtreecommitdiffstats
path: root/net/bind9-dlz/Makefile
blob: f0d4457938b9f3aac92ca9726e414d036e2304d0 (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# New ports collection makefile for:    bind-dlz
# Date Created:             08 Jun 2002
# Whom:                 dirk.meyer@dinoex.sub.org
#
# $FreeBSD$
#

PORTNAME=   bind9
PORTVERSION=    ${ISCVERSION}+${DLZVERSION}
CATEGORIES= net ipv6
MASTER_SITES=   ${MASTER_SITE_ISC} \
        ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/bind9/${ISCVERSION}/,} \
        ${MASTER_SITES_DLZ:S/$/:dlz/}
MASTER_SITE_SUBDIR= bind-dlz/:dlz
PKGNAMESUFFIX=  -dlz
DISTFILES=  bind-${ISCVERSION}.tar.gz \
        DLZ-${DLZVERSION}${EXTRACT_SUFX}:dlz

MAINTAINER= dinoex@FreeBSD.org
COMMENT=    The Berkeley Internet Name Daemon, with DLZ extensions

POSTGRESQL_PORT?=   databases/postgresql7
MASTER_SITES_DLZ=   ${MASTER_SITE_SOURCEFORGE}

ISCVERSION= 9.2.2
DLZVERSION= 0.4.3
USE_SUBMAKE=    YES
GNU_CONFIGURE=  YES
CONFIGURE_ARGS= --localstatedir=/var --disable-linux-caps

# use user config if possible
.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
.else
.if defined(BATCH)
# default package, can be configured in /etc/make.conf
BINDDLZ_OPTIONS?=   \"OpenSSL\" \"PostgreSQL\" \"FileSystem\"
.endif
# make INDEX match
NO_DESCRIBE=yes
.endif

.if defined(WITH_POSTGRESQL_DRIVER)
.if !defined(WITHOUT_POSTGRESQL_DRIVER)
LIB_DEPENDS=    pq.3:${PORTSDIR}/${POSTGRESQL_PORT}
CONFIGURE_ARGS+=    --with-dlz-postgres
.endif
.endif

.if defined(WITH_MYSQL_DRIVER)
LIB_DEPENDS+=   mysqlclient.10:${PORTSDIR}/databases/mysql323-client
CONFIGURE_ARGS+=    --with-dlz-mysql
.endif

.if defined(WITH_FILESYSTEM_DRIVER)
.if !defined(WITHOUT_FILESYSTEM_DRIVER)
CONFIGURE_ARGS+=    --with-dlz-filesystem
.endif
.endif

.if defined(WITH_STUB_DRIVER)
CONFIGURE_ARGS+=    --with-dlz-stub
.endif

WRKSRC=     ${WRKDIR}/bind-${ISCVERSION}
EXTRA_PATCHES=  ${WRKDIR}/dlz.patch
PLIST=      ${WRKDIR}/.PLIST.more

SCRIPTS_ENV=    WRKDIRPREFIX="${WRKDIRPREFIX}" \
            CURDIR2="${.CURDIR}" \
        MKDIR="${MKDIR}" \
        DISTNAME="${DISTNAME}" \
        BINDDLZ_OPTIONS="${BINDDLZ_OPTIONS}"

DOCSDIR=    ${PREFIX}/share/doc/bind9
EXTRA_DOCSDIR=  share/doc/bind9-dlz
EXTRA_FIX=  ${WRKSRC}/configure
DOCS=       README.txt bind_dlz.txt changelog.txt \
        dlz_filesystem_driver.txt dlz_interface.txt \
        dlz_mysql_driver.txt dlz_postgres_driver.txt \
        dlz_stub_driver.txt sdlz_helper.txt sdlz_interface.txt

MAN1=   dig.1 host.1
MAN3=   lwres.3 lwres_addr_parse.3 lwres_buffer.3 lwres_buffer_add.3 \
    lwres_buffer_back.3 lwres_buffer_clear.3 lwres_buffer_first.3 \
    lwres_buffer_forward.3 lwres_buffer_getmem.3 lwres_buffer_getuint16.3 \
    lwres_buffer_getuint32.3 lwres_buffer_getuint8.3 lwres_buffer_init.3 \
    lwres_buffer_invalidate.3 lwres_buffer_putmem.3 \
    lwres_buffer_putuint16.3 lwres_buffer_putuint32.3 \
    lwres_buffer_putuint8.3 lwres_buffer_subtract.3 lwres_conf_clear.3 \
    lwres_conf_get.3 lwres_conf_init.3 lwres_conf_parse.3 \
    lwres_conf_print.3 lwres_config.3 lwres_context.3 \
    lwres_context_allocmem.3 lwres_context_create.3 \
    lwres_context_destroy.3 lwres_context_freemem.3 \
    lwres_context_initserial.3 lwres_context_nextserial.3 \
    lwres_context_sendrecv.3 lwres_endhostent.3 lwres_endhostent_r.3 \
    lwres_freeaddrinfo.3 lwres_freehostent.3 lwres_gabn.3 \
    lwres_gabnrequest_free.3 lwres_gabnrequest_parse.3 \
    lwres_gabnrequest_render.3 lwres_gabnresponse_free.3 \
    lwres_gabnresponse_parse.3 lwres_gabnresponse_render.3 \
    lwres_gai_strerror.3 lwres_getaddrinfo.3 lwres_getaddrsbyname.3 \
    lwres_gethostbyaddr.3 lwres_gethostbyaddr_r.3 lwres_gethostbyname.3 \
    lwres_gethostbyname2.3 lwres_gethostbyname_r.3 lwres_gethostent.3 \
    lwres_gethostent_r.3 lwres_getipnode.3 lwres_getipnodebyaddr.3 \
    lwres_getipnodebyname.3 lwres_getnamebyaddr.3 lwres_getnameinfo.3 \
    lwres_getrrsetbyname.3 lwres_gnba.3 lwres_gnbarequest_free.3 \
    lwres_gnbarequest_parse.3 lwres_gnbarequest_render.3 \
    lwres_gnbaresponse_free.3 lwres_gnbaresponse_parse.3 \
    lwres_gnbaresponse_render.3 lwres_herror.3 lwres_hstrerror.3 \
    lwres_inetntop.3 lwres_lwpacket_parseheader.3 \
    lwres_lwpacket_renderheader.3 lwres_net_ntop.3 lwres_noop.3 \
    lwres_nooprequest_free.3 lwres_nooprequest_parse.3 \
    lwres_nooprequest_render.3 lwres_noopresponse_free.3 \
    lwres_noopresponse_parse.3 lwres_noopresponse_render.3 \
    lwres_packet.3 lwres_resutil.3 lwres_sethostent.3 \
    lwres_sethostent_r.3 lwres_string_parse.3
MAN5=   rndc.conf.5
MAN8=   dnssec-keygen.8 dnssec-makekeyset.8 dnssec-signkey.8 dnssec-signzone.8 \
    lwresd.8 named-checkconf.8 named-checkzone.8 named.8 nsupdate.8 \
    rndc-confgen.8 rndc.8

pre-everything::
    @ ${SETENV} ${SCRIPTS_ENV} ${SH} ${FILESDIR}/configure.bind9-dlz

pre-patch:
.for FILE in dlz.patch
    @ ${MV} ${WRKDIR}/${FILE} ${WRKDIR}/${FILE}.sed
    ${SED} -e "s=bind-${ISCVERSION}/==" \
        ${WRKDIR}/${FILE}.sed | tr -d '\r' > ${WRKDIR}/${FILE}
.endfor

post-patch:
    @ ${MV} ${EXTRA_FIX} ${EXTRA_FIX}.sed
    ${SED} -e "s=-lnsl==" ${EXTRA_FIX}.sed > ${EXTRA_FIX}
    @ ${CHMOD} +x ${EXTRA_FIX}
.for FILE in check/named-checkconf.8 named/named.8 nsupdate/nsupdate.8 \
    rndc/rndc.8
    @ ${MV} ${WRKSRC}/bin/${FILE} ${WRKSRC}/bin/${FILE}.sed
    ${SED} -e 's#/etc/named.conf#${PREFIX}/etc/named.conf#g' \
        -e 's#/etc/rndc.conf#${PREFIX}/etc/rndc.conf#g' \
        ${WRKSRC}/bin/${FILE}.sed > ${WRKSRC}/bin/${FILE}
.endfor
    ${MV} -f ${WRKSRC}/bin/Makefile.in.orig ${WRKSRC}/bin/Makefile.in 

pre-configure:
    @${ECHO_CMD} "configure: ${CONFIGURE_ARGS}"

pre-install:
    ${CAT} ${MASTERDIR}/pkg-plist >${PLIST}
.if !defined(NOPORTDOCS)
.for i in ${DOCS}
    @${ECHO_CMD} `${BASENAME} ${i}` | \
    ${AWK} '{print "${EXTRA_DOCSDIR}/" $$1}' >>${PLIST}
.endfor
    @${ECHO_CMD} "@dirrm ${EXTRA_DOCSDIR}" >>${PLIST}
.endif

post-install:
    ${INSTALL_DATA} ${WRKSRC}/bin/rndc/rndc.conf \
        ${PREFIX}/etc/rndc.conf.sample
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}/arm ${DOCSDIR}/misc
    ${INSTALL_DATA} ${WRKSRC}/doc/arm/Bv9ARM*html ${DOCSDIR}/arm
    ${INSTALL_DATA} ${WRKSRC}/doc/misc/[a-z]* ${DOCSDIR}/misc
    ${CP} ${WRKSRC}/CHANGES ${WRKSRC}/COPYRIGHT ${WRKSRC}/FAQ \
        ${WRKSRC}/README ${DOCSDIR}/
    ${MKDIR} ${PREFIX}/${EXTRA_DOCSDIR}
    @cd ${WRKDIR} && ${INSTALL_DATA} ${DOCS} ${PREFIX}/${EXTRA_DOCSDIR}/
.endif

post-clean:
    @ ${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc

.include <bsd.port.pre.mk>

.if defined(WITH_OPENSSL)
.if !defined(WITHOUT_OPENSSL)
.include "${PORTSDIR}/security/openssl/bsd.openssl.mk"
CONFIGURE_ARGS+=    --with-openssl=${OPENSSLBASE}
.endif
.endif

.if ${OSVERSION} > 500030
CONFIGURE_ARGS+=    --enable-threads
.else
CONFIGURE_ARGS+=    --disable-threads
.endif

.if defined(NO_DESCRIBE)
describe:
.if defined(BATCH)
    @ ${SETENV} ${SCRIPTS_ENV} ${SH} ${FILESDIR}/configure.bind9-dlz
.endif
    @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} BATCH=yes ${.TARGET}
.endif

.include <bsd.port.post.mk>