updated on Fri Jan 20 04:00:45 UTC 2012
[aur-mirror.git] / nfs-utils-ipv6 / nfs-utils-1.1.2-kerberos-ac.patch
blob4a5a138e72a80a4c6946580aadae9c35b8b9f65e
1 diff -NaurwB nfs-utils-1.1.2.orig/aclocal/kerberos5.m4 nfs-utils-1.1.2/aclocal/kerberos5.m4
2 --- nfs-utils-1.1.2.orig/aclocal/kerberos5.m4 2008-03-14 16:46:29.000000000 +0100
3 +++ nfs-utils-1.1.2/aclocal/kerberos5.m4 2008-06-12 17:13:51.000000000 +0200
4 @@ -1,112 +1,48 @@
5 -dnl Checks for Kerberos
6 -dnl NOTE: while we intend to do generic gss-api, currently we
7 -dnl have a requirement to get an initial Kerberos machine
8 -dnl credential. Thus, the requirement for Kerberos.
9 -dnl The Kerberos gssapi library will be dynamically loaded?
10 AC_DEFUN([AC_KERBEROS_V5],[
11 + K5CONFIG="krb5-config"
12 AC_MSG_CHECKING(for Kerberos v5)
13 - AC_ARG_WITH(krb5,
14 - [AC_HELP_STRING([--with-krb5=DIR], [use Kerberos v5 installation in DIR])],
15 + AC_ARG_WITH(krb5-config,
16 + [AC_HELP_STRING([--with-krb5-config=PATH], [Full Path to krb5-config.])],
17 [ case "$withval" in
18 yes|no)
19 - krb5_with=""
20 + K5CONFIG="krb5-config"
23 - krb5_with="$withval"
24 + K5CONFIG="$withval"
26 esac ]
29 - for dir in $krb5_with /usr /usr/kerberos /usr/local /usr/local/krb5 \
30 - /usr/krb5 /usr/heimdal /usr/local/heimdal /usr/athena ; do
31 - dnl This ugly hack brought on by the split installation of
32 - dnl MIT Kerberos on Fedora Core 1
33 - K5CONFIG=""
34 - if test -f $dir/bin/krb5-config; then
35 - K5CONFIG=$dir/bin/krb5-config
36 - elif test -f "/usr/kerberos/bin/krb5-config"; then
37 - K5CONFIG="/usr/kerberos/bin/krb5-config"
38 - elif test -f "/usr/lib/mit/bin/krb5-config"; then
39 - K5CONFIG="/usr/lib/mit/bin/krb5-config"
40 - fi
41 if test "$K5CONFIG" != ""; then
42 KRBCFLAGS=`$K5CONFIG --cflags`
43 KRBLIBS=`$K5CONFIG --libs gssapi`
44 - K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'`
45 - AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
46 - if test -f $dir/include/gssapi/gssapi_krb5.h -a \
47 - \( -f $dir/lib/libgssapi_krb5.a -o \
48 - -f $dir/lib64/libgssapi_krb5.a -o \
49 - -f $dir/lib64/libgssapi_krb5.so -o \
50 - -f $dir/lib/libgssapi_krb5.so \) ; then
51 + if $K5CONFIG --version | grep -q -e heimdal; then
52 + K5VERS=`$K5CONFIG --version | head -n 1 | cut -f2 -d ' ' | tr -d '.'`
53 + AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
54 + gssapi_lib=gssapi
55 + KRBIMPL="heimdal"
56 + elif $K5CONFIG --version | grep -q -e mit; then
57 + K5VERS=`$K5CONFIG --version | head -n 1 | cut -f4 -d ' ' | tr -d '.'`
58 AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
59 - KRBDIR="$dir"
60 - dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the
61 - dnl private function (gss_krb5_ccache_name) to get correct
62 - dnl behavior of changing the ccache used by gssapi.
63 - dnl Starting in 1.3.2, we *DO NOT* want to use
64 - dnl gss_krb5_ccache_name, instead we want to set KRB5CCNAME
65 - dnl to get gssapi to use a different ccache
66 if test $K5VERS -le 131; then
67 AC_DEFINE(USE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the private function, gss_krb5_cache_name, must be used to tell the Kerberos library which credentials cache to use. Otherwise, this is done by setting the KRB5CCNAME environment variable])
69 gssapi_lib=gssapi_krb5
70 - break
71 - dnl The following ugly hack brought on by the split installation
72 - dnl of Heimdal Kerberos on SuSe
73 - elif test \( -f $dir/include/heim_err.h -o\
74 - -f $dir/include/heimdal/heim_err.h \) -a \
75 - -f $dir/lib/libroken.a; then
76 - AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
77 - KRBDIR="$dir"
78 - gssapi_lib=gssapi
79 - break
80 - fi
81 - fi
82 - done
83 - dnl We didn't find a usable Kerberos environment
84 - if test "x$KRBDIR" = "x"; then
85 - if test "x$krb5_with" = "x"; then
86 - AC_MSG_ERROR(Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=)
87 + KRBIMPL="mit-krb5"
88 else
89 - AC_MSG_ERROR(Kerberos v5 with GSS support not found at $krb5_with)
90 - fi
91 + AC_MSG_ERROR(Unknown Kerberos 5 Implementation. Is neither heimdal or mit-krb5.)
92 + KRBIMPL="unknown"
94 - AC_MSG_RESULT($KRBDIR)
96 - dnl Check if -rpath=$(KRBDIR)/lib is needed
97 - echo "The current KRBDIR is $KRBDIR"
98 - if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
99 - -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
100 - KRBLDFLAGS="";
101 - elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
102 - KRBLDFLAGS="";
103 - else
104 - KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
105 + AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
107 + AC_MSG_RESULT($KRBIMPL)
109 - dnl Now check for functions within gssapi library
110 - AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context,
111 - AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
112 - AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes,
113 - AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
114 - AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name,
115 - AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
117 - dnl Check for newer error message facility
118 - AC_CHECK_LIB($gssapi_lib, krb5_get_error_message,
119 - AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
120 + AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
121 + AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes, AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
122 + AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name, AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
123 + AC_CHECK_LIB($gssapi_lib, krb5_get_error_message, AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
124 + AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless, AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
126 - dnl Check for function to specify addressless tickets
127 - AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless,
128 - AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
130 - dnl If they specified a directory and it didn't work, give them a warning
131 - if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then
132 - AC_MSG_WARN(Using $KRBDIR instead of requested value of $krb5_with for Kerberos!)
133 - fi
135 - AC_SUBST([KRBDIR])
136 AC_SUBST([KRBLIBS])
137 AC_SUBST([KRBCFLAGS])
138 AC_SUBST([KRBLDFLAGS])