Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1578242
 поиск   регистрация   авторизация 
 
Группа :: Сети/Почта
Пакет: fetchmail

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: fetchmail-6.2.3-krb5-config.patch


--- fetchmail-6.2.3/configure.in.patch-krb5	2003-07-18 10:26:35 +0400
+++ fetchmail-6.2.3/configure.in	2003-07-18 11:07:31 +0400
@@ -435,61 +435,22 @@
   CEFLAGS="$CEFLAGS -I/usr/include/kerberosV"
   LIBS="$LIBS -lasn1 -lkrb5 -lcom_err -lkafs"
 else
-  if test "$with_kerberos5" != "yes" 
+  if test "$with_kerberos5" != "yes"
   then
-      LDEFLAGS="$LDEFLAGS -L${with_kerberos5}/lib"
-      searchdirs="$with_kerberos5"
+      KRB5_CONFIG="$with_kerberos5/bin/krb5-config"
   else
-      searchdirs="/usr/kerberos /usr/local/krb5 /usr/athena /usr"
+      KRB5_CONFIG=/usr/bin/krb5-config
   fi
-  with_kerberos5=
-  for dir in $searchdirs
-  do AC_MSG_CHECKING([for Kerberos V in $dir])
-     if test -f "$dir/include/krb5.h"
-     then
-        ac_krblibs=
-        if test -f "$dir/include/roken.h"
-        then
-           ac_krblibs="-lasn1 -lroken -lcom_err"
-           AC_MSG_RESULT([Heimdal found])
-          dnl Attempt to detect if we need to -ldb2 to link Heimdal
-          dnl we assume we do if it is available
-           AC_CHECK_LIB(db2, db_open, ac_krblibs="$ac_krblibs -ldb2", [],
-                ${LDEFLAGS})
-           AC_CHECK_LIB(des, des_string_to_key, libk5crypto=-ldes,
-              AC_CHECK_LIB(ssl, MD5_Init, [],
-                AC_ERROR([DES libraries not found. Try adding --with-ssl to enable OpenSSL support]),
-                ${LDEFLAGS} ${ac_krblibs}),
-           ${LDEFLAGS} ${ac_krblibs})
-           AC_DEFINE(HEIMDAL)
-        else
-          AC_MSG_RESULT([found])
-          ac_krblibs="-lcom_err"
-           AC_CHECK_LIB(crypto,
-             krb5_des_string_to_key,
-             libk5crypto=-lcrypto,
-                AC_CHECK_LIB(k5crypto,
-                   krb5_des_string_to_key,
-                   libk5crypto=-lk5crypto,
-                      AC_ERROR([Kerberos 5 DES libraries not found]),
-                   ${LDEFLAGS} ${ac_krblibs}),
-                 ${LDEFLAGS} ${ac_krblibs})
-        fi
-        AC_CHECK_LIB(krb5, krb5_init_context,[],
-           continue,
-           ${LDEFLAGS} ${ac_krblibs})
-        AC_DEFINE(KERBEROS_V5)
-        test "$dir" != "/usr" && CEFLAGS="$CEFLAGS -I$dir/include"
-        LDEFLAGS="$LDEFLAGS -L$dir/lib"
-       LIBS="$LIBS $ac_krblibs $libk5crypto"
-        with_kerberos5=$dir
-        break
-     else
-        AC_MSG_RESULT([not found])
-     fi
-  done
-  if test -z "$with_kerberos5" ; then
-     AC_ERROR([Kerberos 5 libraries not found])
+  AC_MSG_CHECKING([for krb5-config])
+  if test -x "$KRB5_CONFIG"
+  then
+    AC_MSG_RESULT([found])
+    CEFLAGS="$CEFLAGS `$KRB5_CONFIG --cflags krb5`"
+    LIBS="$LIBS `$KRB5_CONFIG --libs krb5`"
+    AC_DEFINE(KERBEROS_V5)
+  else
+    AC_MSG_RESULT([not found])
+    AC_MSG_ERROR([Kerberos 5 libraries not found])
   fi
 fi
 fi
 
design & coding: Vladimir Lettiev aka crux © 2004-2005