summaryrefslogtreecommitdiff
path: root/databases/openldap/Makefile
blob: 2e1a72aae51acc008d4e29c23fda5a9b995ecea8 (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
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
# $NetBSD: Makefile,v 1.44 2002/08/01 05:48:07 jlam Exp $

DISTNAME=	openldap-2.0.23
SVR4_PKGNAME=	oldap
CATEGORIES=	databases
MASTER_SITES=	ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/
EXTRACT_SUFX=	.tgz

MAINTAINER=	packages@netbsd.org
HOMEPAGE=	http://www.OpenLDAP.org/
COMMENT=	Lightweight directory access protocol server and client package

CONFLICTS+=	ldapsdk-[0-9]*

USE_BUILDLINK_ONLY=	YES
REPLACE_BUILDLINK_SED+=	-e "s|-L${WRKSRC}/libraries||g"

USE_LIBTOOL=		YES
LTCONFIG_OVERRIDE=	${WRKSRC}/build/ltconfig

# unfortunately, --enable-phonetic cannot be disabled by runtime configuration
GNU_CONFIGURE=		YES
CONFIGURE_ARGS+=	--enable-dnssrv
CONFIGURE_ARGS+=	--enable-cldap
CONFIGURE_ARGS+=	--enable-passwd
CONFIGURE_ARGS+=	--enable-shell
CONFIGURE_ARGS+=	--enable-wrappers
CONFIGURE_ARGS+=	--with-tls=openssl
CONFIGURE_ARGS+=	--without-readline

PKG_SYSCONFSUBDIR=	openldap
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFBASE}
CONFIGURE_ARGS+=	--localstatedir=/var/openldap

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "SunOS"
.include "../../databases/db/buildlink.mk"
CPPFLAGS+=	-I${BUILDLINK_DIR}/include/db2
LIBS=		-ldb2 -lpthread -lrt
.endif

.if defined(USE_SASL) && (${USE_SASL} == "YES")
.include "../../security/cyrus-sasl/buildlink.mk"
CONFIGURE_ARGS+=	--with-cyrus-sasl
CONFIGURE_ARGS+=	--enable-spasswd
.endif

.if defined(KERBEROS)
PKG_USE_KERBEROS=	YES
CONFIGURE_ARGS+=	--with-kerberos
.else
CONFIGURE_ARGS+=	--without-kerberos
.endif

EGDIR=		${PREFIX}/share/examples/openldap
MAKE_DIRS=	${PKG_SYSCONFDIR} ${PKG_SYSCONFDIR}/schema
OWN_DIRS=	/var/openldap
OWN_DIRS_PERMS=	/var/openldap/openldap-ldbm ${ROOT_USER} ${ROOT_GROUP} 0700
OWN_DIRS_PERMS+=/var/openldap/openldap-slurp ${ROOT_USER} ${ROOT_GROUP} 0700

CNFS=		ldap.conf ldapfilter.conf ldaptemplates.conf		\
		ldapsearchprefs.conf
CNFS_PERMS=	slapd.conf
SUPPS=		schema/corba.schema schema/core.schema			\
		schema/cosine.schema schema/inetorgperson.schema	\
		schema/java.schema schema/krb5-kdc.schema		\
		schema/misc.schema schema/nis.schema			\
		schema/openldap.schema

CONF_FILES=		# empty
CONF_FILES_PERMS=	# empty
SUPPORT_FILES=		# empty
.for FILE in ${CNFS}
CONF_FILES+=		${EGDIR}/${FILE} ${PKG_SYSCONFDIR}/${FILE}
.endfor
.for FILE in ${CNFS_PERMS}
CONF_FILES_PERMS+=	${EGDIR}/${FILE} ${PKG_SYSCONFDIR}/${FILE}	\
			${ROOT_USER} ${ROOT_GROUP} 0600
.endfor
.for FILE in ${SUPPS}
SUPPORT_FILES+=		${EGDIR}/${FILE} ${PKG_SYSCONFDIR}/${FILE}
.endfor
RCD_SCRIPTS=		slapd

post-build:
	@for script in ${RCD_SCRIPTS}; do				\
		${SED} ${FILES_SUBST_SED} ${FILESDIR}/$${script}.sh	\
			> ${WRKDIR}/$${script};				\
	done

post-install:
	for script in ${RCD_SCRIPTS}; do				\
		${INSTALL_SCRIPT} ${WRKDIR}/$${script}			\
			${PREFIX}/etc/rc.d/$${script};			\
	done
	${INSTALL_DATA_DIR} ${EGDIR}/schema
	for file in ${CNFS} ${CNFS_PERMS} ${SUPPS}; do			\
		if [ ! -e ${PKG_SYSCONFDIR}/$${file}.default ]; then	\
			${CP} -p ${PKG_SYSCONFDIR}/$${file}		\
				${PKG_SYSCONFDIR}/$${file}.default;	\
		fi;							\
		${INSTALL_DATA} ${PKG_SYSCONFDIR}/$${file}.default	\
			${EGDIR}/$${file};				\
		${RM} -f ${PKG_SYSCONFDIR}/$${file}.default;		\
	done

test:
	-@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} \
		${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKEFILE} test

.include "../../security/openssl/buildlink.mk"
.include "../../security/tcp_wrappers/buildlink.mk"
.include "../../mk/pthread.buildlink.mk"

.if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} != "none")
CONFIGURE_ARGS+=	--with-threads
PLIST_SRC=		${.CURDIR}/PLIST.slurpd ${.CURDIR}/PLIST
.endif

.include "../../mk/bsd.pkg.install.mk"
.include "../../mk/bsd.pkg.mk"