def_path = File.join(File.expand_path(File.dirname(__FILE__)),"definitions")
if File.exist?(def_path)
  env_name = 'GRIB_DEFINITION_PATH'
  if gdp = ENV[env_name]
    ENV[env_name] = "#{gdp}:#{def_path}"
  else
    path = `grib_info -d`.strip
    if File.exist?(path)
      ENV[env_name] = "#{path}:#{def_path}"
    end
  end
end
