require 'mkmf'

dir_config('rkerberos', '/usr/local')

have_header('krb5.h')
have_library('krb5')

if have_header('kadm5/admin.h')
  have_library('kadm5clnt')
else
  raise "kadm5clnt library not found"
end

create_makefile('rkerberos')

require 'mkmf'

dir_config('rkerberos', '/usr/local')

have_header('krb5.h')
have_library('krb5')

unless pkg_config('com_err')
  puts 'warning: com_err not found, usually a dependency for kadm5clnt'
end

if have_header('kadm5/admin.h')
  have_library('kadm5clnt')
else
  raise "kadm5clnt library not found"
end

create_makefile('rkerberos')

Fix kadm5clnt build issue on EL6
Fix kadm5clnt build issue on EL6

Explicitly require com_err to populate the include path and fix kadm5/admin.h
error on EL6 with e2fsprogs 1.41, which doesn't have /usr/include/com_err.h.
