{% set version = '0.1.2' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/binman_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/binman/binman_{{ version }}.tar.gz
  sha256: 6cce887e9e5f07323d7b74a769a9e7470ed3f7d011770cdc3b26070251aa8702

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-assertthat
    - r-httr
    - r-jsonlite
    - r-rappdirs
    - r-semver
    - r-xml2
    - r-yaml
  run:
    - r-base
    - r-assertthat
    - r-httr
    - r-jsonlite
    - r-rappdirs
    - r-semver
    - r-xml2
    - r-yaml

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

about:
  home: https://docs.ropensci.org/binman/, https://github.com/ropensci/binman

  license: MIT
  summary: Tools and functions for managing the download of binary files. Binary repositories
    are defined in 'YAML' format. Defining new pre-download, download and post-download
    templates allow additional repositories to be added.

  license_family: MIT
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
    - LICENSE

extra:
  recipe-maintainers:
    - ocefpaf
