summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/openldap
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2012-07-30 23:52:49 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2012-07-31 00:14:55 +0200
commit4339668ff27c839af1a1e4cfa5a2d034afe204f2 (patch)
treed2a48dca9a2a46a944e5091bf9b157cb2dc15e44 /meta-oe/recipes-support/openldap
parentf2afdd2b988af8d0b4d822c7c03529b725fe24ba (diff)
downloadmeta-openembedded-4339668ff27c839af1a1e4cfa5a2d034afe204f2.tar.gz
fbreader, fltk, gpm, iksemel, joe, links, ode, openldap, opensync, xchat: import from meta-smartphone
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/openldap')
-rw-r--r--meta-oe/recipes-support/openldap/openldap-2.4.23/initscript29
-rw-r--r--meta-oe/recipes-support/openldap/openldap-2.4.23/install-strip.patch14
-rw-r--r--meta-oe/recipes-support/openldap/openldap-2.4.23/openldap-m4-pthread.patch20
-rw-r--r--meta-oe/recipes-support/openldap/openldap_2.4.23.bb270
4 files changed, 333 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/openldap/openldap-2.4.23/initscript b/meta-oe/recipes-support/openldap/openldap-2.4.23/initscript
new file mode 100644
index 000000000..40881cd6d
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap-2.4.23/initscript
@@ -0,0 +1,29 @@
1#! /bin/sh
2#
3# This is an init script for openembedded
4# Copy it to /etc/init.d/openldap and type
5# > update-rc.d openldap defaults 60
6#
7
8
9slapd=/usr/libexec/slapd
10test -x "$slapd" || exit 0
11
12
13case "$1" in
14 start)
15 echo -n "Starting OpenLDAP: "
16 start-stop-daemon --start --quiet --exec $slapd
17 echo "."
18 ;;
19 stop)
20 echo -n "Stopping OpenLDAP: "
21 start-stop-daemon --stop --quiet --pidfile /var/run/slapd.pid
22 echo "."
23 ;;
24 *)
25 echo "Usage: /etc/init.d/openldap {start|stop}"
26 exit 1
27esac
28
29exit 0 \ No newline at end of file
diff --git a/meta-oe/recipes-support/openldap/openldap-2.4.23/install-strip.patch b/meta-oe/recipes-support/openldap/openldap-2.4.23/install-strip.patch
new file mode 100644
index 000000000..9d7640ca9
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap-2.4.23/install-strip.patch
@@ -0,0 +1,14 @@
1# This patch ensures that the install operations which strip
2# programs and libraries (LTINSTALL) work in a cross build
3# environment.
4--- openldap-2.2.24/.pc/install-strip.patch/build/top.mk 2005-01-20 09:00:55.000000000 -0800
5+++ openldap-2.2.24/build/top.mk 2005-04-16 13:48:20.536710376 -0700
6@@ -116,7 +116,7 @@
7 LTLINK_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=link \
8 $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_MOD)
9
10-LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
11+LTINSTALL = STRIPPROG="@STRIP@" $(LIBTOOL) --mode=install $(top_srcdir)/contrib/ldapc++/install-sh -c
12 LTFINISH = $(LIBTOOL) --mode=finish
13
14 # Misc UNIX commands used in build environment
diff --git a/meta-oe/recipes-support/openldap/openldap-2.4.23/openldap-m4-pthread.patch b/meta-oe/recipes-support/openldap/openldap-2.4.23/openldap-m4-pthread.patch
new file mode 100644
index 000000000..b669b7254
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap-2.4.23/openldap-m4-pthread.patch
@@ -0,0 +1,20 @@
1--- openldap-2.3.11/build/openldap.m4.orig 2005-11-11 00:11:18.604322590 -0800
2+++ openldap-2.3.11/build/openldap.m4 2005-11-11 00:26:21.621145856 -0800
3@@ -788,7 +788,7 @@ AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
4 ]])
5
6 AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
7-AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
8+[AC_LANG_SOURCE([[OL_PTHREAD_TEST_INCLUDES
9
10 int main(argc, argv)
11 int argc;
12@@ -796,7 +796,7 @@ int main(argc, argv)
13 {
14 OL_PTHREAD_TEST_FUNCTION
15 }
16-]))
17+]])])
18 dnl --------------------------------------------------------------------
19 AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
20 if test "$ol_link_threads" = no ; then
diff --git a/meta-oe/recipes-support/openldap/openldap_2.4.23.bb b/meta-oe/recipes-support/openldap/openldap_2.4.23.bb
new file mode 100644
index 000000000..3ef12d3a1
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap_2.4.23.bb
@@ -0,0 +1,270 @@
1# OpenLDAP, a license free (see http://www.OpenLDAP.org/license.html)
2#
3DESCRIPTION = "OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol."
4HOMEPAGE = "http://www.OpenLDAP.org/license.html"
5# The OpenLDAP Public License - see the HOMEPAGE - defines
6# the license. www.openldap.org claims this is Open Source
7# (see http://www.openldap.org), the license appears to be
8# basically BSD. opensource.org does not record this license
9# at present (so it is apparently not OSI certified).
10LICENSE = "OpenLDAP"
11LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3d82d3085f228af211a6502c7ea7c3c7"
12SECTION = "libs"
13
14LDAP_VER = "${@'.'.join(bb.data.getVar('PV',d,1).split('.')[0:2])}"
15
16SRC_URI = "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz"
17SRC_URI += "file://openldap-m4-pthread.patch"
18SRC_URI += "file://initscript"
19SRC_URI[md5sum] = "90150b8c0d0192e10b30157e68844ddf"
20SRC_URI[sha256sum] = "5a5ede91d5e8ab3c7f637620aa29a3b96eb34318a8b26c8eef2d2c789fc055e3"
21
22# The original top.mk used INSTALL, not INSTALL_STRIP_PROGRAM when
23# installing .so and executables, this fails in cross compilation
24# environments
25SRC_URI += "file://install-strip.patch"
26
27inherit autotools
28
29# OPTIONS
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
35# local.conf!
36OPENLDAP_OPTIONS ?= ""
37OPENLDAP_DEPENDS ?= ""
38
39# CV SETTINGS
40# Required to work round AC_FUNC_MEMCMP which gets the wrong answer
41# when cross compiling (should be in site?)
42EXTRA_OECONF += "ac_cv_func_memcmp_working=yes"
43
44# CONFIG DEFINITIONS
45# The following is necessary because it cannot be determined for a
46# cross compile automagically. Select should yield fine on all OE
47# systems...
48EXTRA_OECONF += "--with-yielding-select=yes"
49# Shared libraries are nice...
50EXTRA_OECONF += "--enable-dynamic"
51#
52# Disable TLS to remove the need for openssl/libcrypto
53OPENLDAP_OPTION_tls ?= "--with-tls"
54# set the following to "openssl" to build tls support
55OPENLDAP_DEPENDS_tls ?= "gnutls"
56EXTRA_OECONF += "${OPENLDAP_OPTION_tls}"
57DEPENDS += "${OPENLDAP_DEPENDS_tls}"
58#
59# Disable Cyrus SASL, which may or may not be working at present...
60OPENLDAP_OPTION_sasl ?= "--without-cyrus-sasl"
61# set the following to "cyrus-sasl" to build SASL support
62OPENLDAP_DEPENDS_sasl ?= ""
63EXTRA_OECONF += "${OPENLDAP_OPTION_sasl}"
64DEPENDS += "${OPENLDAP_DEPENDS_sasl}"
65
66# SLAPD options
67#
68# UNIX crypt(3) passwd support:
69EXTRA_OECONF += "--enable-crypt"
70#
71# Enable dynamic module loading. If this is *disabled* the
72# dependency on libtool is removed (to disable set the following
73# to variables to "" in a .conf file).
74OPENLDAP_OPTION_modules += "lt_cv_dlopen_self=yes --enable-modules"
75OPENLDAP_DEPENDS_modules += "libtool"
76EXTRA_OECONF += " ${OPENLDAP_OPTION_modules}"
77DEPENDS += "${OPENLDAP_DEPENDS_modules}"
78
79# SLAPD BACKEND
80#
81# The backend must be set by the configuration. This controls the
82# required database, the default database, bdb, is turned off but
83# can be turned back on again and it *is* below! The monitor backend
84# is also disabled. If you try to change the backends but fail to
85# enable a single one the build will fail in an obvious way.
86#
87EXTRA_OECONF += "--disable-bdb --disable-hdb --disable-monitor"
88#
89# Backends="bdb dnssrv hdb ldap ldbm meta monitor null passwd perl shell sql"
90#
91# Note that multiple backends can be built. The ldbm backend requires a
92# build-time choice of database API. The bdb backend forces this to be
93# DB4. To use the gdbm (or other) API the Berkely database module must
94# be removed from the build.
95md = "${libexecdir}/openldap"
96#
97#--enable-bdb enable Berkeley DB backend no|yes|mod yes
98# The Berkely DB is the standard choice. This version of OpenLDAP requires
99# the version 4 implementation or better.
100# To disable this set all three of the following variables to <empty> in
101# a .conf file (this will allow ldbm to be build with gdbm).
102#OPENLDAP_OPTION_bdb ?= "--enable-bdb=mod"
103OPENLDAP_DEPENDS_bdb ?= "db"
104EXTRA_OECONF += "${OPENLDAP_OPTION_bdb}"
105DEPENDS += "${OPENLDAP_DEPENDS_bdb}"
106#
107#--enable-dnssrv enable dnssrv backend no|yes|mod no
108# This has no dependencies.
109EXTRA_OECONF += "--enable-dnssrv=mod"
110#
111#--enable-hdb enable Hierarchical DB backend no|yes|mod no
112# This forces ldbm to use Berkeley too, remove to use gdbm
113#OPENLDAP_OPTION_hdb ?= "--enable-hdb=mod"
114OPENLDAP_DEPENDS_hdb ?= "db"
115OPENLDAP_PACKAGE_hdb ?= "${PN}-backend-hdb"
116EXTRA_OECONF += "${OPENLDAP_OPTION_hdb}"
117DEPENDS += "${OPENLDAP_DEPENDS_hdb}"
118#
119#--enable-ldap enable ldap backend no|yes|mod no
120# This has no dependencies
121EXTRA_OECONF += "--enable-ldap=mod"
122#
123#--enable-ldbm enable ldbm backend no|yes|mod no
124# ldbm requires further specification of the underlying database API, because
125# bdb is enabled above this must be set to berkeley, however the config
126# defaults this correctly so --with-ldbm-api is *not* set. The build will
127# fail if bdb is removed (above) but not database is built to provide the
128# support for ldbm (because the 'DEPENDS_ldbm' is empty below.)
129#
130# So to use gdbm set:
131OPENLDAP_OPTION_ldbm = "--enable-ldbm=mod --with-ldbm-api=gdbm"
132OPENLDAP_DEPENDS_ldbm = "gdbm"
133# And clear the bdb and hdb settings.
134OPENLDAP_OPTION_ldbm ?= "--enable-ldbm=mod"
135OPENLDAP_DEPENDS_ldbm ?= ""
136EXTRA_OECONF += "${OPENLDAP_OPTION_ldbm}"
137DEPENDS += "${OPENLDAP_DEPENDS_ldbm}"
138#
139#--enable-meta enable metadirectory backend no|yes|mod no
140# No dependencies
141EXTRA_OECONF += "--enable-meta=mod"
142#
143#--enable-monitor enable monitor backend no|yes|mod yes
144EXTRA_OECONF += "--enable-monitor=mod"
145#
146#--enable-null enable null backend no|yes|mod no
147EXTRA_OECONF += "--enable-null=mod"
148#
149#--enable-passwd enable passwd backend no|yes|mod no
150EXTRA_OECONF += " --enable-passwd=mod"
151#
152#--enable-perl enable perl backend no|yes|mod no
153# This requires a loadable perl dynamic library, if enabled without
154# doing something appropriate (building perl?) the build will pick
155# up the build machine perl - not good.
156OPENLDAP_OPTION_perl ?= "--enable-perl=mod"
157OPENLDAP_DEPENDS_perl ?= "perl"
158#EXTRA_OECONF += "${OPENLDAP_OPTION_perl}"
159#DEPENDS += "${OPENLDAP_DEPENDS_perl}"
160#
161#--enable-shell enable shell backend no|yes|mod no
162EXTRA_OECONF += "--enable-shell=mod"
163#
164#--enable-sql enable sql backend no|yes|mod no
165# sql requires some sql backend which provides sql.h, sqlite* provides
166# sqlite.h (which may be compatible but hasn't been tried.)
167OPENLDAP_OPTION_sql ?= "--enable-sql=mod"
168OPENLDAP_DEPENDS_sql ?= "sql"
169#EXTRA_OECONF += "${OPENLDAP_OPTION_sql}"
170#DEPENDS += "${OPENLDAP_DEPENDS_sql}"
171#
172#--enable-dyngroup Dynamic Group overlay no|yes|mod no
173# This is a demo, Proxy Cache defines init_module which conflicts with the
174# same symbol in dyngroup
175#EXTRA_OECONF += "--enable-dyngroup=mod"
176#
177#--enable-proxycache Proxy Cache overlay no|yes|mod no
178EXTRA_OECONF += "--enable-proxycache=mod"
179FILES_${PN}-overlay-proxycache = "${md}/pcache-*.so.*"
180PACKAGES += "${PN}-overlay-proxycache"
181#
182# LOCAL OPTION OVERRIDES
183# The distro/lcoal options must be added in *last*
184EXTRA_OECONF += "${OPENLDAP_OPTIONS}"
185DEPENDS += "${OPENLDAP_DEPENDS}"
186
187CPPFLAGS_append = " -D_GNU_SOURCE"
188
189do_configure() {
190 cp ${STAGING_DATADIR_NATIVE}/libtool/config/ltmain.sh ${S}/build
191 rm -f ${S}/libtool
192 aclocal
193 libtoolize --force --copy
194 gnu-configize
195 autoconf
196 oe_runconf
197}
198
199#FIXME: this is a hack, at present an openldap build will pick up the header
200# files from staging rather than the local ones (bad -I order), so remove
201# the headers (from openldap-old.x) before compiling...
202do_compile_prepend() {
203 (
204 cd ${STAGING_INCDIR}
205 rm -f ldap.h ldap_*.h
206 )
207 (
208 cd ${STAGING_LIBDIR}
209 rm -f libldap* liblber*
210 )
211}
212
213LEAD_SONAME = "libldap-${LDAP_VER}.so.*"
214
215# The executables go in a separate package. This allows the
216# installation of the libraries with no daemon support.
217# Each module also has its own package - see above.
218PACKAGES += "${PN}-slapd ${PN}-slurpd ${PN}-bin"
219
220# Package contents - shift most standard contents to -bin
221FILES_${PN} = "${libdir}/lib*.so.* ${sysconfdir}/openldap/ldap.* ${localstatedir}/openldap-data"
222FILES_${PN}-slapd = "${sysconfdir}/init.d ${libexecdir}/slapd ${sbindir} ${localstatedir}/run \
223 ${sysconfdir}/openldap/slapd.* ${sysconfdir}/openldap/schema \
224 ${sysconfdir}/openldap/DB_CONFIG.example"
225FILES_${PN}-slurpd = "${libexecdir}/slurpd ${localstatedir}/openldap-slurp ${localstatedir}/run"
226FILES_${PN}-bin = "${bindir}"
227FILES_${PN}-dev = "${includedir} ${libdir}/lib*.so ${libdir}/*.la ${libdir}/*.a ${libexecdir}/openldap/*.a ${libexecdir}/openldap/*.la ${libexecdir}/openldap/*.so"
228FILES_${PN}-dbg += "${libexecdir}/openldap/.debug"
229
230do_install_append() {
231 install -d ${D}${sysconfdir}/init.d
232 cat ${WORKDIR}/initscript > ${D}${sysconfdir}/init.d/openldap
233 chmod 755 ${D}${sysconfdir}/init.d/openldap
234 # This is duplicated in /etc/openldap and is for slapd
235 rm -f ${D}${localstatedir}/openldap-data/DB_CONFIG.example
236}
237
238pkg_postinst_${PN}-slapd () {
239 if test -n "${D}"; then
240 D="-r $D"
241 fi
242 update-rc.d $D openldap defaults
243}
244
245pkg_prerm_${PN}-slapd () {
246 if test -n "${D}"; then
247 D="-r $D"
248 fi
249 update-rc.d $D openldap remove
250}
251
252PACKAGES_DYNAMIC = "openldap-backends openldap-backend-*"
253
254python populate_packages_prepend () {
255 backend_dir = bb.data.expand('${libexecdir}/openldap', d)
256 do_split_packages(d, backend_dir, 'back_([a-z]*)\-.*\.so\..*$', 'openldap-backend-%s', 'OpenLDAP %s backend', extra_depends='', allow_links=True)
257
258 metapkg = "openldap-backends"
259 bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d)
260 bb.data.setVar('FILES_' + metapkg, "", d)
261 metapkg_rdepends = []
262 packages = bb.data.getVar('PACKAGES', d, 1).split()
263 for pkg in packages[1:]:
264 if pkg.count("openldap-backend-") and not pkg in metapkg_rdepends and not pkg.count("-dev") and not pkg.count("-dbg") and not pkg.count("static") and not pkg.count("locale"):
265 metapkg_rdepends.append(pkg)
266 bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d)
267 bb.data.setVar('DESCRIPTION_' + metapkg, 'OpenLDAP backends meta package', d)
268 packages.append(metapkg)
269 bb.data.setVar('PACKAGES', ' '.join(packages), d)
270}