summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/openldap/files/initscript29
-rw-r--r--packages/openldap/openldap_2.3.11.bb20
2 files changed, 48 insertions, 1 deletions
diff --git a/packages/openldap/files/initscript b/packages/openldap/files/initscript
new file mode 100644
index 0000000000..40881cd6d7
--- /dev/null
+++ b/packages/openldap/files/initscript
@@ -0,0 +1,29 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/openldap and type
+# > update-rc.d openldap defaults 60
+#
+
+
+slapd=/usr/libexec/slapd
+test -x "$slapd" || exit 0
+
+
+case "$1" in
+ start)
+ echo -n "Starting OpenLDAP: "
+ start-stop-daemon --start --quiet --exec $slapd
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping OpenLDAP: "
+ start-stop-daemon --stop --quiet --pidfile /var/run/slapd.pid
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/openldap {start|stop}"
+ exit 1
+esac
+
+exit 0 \ No newline at end of file
diff --git a/packages/openldap/openldap_2.3.11.bb b/packages/openldap/openldap_2.3.11.bb
index f15de41116..26d017fb1e 100644
--- a/packages/openldap/openldap_2.3.11.bb
+++ b/packages/openldap/openldap_2.3.11.bb
@@ -12,12 +12,13 @@ PRIORITY = "optional"
LICENSE = "OpenLDAP"
SECTION = "libs"
-PR = "r1"
+PR = "r2"
LDAP_VER = "${@'.'.join(bb.data.getVar('PV',d,1).split('.')[0:2])}"
SRC_URI = "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz"
SRC_URI += "file://openldap-m4-pthread.patch;patch=1"
+SCR-URI += "file://initscript";
# The build tries to run a host executable, this fails. The patch
# causes the executable and its data to be installed instead of
# the output - ucgendat must be run after the ipkg install!
@@ -263,6 +264,23 @@ FILES_${PN}-bin = "${bindir}"
FILES_${PN}-dev = "${includedir} ${libdir}/lib*.so ${libdir}/*.la ${libdir}/*.a ${libexecdir}/openldap/*.a"
do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ cat ${WORKDIR}/initscript > ${D}${sysconfdir}/init.d/openldap
+ chmod 755 ${D}${sysconfdir}/init.d/openldap
# This is duplicated in /etc/openldap and is for slapd
rm -f ${D}${localstatedir}/openldap-data/DB_CONFIG.example
}
+
+pkg_postinst () {
+ if test -n "${D}"; then
+ D="-r $D"
+ fi
+ update-rc.d $D acpid defaults
+}
+
+pkg_prerm () {
+ if test -n "${D}"; then
+ D="-r $D"
+ fi
+ update-rc.d $D acpid remove
+}