summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am5
-rw-r--r--contrib/sssd.spec.in8
-rw-r--r--src/external/ldap.m421
3 files changed, 32 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 014293dfd..767e67597 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -181,6 +181,7 @@ AM_CPPFLAGS = \
$(INI_CONFIG_CFLAGS) \
$(DHASH_CFLAGS) \
$(LIBNL_CFLAGS) \
+ $(OPENLDAP_CFLAGS) \
-DLIBDIR=\"$(libdir)\" \
-DVARDIR=\"$(localstatedir)\" \
-DSHLIBEXT=\"$(SHLIBEXT)\" \
@@ -286,8 +287,8 @@ TOOLS_LIBS = \
$(INI_CONFIG_LIBS) \
$(COLLECTION_LIBS) \
$(DHASH_LIBS) \
- $(OPENLDAP_LIBS) \
- $(TDB_LIBS) \
+ $(OPENLDAP_LIBS) \
+ $(TDB_LIBS) \
libsss_crypt.la
if BUILD_SELINUX
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index d5343697d..2bd67746f 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -3,6 +3,10 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
+%if (0%{?rhel} == 5)
+%{!?is_rhel57: %global is_rhel57 %(%{__grep} -c "5\.[^0-6]" /etc/redhat-release)}
+%endif
+
# Determine the location of the LDB modules directory
%global ldb_modulesdir %(pkg-config --variable=modulesdir ldb)
@@ -57,7 +61,11 @@ BuildRequires: libcollection-devel
BuildRequires: libini_config-devel
BuildRequires: dbus-devel
BuildRequires: dbus-libs
+%if 0%{?is_rhel57} > 0
+BuildRequires: openldap24-libs-devel
+%else
BuildRequires: openldap-devel
+%endif
BuildRequires: pam-devel
BuildRequires: nss-devel
BuildRequires: nspr-devel
diff --git a/src/external/ldap.m4 b/src/external/ldap.m4
index 87d95fa8b..b56eb340e 100644
--- a/src/external/ldap.m4
+++ b/src/external/ldap.m4
@@ -9,11 +9,31 @@ dnl ---------------------------------------------------------------------------
dnl - Check for Mozilla LDAP or OpenLDAP SDK
dnl ---------------------------------------------------------------------------
+for p in /usr/include/openldap24; do
+ if test -f "${p}/ldap.h"; then
+ OPENLDAP_CFLAGS="${OPENLDAP_CFLAGS} -I${p}"
+ break;
+ fi
+done
+
+for p in /usr/lib64/openldap24 /usr/lib/openldap24; do
+ if test -f "${p}/libldap.so"; then
+ OPENLDAP_LIBS="${OPENLDAP_LIBS} -L${p}"
+ break;
+ fi
+done
+
+SAVE_CFLAGS=$CFLAGS
+SAVE_LIBS=$LIBS
+CFLAGS="$CFLAGS $OPENLDAP_CFLAGS"
+LIBS="$LIBS $OPENLDAP_LIBS"
AC_CHECK_LIB(ldap, ldap_search, with_ldap=yes)
dnl Check for other libraries we need to link with to get the main routines.
test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes], , -llber) }
test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes], , -llber -lkrb) }
test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes with_ldap_des=yes], , -llber -lkrb -ldes) }
+CFLAGS=$SAVE_CFLAGS
+LIBS=$SAVE_LIBS
dnl Recently, we need -lber even though the main routines are elsewhere,
dnl because otherwise be get link errors w.r.t. ber_pvt_opt_on. So just
dnl check for that (it's a variable not a fun but that doesn't seem to
@@ -38,6 +58,7 @@ else
fi
AC_SUBST(OPENLDAP_LIBS)
+AC_SUBST(OPENLDAP_CFLAGS)
SAVE_CFLAGS=$CFLAGS
SAVE_LIBS=$LIBS