[package] openldap, update to 2.4.19, package slapd, cleanup makefile

(#6150)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@18495 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2009-11-23 10:53:22 +00:00
parent f7d5555f13
commit 0bf5301409
3 changed files with 92 additions and 5 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=openldap PKG_NAME:=openldap
PKG_VERSION:=2.4.16 PKG_VERSION:=2.4.19
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
@ -16,7 +16,7 @@ PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \ ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \ ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/ ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
PKG_MD5SUM:=ed5b86e9d2b372d10edfe3bb59fee165 PKG_MD5SUM:=4a6dab2711fcf141f19bb680bc335887
PKG_FIXUP = libtool PKG_FIXUP = libtool
@ -36,7 +36,6 @@ define Package/libopenldap
endef endef
define Package/libopenldap/description define Package/libopenldap/description
=
OpenLDAP Software is an open source implementation of the OpenLDAP Software is an open source implementation of the
Lightweight Directory Access Protocol (LDAP). Lightweight Directory Access Protocol (LDAP).
This package contains the shared LDAP client libraries, needed by other programs. This package contains the shared LDAP client libraries, needed by other programs.
@ -55,12 +54,25 @@ define Package/openldap-utils
endef endef
define Package/openldap-utils/description define Package/openldap-utils/description
=
OpenLDAP Software is an open source implementation of the OpenLDAP Software is an open source implementation of the
Lightweight Directory Access Protocol (LDAP). Lightweight Directory Access Protocol (LDAP).
This package contains client programs required to access LDAP servers. This package contains client programs required to access LDAP servers.
endef endef
define Package/openldap-server
$(call Package/openldap/Default)
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libopenldap +db47
TITLE+= (server)
endef
define Package/openldap-server/description
OpenLDAP Software is an open source implementation of the
Lightweight Directory Access Protocol (LDAP).
This package contains server programs required to provide LDAP services.
endef
TARGET_CFLAGS += $(FPIC) TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
@ -70,7 +82,6 @@ CONFIGURE_ARGS += \
--enable-dynamic \ --enable-dynamic \
--enable-syslog \ --enable-syslog \
--disable-local \ --disable-local \
--disable-slapd \
--disable-slurpd \ --disable-slurpd \
--with-cyrus-sasl \ --with-cyrus-sasl \
--without-fetch \ --without-fetch \
@ -107,6 +118,17 @@ define Package/openldap-utils/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
endef endef
define Package/openldap-server/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/ldap.init $(1)/etc/init.d/ldap
$(INSTALL_DIR) $(1)/etc/openldap/schema
$(CP) $(PKG_INSTALL_DIR)/etc/openldap/schema/* $(1)/etc/openldap/schema/
$(INSTALL_DIR) $(1)/usr/sbin
# OpenLDAP installs slapd into libexecdir, not sbindir:
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/slapd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,libopenldap)) $(eval $(call BuildPackage,libopenldap))
$(eval $(call BuildPackage,openldap-utils)) $(eval $(call BuildPackage,openldap-utils))
$(eval $(call BuildPackage,openldap-server))

View File

@ -0,0 +1,15 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2009 OpenWrt.org
START=60
start() {
mkdir -p /var/run/openldap
mkdir -p /var/lib/ldap
/usr/sbin/slapd
}
stop() {
killall slapd 2> /dev/null
}

View File

@ -0,0 +1,50 @@
diff -u --recursive openldap-2.4.19-vanilla/servers/slapd/connection.c openldap-2.4.19/servers/slapd/connection.c
--- openldap-2.4.19-vanilla/servers/slapd/connection.c 2009-11-17 19:04:26.000000000 -0500
+++ openldap-2.4.19/servers/slapd/connection.c 2009-11-17 19:09:02.000000000 -0500
@@ -783,7 +783,9 @@
{
assert( connections != NULL );
assert( c != NULL );
- assert( c->c_struct_state == SLAP_C_USED );
+
+ if ( c->c_struct_state != SLAP_C_USED ) return;
+
assert( c->c_conn_state != SLAP_C_INVALID );
/* c_mutex must be locked by caller */
@@ -816,7 +818,9 @@
{
assert( connections != NULL );
assert( c != NULL );
- assert( c->c_struct_state == SLAP_C_USED );
+
+ if ( c->c_struct_state != SLAP_C_USED ) return;
+
assert( c->c_conn_state == SLAP_C_CLOSING );
/* NOTE: c_mutex should be locked by caller */
diff -u --recursive openldap-2.4.19-vanilla/servers/slapd/daemon.c openldap-2.4.19/servers/slapd/daemon.c
--- openldap-2.4.19-vanilla/servers/slapd/daemon.c 2009-11-17 19:04:26.000000000 -0500
+++ openldap-2.4.19/servers/slapd/daemon.c 2009-11-17 19:10:54.000000000 -0500
@@ -989,13 +989,17 @@
void
slapd_set_read( ber_socket_t s, int wake )
{
+ int do_wake = 1;
ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
- assert( SLAP_SOCK_IS_ACTIVE( s ));
- if (!SLAP_SOCK_IS_READ( s )) SLAP_SOCK_SET_READ( s );
-
+ if( SLAP_SOCK_IS_ACTIVE( s ) && !SLAP_SOCK_IS_READ( s )) {
+ SLAP_SOCK_SET_READ( s );
+ } else {
+ do_wake = 0;
+ }
ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
- WAKE_LISTENER(wake);
+ if ( do_wake )
+ WAKE_LISTENER(wake);
}
time_t