{% set version = '0.3' %}

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

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

source:
  fn: config_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/config_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/config/config_{{ version }}.tar.gz
  sha256: 5ade6a768db6225634095ac0e71e5710fd1597c15512bac0b45a0b52afb3c750

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

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

requirements:
  build:
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-yaml >=2.1.13

  run:
    - r-base
    - r-yaml >=2.1.13

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

about:
  home: https://github.com/rstudio/config
  license: GPL-3
  summary: Manage configuration values across multiple environments (e.g. development, test,
    production). Read values using a function that determines the current environment
    and returns the appropriate value.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
