1#! /bin/sh
2# $OpenLDAP$
3## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4##
5## Copyright 1998-2021 The OpenLDAP Foundation.
6## All rights reserved.
7##
8## Redistribution and use in source and binary forms, with or without
9## modification, are permitted only as authorized by the OpenLDAP
10## Public License.
11##
12## A copy of this license is available in the file LICENSE in the
13## top-level directory of the distribution or, alternatively, at
14## <http://www.OpenLDAP.org/license.html>.
15if [ x"$WITH_SASL" = x"yes" -a x"$USE_SASL" != x"no" ] ; then
16	SASL="sasl"
17	if [ x"$USE_SASL" = x"yes" ] ; then
18		USE_SASL=DIGEST-MD5
19	fi
20	SASL_MECH="\"saslmech=$USE_SASL\""
21else
22	SASL="nosasl"
23	SASL_MECH=
24fi
25sed -e "s/@BACKEND@/${BACKEND}/"			\
26	-e "s/^#${BACKEND}#//"				\
27	-e "/^#~/s/^#[^#]*~${BACKEND}~[^#]*#/#omit: /"	\
28		-e "s/^#~[^#]*~#//"			\
29	-e "s/@RELAY@/${RELAY}/"			\
30	-e "s/^#relay-${RELAY}#//"			\
31	-e "s/^#${BACKENDTYPE}#//"			\
32	-e "s/^#${AC_TLS_TYPE}#//"			\
33	-e "s/^#${AC_ldap}#//"				\
34	-e "s/^#${AC_meta}#//"				\
35	-e "s/^#${AC_asyncmeta}#//"			\
36	-e "s/^#${AC_relay}#//"				\
37	-e "s/^#${AC_sql}#//"				\
38	-e "s/^#${RDBMS}#//"			\
39	-e "s/^#${AC_accesslog}#//"			\
40	-e "s/^#${AC_dds}#//"				\
41	-e "s/^#${AC_deref}#//"				\
42	-e "s/^#${AC_dynlist}#//"			\
43	-e "s/^#${AC_homedir}#//"			\
44	-e "s/^#${AC_pcache}#//"			\
45	-e "s/^#${AC_ppolicy}#//"			\
46	-e "s/^#${AC_refint}#//"			\
47	-e "s/^#${AC_retcode}#//"			\
48	-e "s/^#${AC_remoteauth}#//"			\
49	-e "s/^#${AC_rwm}#//"				\
50	-e "s/^#${AC_syncprov}#//"			\
51	-e "s/^#${AC_translucent}#//"			\
52	-e "s/^#${AC_unique}#//"			\
53	-e "s/^#${AC_valsort}#//"			\
54	-e "s/^#${INDEXDB}#//"				\
55	-e "s/^#${MAINDB}#//"				\
56	-e "s/^#${SASL}#//"				\
57	-e "s/^#${ACI}#//"				\
58	-e "s;@URI1@;${URI1};"				\
59	-e "s;@URI2@;${URI2};"				\
60	-e "s;@URI3@;${URI3};"				\
61	-e "s;@URI4@;${URI4};"				\
62	-e "s;@URI5@;${URI5};"				\
63	-e "s;@URI6@;${URI6};"				\
64	-e "s;@PORT1@;${PORT1};"			\
65	-e "s;@PORT2@;${PORT2};"			\
66	-e "s;@PORT3@;${PORT3};"			\
67	-e "s;@PORT4@;${PORT4};"			\
68	-e "s;@PORT5@;${PORT5};"			\
69	-e "s;@PORT6@;${PORT6};"			\
70	-e "s;@SURI1@;${SURI1};"			\
71	-e "s;@SURI2@;${SURI2};"			\
72	-e "s;@SURI3@;${SURI3};"			\
73	-e "s;@SURI4@;${SURI4};"			\
74	-e "s;@SURI5@;${SURI5};"			\
75	-e "s;@SURI6@;${SURI6};"			\
76	-e "s;@URIP1@;${URIP1};"			\
77	-e "s;@URIP2@;${URIP2};"			\
78	-e "s;@URIP3@;${URIP3};"			\
79	-e "s;@URIP4@;${URIP4};"			\
80	-e "s;@URIP5@;${URIP5};"			\
81	-e "s;@URIP6@;${URIP6};"			\
82	-e "s;@SURIP1@;${SURIP1};"			\
83	-e "s;@SURIP2@;${SURIP2};"			\
84	-e "s;@SURIP3@;${SURIP3};"			\
85	-e "s;@SURIP4@;${SURIP4};"			\
86	-e "s;@SURIP5@;${SURIP5};"			\
87	-e "s;@SURIP6@;${SURIP6};"			\
88	-e "s/@SASL_MECH@/${SASL_MECH}/"		\
89	-e "s;@TESTDIR@;${TESTDIR};"			\
90	-e "s;@TESTWD@;${TESTWD};"			\
91	-e "s;@DATADIR@;${DATADIR};"			\
92	-e "s;@SCHEMADIR@;${SCHEMADIR};"		\
93	-e "s;@KRB5REALM@;${KRB5REALM};"		\
94	-e "s;@KDCHOST@;${KDCHOST};"			\
95	-e "s;@KDCPORT@;${KDCPORT};"			\
96	-e "s;@TIMEOUT@;${TIMEOUT};"			\
97	-e "/^#/d"
98