1 # OpenLDAP
, a license free
(see http
://www.OpenLDAP.org
/license.html
)
3 DESCRIPTION
= "OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol."
4 HOMEPAGE
= "http://www.OpenLDAP.org/license.html"
6 # The OpenLDAP Public License
- see the HOMEPAGE
- defines
7 # the license. www.openldap.org claims this is Open Source
8 #
(see http
://www.openldap.org
), the license appears
to be
9 # basically BSD. opensource.org does
not record this license
10 # at present
(so it is apparently
not OSI certified
).
16 SRC_URI
= "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz"
17 SRC_URI
+= "file://openldap-autoconf.patch;patch=1"
18 # The build tries
to run a host executable
, this fails. The patch
19 # causes the executable
and its
data to be installed instead of
20 # the output
- ucgendat must be run
after the ipkg install
!
21 SRC_URI
+= "file://ucgendat.patch;patch=1"
22 # The original top.mk used INSTALL
, not INSTALL_STRIP_PROGRAM when
23 # installing .so
and executables
, this fails in cross compilation
25 SRC_URI
+= "file://install-strip.patch;patch=1"
30 # The following two variables can be set in a distro
or local.conf
31 #
to switch features on.
Each feature foo defines OPENLDAP_OPTION_foo
32 #
and OPENLDAP_DEPENDS_foo in this file
- to include feature foo add
33 # the two variables into the setting of the options below
(please use
34 #
+= because that means this can be done in
*both
* distro.conf
and
36 OPENLDAP_OPTIONS ?
= ""
37 OPENLDAP_DEPENDS ?
= ""
40 # The following is necessary because it cannot be determined
for a
41 # cross compile automagically.
Select should yield fine on all OE
43 EXTRA_OECONF
+= "--with-yielding-select=yes"
44 # Shared libraries are nice...
45 EXTRA_OECONF
+= "--enable-dynamic"
47 # Disable TLS
to remove the need
for openssl
/libcrypto
48 OPENLDAP_OPTION_tls ?
= "--without-tls"
49 # set the following
to " openssl" to build tls support
50 OPENLDAP_DEPENDS_tls ?
=
51 EXTRA_OECONF
+= "${OPENLDAP_OPTION_tls}"
52 DEPENDS
+= "${OPENLDAP_DEPENDS_tls}"
56 # UNIX crypt
(3) passwd support
:
57 EXTRA_OECONF
+= "--enable-crypt"
59 # Enable dynamic module loading.
If this is
*disabled
* the
60 # dependency on libtool is removed
(to disable set the following
61 #
to variables
to "" in a .conf file
).
62 OPENLDAP_OPTION_modules
+= "lt_cv_dlopen_self=yes --enable-modules"
63 OPENLDAP_DEPENDS_modules
+= "libtool"
64 EXTRA_OECONF
+= " ${OPENLDAP_OPTION_modules}"
65 DEPENDS
+= "${OPENLDAP_DEPENDS_modules}"
69 # The backend must be set by the configuration. This controls the
70 # required database
, the
default database
, bdb
, is turned off but
71 # can be turned back on again
and it
*is
* below
! The monitor backend
72 # is also disabled.
If you try
to change the backends but fail
to
73 # enable a single one the build will fail in an obvious way.
75 EXTRA_OECONF
+= "--disable-bdb --disable-monitor"
77 # Backends
="bdb dnssrv hdb ldap ldbm meta monitor null passwd perl shell sql"
79 # Note that multiple backends can be built. The ldbm backend requires a
80 # build
-time choice of database API. The bdb backend forces this
to be
81 # DB4.
To use the gdbm
(or other
) API the Berkely database module must
82 # be removed from the build.
83 md
= "${libexecdir}/openldap"
85 #
--enable
-bdb enable Berkeley DB backend no|yes|
mod yes
86 # The Berkely DB is the standard choice. This version of OpenLDAP requires
87 # the version
4 implementation
or better.
88 #
To disable this set all three of the following variables
to <empty
> in
89 # a .conf file
(this will allow ldbm
to be build with gdbm
).
90 OPENLDAP_OPTION_bdb ?
= "--enable-bdb=mod"
91 OPENLDAP_DEPENDS_bdb ?
= "db"
92 OPENLDAP_PACKAGE_bdb ?
= "${PN}-backend-bdb"
93 FILES_$
{PN
}-backend
-bdb
= "${md}/back_bdb.so ${md}/back_bdb.la ${md}/back_bdb-*.so.*"
94 EXTRA_OECONF
+= "${OPENLDAP_OPTION_bdb}"
95 DEPENDS
+= "${OPENLDAP_DEPENDS_bdb}"
96 PACKAGES
+= "${OPENLDAP_PACKAGE_bdb}"
98 #
--enable
-dnssrv enable dnssrv backend no|yes|
mod no
99 # This has no dependencies.
100 FILES_$
{PN
}-backend
-dnssrv
= "${md}/back_dnssrv.so ${md}/back_dnssrv.la ${md}/back_dnssrv-*.so.*"
101 EXTRA_OECONF
+= "--enable-dnssrv=mod"
102 PACKAGES
+= "${PN}-backend-dnssrv"
104 #
--enable
-hdb enable Hierarchical DB backend no|yes|
mod no
105 # This forces ldbm
to use Berkeley too
, remove
to use gdbm
106 OPENLDAP_OPTION_hdb ?
= "--enable-hdb=mod"
107 OPENLDAP_DEPENDS_hdb ?
= "db"
108 OPENLDAP_PACKAGE_hdb ?
= "${PN}-backend-hdb"
109 FILES_$
{PN
}-backend
-hdb
= "${md}/back_hdb.so ${md}/back_hdb.la ${md}/back_hdb-*.so.*"
110 EXTRA_OECONF
+= "${OPENLDAP_OPTION_hdb}"
111 DEPENDS
+= "${OPENLDAP_DEPENDS_hdb}"
112 PACKAGES
+= "${OPENLDAP_PACKAGE_hdb}"
114 #
--enable
-ldap enable ldap backend no|yes|
mod no
115 # This has no dependencies
116 EXTRA_OECONF
+= "--enable-ldap=mod"
117 FILES_$
{PN
}-backend
-ldap
= "${md}/back_ldap.so ${md}/back_ldap.la ${md}/back_ldap-*.so.*"
118 PACKAGES
+= "${PN}-backend-ldap"
120 #
--enable
-ldbm enable ldbm backend no|yes|
mod no
121 # ldbm requires further specification of the underlying database API
, because
122 # bdb is enabled above this must be set
to berkeley
, however the config
123 # defaults this correctly so
--with
-ldbm
-api is
*not* set. The build will
124 # fail
if bdb is removed
(above
) but
not database is built
to provide the
125 # support
for ldbm
(because the 'DEPENDS_ldbm' is empty below.
)
127 # So
to use gdbm set
:
128 #OPENLDAP_OPTION_ldbm
= "--enable-ldbm=mod --with-ldbm-api=gdbm"
129 #OPENLDAP_DEPENDS_ldbm
= gdbm
130 #
And clear the bdb
and hdb settings.
131 OPENLDAP_OPTION_ldbm ?
= "--enable-ldbm=mod"
132 OPENLDAP_DEPENDS_ldbm ?
= ""
133 OPENLDAP_PACKAGES_ldbm ?
= "${PN}-backend-ldbm"
134 FILES_$
{PN
}-backend
-ldbm
= "${md}/back_ldbm.so ${md}/back_ldbm.la ${md}/back_ldbm-*.so.*"
135 EXTRA_OECONF
+= "${OPENLDAP_OPTION_ldbm}"
136 DEPENDS
+= "${OPENLDAP_DEPENDS_ldbm}"
137 PACKAGES
+= "${PN}-backend-ldbm"
139 #
--enable
-meta enable metadirectory backend no|yes|
mod no
141 EXTRA_OECONF
+= "--enable-meta=mod"
142 FILES_$
{PN
}-backend
-meta
= "${md}/back_meta.so ${md}/back_meta.la ${md}/back_meta-*.so.*"
143 PACKAGES
+= "${PN}-backend-meta"
145 #
--enable
-monitor enable monitor backend no|yes|
mod yes
146 EXTRA_OECONF
+= "--enable-monitor=mod"
147 FILES_$
{PN
}-backend
-monitor
= "${md}/back_monitor.so ${md}/back_monitor.la ${md}/back_monitor-*.so.*"
148 PACKAGES
+= "${PN}-backend-monitor"
150 #
--enable
-null enable
null backend no|yes|
mod no
151 EXTRA_OECONF
+= "--enable-null=mod"
152 FILES_$
{PN
}-backend
-null = "${md}/back_null.so ${md}/back_null.la ${md}/back_null-*.so.*"
153 PACKAGES
+= "${PN}-backend-null"
155 #
--enable
-passwd enable passwd backend no|yes|
mod no
156 EXTRA_OECONF
+= " --enable-passwd=mod"
157 FILES_$
{PN
}-backend
-passwd
= "${md}/back_passwd.so ${md}/back_passwd.la ${md}/back_passwd-*.so.*"
158 PACKAGES
+= "${PN}-backend-passwd"
160 #
--enable
-perl enable perl backend no|yes|
mod no
161 # This requires a loadable perl dynamic library
, if enabled without
162 # doing something appropriate
(building perl?
) the build will pick
163 # up the build machine perl
- not good.
164 OPENLDAP_OPTION_perl ?
= "--enable-perl=mod"
165 OPENLDAP_DEPENDS_perl ?
= "perl"
166 OPENLDAP_PACKAGES_perl ?
= "${PN}-backend-perl"
167 FILES_$
{PN
}-backend
-perl
= "${md}/back_perl.so ${md}/back_perl.la ${md}/back_perl-*.so.*"
168 #EXTRA_OECONF
+= "${OPENLDAP_OPTION_perl}"
169 #DEPENDS
+= "${OPENLDAP_DEPENDS_perl}"
170 #PACKAGES
+= "${PN}-backend-perl"
172 #
--enable
-shell enable shell backend no|yes|
mod no
173 EXTRA_OECONF
+= "--enable-shell=mod"
174 FILES_$
{PN
}-backend
-shell
= "${md}/back_shell.so ${md}/back_shell.la ${md}/back_shell-*.so.*"
175 PACKAGES
+= "${PN}-backend-shell"
177 #
--enable
-sql enable sql backend no|yes|
mod no
178 # sql requires some sql backend which provides sql.h
, sqlite
* provides
179 # sqlite.h
(which may be compatible but hasn't been tried.
)
180 OPENLDAP_OPTION_sql ?
= "--enable-sql=mod"
181 OPENLDAP_DEPENDS_sql ?
= "sql"
182 OPENLDAP_PACKAGES_sql ?
= "${PN}-backend-sql"
183 FILES_$
{PN
}-backend
-sql
= "${md}/back_sql.so ${md}/back_sql.la ${md}/back_sql-*.so.*"
184 #EXTRA_OECONF
+= "${OPENLDAP_OPTION_sql}"
185 #DEPENDS
+= "${OPENLDAP_DEPENDS_sql}"
186 #PACKAGES
+= "${PN}-backend-sql"
188 #
--enable
-dyngroup Dynamic Group overlay no|yes|
mod no
189 # This is a demo
, Proxy Cache defines init_module which conflicts with the
190 # same symbol in dyngroup
191 #EXTRA_OECONF
+= "--enable-dyngroup=mod"
192 #FILES_$
{PN
}-overlay
-dyngroup
= "${md}/back_dyngroup.so ${md}/back_dyngroup.la ${md}/back_dyngroup-*.so.*"
193 #PACKAGES
+= "${PN}-overlay-dyngroup"
195 #
--enable
-proxycache Proxy Cache overlay no|yes|
mod no
196 EXTRA_OECONF
+= "--enable-proxycache=mod"
197 FILES_$
{PN
}-overlay
-proxycache
= "${md}/pcache.so ${md}/pcache.la ${md}/pcache-*.so.*"
198 PACKAGES
+= "${PN}-overlay-proxycache"
200 #
LOCAL OPTION OVERRIDES
201 # The distro
/lcoal options must be added in
*last*
202 EXTRA_OECONF
+= "${OPENLDAP_OPTIONS}"
203 DEPENDS
+= "${OPENLDAP_DEPENDS}"
206 autotools_stage_includes
207 # Install the
-2.2 versions
, but link foo.so
to foo
-2.2.so ONLY
208 #
if the do
not exist
!
209 oe_libinstall
-so
-C libraries
/libldap
/.libs libldap
-2.2 $
{STAGING_LIBDIR
}
210 test
-e $
{STAGING_LIBDIR
}/libldap.so ||
211 ln
-s $
(basename $
{STAGING_LIBDIR
}/libldap
-2.2.so.
*.
*.
*) $
{STAGING_LIBDIR
}/libldap.so
212 oe_libinstall
-so
-C libraries
/libldap_r
/.libs libldap_r
-2.2 $
{STAGING_LIBDIR
}
213 test
-e $
{STAGING_LIBDIR
}/libldap_r.so ||
214 ln
-s $
(basename $
{STAGING_LIBDIR
}/libldap_r
-2.2.so.
*.
*.
*) $
{STAGING_LIBDIR
}/libldap_r.so
215 oe_libinstall
-so
-C libraries
/liblber
/.libs liblber
-2.2 $
{STAGING_LIBDIR
}
216 test
-e $
{STAGING_LIBDIR
}/liblber.so ||
217 ln
-s $
(basename $
{STAGING_LIBDIR
}/liblber
-2.2.so.
*.
*.
*) $
{STAGING_LIBDIR
}/liblber.so
220 LEAD_SONAME
= "libldap-2.2.so.*"
222 # The executables go in a separate package. This allows the
223 # installation of the libraries with no daemon support.
224 #
Each module also has its own package
- see above.
225 PACKAGES
+= "${PN}-slapd ${PN}-slurpd ${PN}-bin"
227 # Package contents
- shift most standard contents
to -bin
228 FILES_$
{PN
} = "${libdir}/lib*.so.* ${sysconfdir}/openldap/ldap.* ${localstatedir}/openldap-data"
229 FILES_$
{PN
}-slapd
= "${libexecdir}/slapd ${sbindir} ${datadir}/openldap/ucdata \
230 ${localstatedir}/run ${sysconfdir}/openldap/slapd.* ${sysconfdir}/openldap/schema"
231 FILES_$
{PN
}-slurpd
= "${libexecdir}/slurpd ${localstatedir}/openldap-slurp ${localstatedir}/run"
232 FILES_$
{PN
}-bin = "${bindir}"
233 FILES_$
{PN
}-dev
= "${includedir} ${libdir}/lib*.so ${libdir}/*.la ${libdir}/*.a ${libexecdir}/openldap/*.a"
235 # Run ucgendat
, and remove it.
236 # This is a painful
and annoying way around the use of machine
-generated
237 # tables within the build. The alternative is
to rewrite the ucgendat
238 # stuff
and associated liblunicode code
to use machine
-independent
data
239 # files
- the current code seems
to at least assume byte sex.
240 DATFILES
= "case.dat cmbcl.dat comp.dat ctype.dat decomp.dat num.dat kdecomp.dat"
241 pkg_postinst_openldap
-slapd
() {
242 test
-n
"${DESTDIR}" -o
"${BUILD_ARCH}" = "${HOST_ARCH}" ||
(
243 cd
"${datadir}/${PN}/ucdata" &&
244 .
/ucgendat UnicodeData.txt
-x CompositionExclusions.txt
&&
245 # This saves about
1MByte
246 rm ucgendat UnicodeData.txt CompositionExclusions.txt
249 pkg_prerm_openldap
-slapd
() {
250 test
"${BUILD_ARCH}" = "${HOST_ARCH}" ||
(
251 cd
"${datadir}/${PN}/ucdata" && rm $
{DATFILES
}