{% set version = '0.7' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/shapefiles_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/shapefiles/shapefiles_{{ version }}.tar.gz
  sha256: eeb18ea4165119519a978d4a2ba1ecbb47649deb96a7f617f5b3100d63b3f021

build:
  merge_build_host: True  # [win]
  script: R CMD INSTALL --build .
  number: 1
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip  # [win]
  host:
    - r-base
    - r-foreign
  run:
    - r-base
    - r-foreign

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

about:
  home: https://CRAN.R-project.org/package=shapefiles
  license: GPL-3.0
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'
  license_family: GPL
  summary: Functions to read and write ESRI shapefiles

extra:
  recipe-maintainers:
    - ocefpaf
