{% set version = "7.3-12" %}

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

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

source:
  fn: spatial_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/spatial_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/spatial/spatial_{{ version }}.tar.gz
  sha256: 7639039ee7407bd088e1b253376b2cb4fcdf4cc9124d6b48e4119d5cda872d63

build:
  merge_build_host: true  # [win]
  number: 1

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: http://www.stats.ox.ac.uk/pub/MASS4/
  license: GPL-2 | GPL-3
  summary: Functions for kriging and point pattern analysis.
  license_family: GPL3
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  recipe-maintainers:
    - conda-forge/r
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - dbast
