<commit_before>require openldap.inc
PR = "${INC_PR}.0"

DPN = "openldap"

# Makefile_debian.patch:
#       This patch is correct the path of $LIBTOOL, $CC, $LDAP_LIB, $LDAP_INC  
#       in the Makefiles (including the Makefiles in subfolders)
# install-strip.patch:
#       The original top.mk used INSTALL, not INSTALL_STRIP_PROGRAM when
#       installing .so and executables, this fails in cross compilation
#       environments
SRC_URI += "\
	file://Makefile_debian.patch"
#	file://install-strip.patch"

PACKAGECONFIG ??= "gnutls modules sasl \
"
#--with-tls              with TLS/SSL support auto|openssl|gnutls [auto]
PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls libgcrypt"

PACKAGECONFIG[sasl] = "--with-cyrus-sasl,--without-cyrus-sasl,libsasl2"
PACKAGECONFIG[modules] = "lt_cv_dlopen_self=yes --enable-modules,--disable-modules,libtool"

do_install_append () {
	#remove the conflict files with openldap
	mv ${D}${sysconfdir}/openldap ${D}${sysconfdir}/ldap
	rm -rf ${D}${sysconfdir}/ldap/schema
	rm ${D}${sysconfdir}/ldap/ldap.conf.* ${D}${sysconfdir}/ldap/slapd.* \
		${D}${sysconfdir}/ldap/DB_CONFIG.example ${D}${includedir}/slapi-plugin.h
	rm -r ${D}${libdir}/*.a ${D}${libdir}/*.la 
	rm -r ${D}${libdir}/libldap

	LINKLIB=$(basename $(readlink ${D}${libdir}/libldap-2.4.so.2))

	rm ${D}${libdir}/$LINKLIB ${D}${libdir}/libldap-2.4.so.2
	ln -s libldap_r-2.4.so.2 ${D}${libdir}/libldap-2.4.so.2
	rm ${D}${libdir}/libldap.so
	ln -s libldap_r.so ${D}${libdir}/libldap.so
	rm -r ${D}${bindir}
	rm -r ${D}${sbindir}
	
	rm -r ${D}${datadir}
	rm -r ${D}${localstatedir}
}

PACKAGES =+ "libldap-2.4-2"
PKG_${PN}-dev = "libldap2-minimal-dev"

FILES_libldap-2.4-2 = "${libdir}/liblber*.so.* ${libdir}/libldap*.so.* ${sysconfdir}/ldap/ldap.conf"

BBCLASSEXTEND = "native"
<commit_msg>openldap: remove INSTALL_STRIP_PROGRAM<commit_after>require openldap.inc
PR = "${INC_PR}.0"

DPN = "openldap"

# Makefile_debian.patch:
#       This patch is correct the path of $LIBTOOL, $CC, $LDAP_LIB, $LDAP_INC  
#       in the Makefiles (including the Makefiles in subfolders)
# install-strip.patch:
#       The original top.mk used INSTALL, not INSTALL_STRIP_PROGRAM when
#       installing .so and executables, this fails in cross compilation
#       environments
SRC_URI += "\
	file://Makefile_debian.patch \
	file://install-strip.patch"

PACKAGECONFIG ??= "gnutls modules sasl \
"
#--with-tls              with TLS/SSL support auto|openssl|gnutls [auto]
PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls libgcrypt"

PACKAGECONFIG[sasl] = "--with-cyrus-sasl,--without-cyrus-sasl,libsasl2"
PACKAGECONFIG[modules] = "lt_cv_dlopen_self=yes --enable-modules,--disable-modules,libtool"

do_install_append () {
	#remove the conflict files with openldap
	mv ${D}${sysconfdir}/openldap ${D}${sysconfdir}/ldap
	rm -rf ${D}${sysconfdir}/ldap/schema
	rm ${D}${sysconfdir}/ldap/ldap.conf.* ${D}${sysconfdir}/ldap/slapd.* \
		${D}${sysconfdir}/ldap/DB_CONFIG.example ${D}${includedir}/slapi-plugin.h
	rm -r ${D}${libdir}/*.a ${D}${libdir}/*.la 
	rm -r ${D}${libdir}/libldap

	LINKLIB=$(basename $(readlink ${D}${libdir}/libldap-2.4.so.2))

	rm ${D}${libdir}/$LINKLIB ${D}${libdir}/libldap-2.4.so.2
	ln -s libldap_r-2.4.so.2 ${D}${libdir}/libldap-2.4.so.2
	rm ${D}${libdir}/libldap.so
	ln -s libldap_r.so ${D}${libdir}/libldap.so
	rm -r ${D}${bindir}
	rm -r ${D}${sbindir}
	
	rm -r ${D}${datadir}
	rm -r ${D}${localstatedir}
}

PACKAGES =+ "libldap-2.4-2"
PKG_${PN}-dev = "libldap2-minimal-dev"

FILES_libldap-2.4-2 = "${libdir}/liblber*.so.* ${libdir}/libldap*.so.* ${sysconfdir}/ldap/ldap.conf"

BBCLASSEXTEND = "native"

{'fraction_non_alphanumeric': 0.19451371571072318, 'fraction_numerical': 0.011637572734829594, 'mean_word_length': 4.224312590448625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7046896', 'n_tokens_mistral': 1564, 'n_tokens_neox': 1536, 'n_words': 260}