{% set version = "9.6.1" %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-fields
  version: {{ version|replace("-", "_") }}

source:
  fn: fields_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/fields_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/fields/fields_{{ version }}.tar.gz
  sha256: 83fe0009206ed824ce5ee59b027afe2a6142af66d4929ab9a755e05a1e4156d6

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
    - r-maps
    - r-spam

  run:
    - r-base
    - r-maps
    - r-spam

test:
  commands:
    - $R -e "library('fields')"  # [not win]
    - "\"%R%\" -e \"library('fields')\""  # [win]

about:
  home: http://www.image.ucar.edu/fields
  license: GPL (>= 2)
  summary: 'For curve, surface and function fitting with an emphasis on splines, spatial data
    and spatial statistics. The major methods include cubic, and thin plate splines,
    Kriging, and compactly supported covariance functions for large data sets. The splines
    and Kriging methods are supported by functions that can determine the smoothing
    parameter (nugget and sill variance) and other covariance function parameters by
    cross validation and also by restricted maximum likelihood. For Kriging there is
    an easy to use function that also estimates the correlation scale (range parameter).  A
    major feature is that any covariance function implemented in R and following a simple
    format can be used for spatial prediction. There are also many useful functions
    for plotting and working with spatial data as images. This package also contains
    an implementation of sparse matrix methods for large spatial data sets and currently
    requires the sparse matrix (spam) package. Use help(fields) to get started and for
    an overview.  The fields source code is deliberately commented and provides useful
    explanations of numerical details as a companion to the manual pages. The commented
    source code can be viewed by expanding  source code version and looking in the R
    subdirectory. The reference for fields can be generated by the citation function
    in R and has DOI <doi:10.5065/D6W957CT>. '

  license_family: GPL3

extra:
  recipe-maintainers:
    - dpryan79
    - johanneskoester
    - bgruening
    - daler
