{% set version = '1.3-2' %}

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

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

source:
  fn: rprojroot_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/rprojroot_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/rprojroot/rprojroot_{{ version }}.tar.gz
  sha256: df5665834941d8b0e377a8810a04f98552201678300f168de5f58a587b73238b

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

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

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

  host:
    - r-base
    - r-backports

  run:
    - r-base
    - r-backports

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

about:
  home: https://github.com/krlmlr/rprojroot, https://krlmlr.github.io/rprojroot
  license: GPL-3
  summary: Robust, reliable and flexible paths to files below a project root. The 'root' of a
    project is defined as a directory that matches a certain criterion, e.g., it contains
    a certain regular file.
  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
