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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
# New ports collection makefile for: openldap22-server
# Date created: 10 Jul 2003
# Whom: Oliver Eikemeier
#
# $FreeBSD$
#
PORTNAME= openldap
PORTVERSION= ${OPENLDAP_VERSION}.a
PORTREVISION= ${OPENLDAP_PORTVERSION}
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
http://public.planetmirror.com/pub/openldap/%SUBDIR%/ \
ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/%SUBDIR%/ \
ftp://ftp.matrix.com.br/pub/openldap/%SUBDIR%/ \
ftp://ftp.ucr.ac.cr/pub/Unix/openldap/%SUBDIR%/ \
ftp://ftp.ntua.gr/mirror/OpenLDAP/%SUBDIR%/ \
ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/%SUBDIR%/ \
ftp://ftp.u-aizu.ac.jp/pub/net/openldap/%SUBDIR%/ \
ftp://ftp.holywar.net/pub/OpenLDAP/%SUBDIR%/ \
ftp://ftp.nl.uu.net/pub/unix/db/openldap/%SUBDIR%/ \
ftp://ftp.linux.pt/pub/mirrors/OpenLDAP/%SUBDIR%/ \
ftp://ftp.rediris.es/mirror/OpenLDAP/%SUBDIR%/ \
ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/%SUBDIR%/ \
http://openldap.cdpa.nsysu.edu.tw/OpenLDAP/%SUBDIR%/ \
ftp://ftp.plig.org/pub/OpenLDAP/%SUBDIR%/
MASTER_SITE_SUBDIR= openldap-test
PKGNAMESUFFIX= ${OPENLDAP_PKGNAMESUFFIX}
DISTNAME= openldap-${OPENLDAP_VERSION}alpha
EXTRACT_SUFX= .tgz
MAINTAINER= eikemeier@fillmore-labs.com
COMMENT?= Open source LDAP server implementation
OPENLDAP_VERSION= 2.2.0
LATEST_LINK= ${PKGNAMEPREFIX}openldap22${PKGNAMESUFFIX}
CONFLICTS= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-*
WANT_OPENLDAP_VER?= 22
.if ${WANT_OPENLDAP_VER} != 22
BROKEN= "incompatible OpenLDAP version: ${WANT_OPENLDAP_VER}"
.endif
.if defined(CLIENT_ONLY)
OPENLDAP_PORTVERSION= 0
OPENLDAP_PKGNAMESUFFIX?=-client
OPENLDAP_PKGFILESUFX?= .client
.else
OPENLDAP_PORTVERSION= 0
OPENLDAP_PKGNAMESUFFIX?=-server
OPENLDAP_PKGFILESUFX?=
LIB_DEPENDS+= ldap.2:${PORTSDIR}/net/openldap22-client
.endif
USE_OPENSSL= yes
USE_REINPLACE= yes
USE_LIBTOOL_VER= 14
DESCR= ${PKGDIR}/pkg-descr${OPENLDAP_PKGFILESUFX}
PLIST= ${WRKDIR}/pkg-plist
PKGINSTALL= ${WRKDIR}/pkg-install
PKGMESSAGE= ${WRKDIR}/pkg-message
LOCALSTATEDIR?= ${DESTDIR}/var/db
LDAP_RUN_DIR?= ${DESTDIR}/var/run/openldap
PLIST_SUB+= LOCALSTATEDIR=${LOCALSTATEDIR} \
LDAP_RUN_DIR=${LDAP_RUN_DIR}
SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%LDAP_RUN_DIR%%,${LDAP_RUN_DIR},g' \
-e 's,%%LOCALSTATEDIR%%,${LOCALSTATEDIR},g'
CONFIGURE_ARGS= --with-threads \
--with-tls=openssl \
--enable-dynamic
.if defined(WITH_SASL)
LIB_DEPENDS+= sasl2.2:${PORTSDIR}/security/cyrus-sasl2
CONFIGURE_ARGS+= --with-cyrus-sasl
.else
CONFIGURE_ARGS+= --without-cyrus-sasl
.endif
.if defined(CLIENT_ONLY)
# client specific configuration
CONFIGURE_ARGS+= --disable-slapd
INSTALLS_SHLIB= yes
.else
# server specific configuration
EXTRA_PATCHES+= ${FILESDIR}/extrapatch-Makefile.in
CONFIGURE_ARGS+= --localstatedir=${LOCALSTATEDIR} \
--enable-ldbm \
--with-ldbm-api=berkeley \
--enable-lmpasswd \
--enable-ldap \
--enable-meta \
--enable-rewrite \
--enable-null \
--enable-monitor
WITH_BDB_VER?= 41
.if ${WITH_BDB_VER} == 41
LIB_DEPENDS+= db41.1:${PORTSDIR}/databases/db41
CONFIGURE_ARGS+= --enable-bdb
.elif ${WITH_BDB_VER} == 4
LIB_DEPENDS+= db4.0:${PORTSDIR}/databases/db4
CONFIGURE_ARGS+= --disable-bdb
.elif ${WITH_BDB_VER} == 3
LIB_DEPENDS+= db3.3:${PORTSDIR}/databases/db3
CONFIGURE_ARGS+= --disable-bdb
.else
.error WITH_BDB_VER must be 3, 4 or 41
.endif
LIBS+= -ldb${WITH_BDB_VER}
CPPFLAGS+= -I${LOCALBASE}/include/db${WITH_BDB_VER}
.if defined(WITH_SHELL)
CONFIGURE_ARGS+= --enable-shell
.endif
.if defined(WITH_PERL)
USE_PERL5= yes
CONFIGURE_ARGS+= --enable-perl
.endif
.if defined(WITH_SASL)
CONFIGURE_ARGS+= --enable-spasswd
.endif
.if defined(WITH_ODBC)
LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
CONFIGURE_ARGS+= --enable-sql
.endif
.if defined(WITH_SLAPI)
LIB_DEPENDS+= ltdl.4:${PORTSDIR}/devel/libltdl
CONFIGURE_ARGS+= --enable-slapi
PLIST_SUB+= SLAPI=""
.else
PLIST_SUB+= SLAPI="@comment "
.endif
# Include tcp-wrapper support
.if !defined(WITHOUT_TCP_WRAPPERS) && exists(/usr/include/tcpd.h)
CONFIGURE_ARGS+= --enable-wrappers
.endif
# end of client/server specific configuration
.endif
# math.h uses _REENTRANT and stdio.h uses _THREAD_SAFE, so define both.
CPPFLAGS+= -D_REENTRANT ${PTHREAD_CFLAGS} \
-I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}" \
LIBS="${LIBS}"
.include <bsd.port.pre.mk>
.if defined(CLIENT_ONLY)
.include "${FILESDIR}/manpages"
.endif
pre-everything::
@${ECHO} "============================================================="
@${ECHO}
@${ECHO} "You can build ${PKGNAME} with the following options:"
@${ECHO}
.if defined(CLIENT_ONLY)
@${ECHO} "WITH_SASL with (Cyrus) SASL2 support"
.else
@${ECHO} "WITH_BDB_VER select BerkeleyDB version (default 4.1)"
@${ECHO} "WITH_SASL with (Cyrus) SASL2 password verification"
@${ECHO} "WITH_PERL with Perl backend"
@${ECHO} "WITH_SHELL with Shell backend"
@${ECHO} "WITH_ODBC with SQL backend"
@${ECHO} "WITH_SLAPI with Netscape SLAPI plugin API
@${ECHO} "WITHOUT_TCP_WRAPPERS without tcp wrapper support"
.endif
@${ECHO}
@${ECHO} "============================================================="
@${ECHO}
post-patch:
@${REINPLACE_CMD} -e 's,%LOCALSTATEDIR%/slapd\.,${LDAP_RUN_DIR}/slapd.,g' \
${WRKSRC}/servers/slapd/slapd.conf
pre-configure:
@${REINPLACE_CMD} -e '/^LIBTOOL=/s,\$$(top_builddir)/libtool,${LIBTOOL},g' \
${WRKSRC}/configure
post-build:
.for script in slapd.sh slurpd.sh
@${SED} ${SED_SCRIPT} ${FILESDIR}/${script} >${WRKDIR}/${script}
.endfor
.for text in pkg-install pkg-message
@if [ -f ${MASTERDIR}/${text}${OPENLDAP_PKGFILESUFX} ]; then \
${SED} ${SED_SCRIPT} ${MASTERDIR}/${text}${OPENLDAP_PKGFILESUFX} \
>${WRKDIR}/${text}; \
fi
.endfor
.if !defined(CLIENT_ONLY)
test: build
@cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} test
.endif
pre-install:
@${CP} ${MASTERDIR}/pkg-plist${OPENLDAP_PKGFILESUFX} ${PLIST}
.if defined(CLIENT_ONLY)
.if !defined(NOPORTDOCS)
@for dir in rfc drafts; do \
${FIND} ${WRKSRC}/doc/$${dir} -maxdepth 1 -type f \
| ${SED} -e "s,^${WRKSRC}/doc/,%%DOCSDIR%%/," \
>>${PLIST}; \
${ECHO_CMD} "@dirrm %%DOCSDIR%%/$${dir}" >>${PLIST}; \
done
@${ECHO_CMD} "@dirrm %%DOCSDIR%%" >>${PLIST}
.endif
.endif
post-install:
.if defined(CLIENT_ONLY)
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@for dir in rfc drafts; do \
${MKDIR} ${DOCSDIR}/$${dir}; \
${FIND} ${WRKSRC}/doc/$${dir} -maxdepth 1 -type f \
-exec ${INSTALL_DATA} {} ${DOCSDIR}/$${dir} \; ; \
done
.endif
.else
.for script in slapd.sh slurpd.sh
@${INSTALL_SCRIPT} ${WRKDIR}/${script} ${PREFIX}/etc/rc.d/${script}
.endfor
@${MKDIR} ${LDAP_RUN_DIR}
.endif
@${CAT} ${PKGMESSAGE}
.include "${.CURDIR}/../openldap20-server/bsd.openldap.mk"
.include <bsd.port.post.mk>
|