{% set version = '3.0' %}

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

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

source:
  fn: leaps_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/leaps_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/leaps/leaps_{{ version }}.tar.gz
  sha256: 55a879cdad5a4c9bc3b5697dd4d364b3a094a49d8facb6692f5ce6af82adf285

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=leaps
  license: GPL (>= 2)
  summary: Regression subset selection, including exhaustive search.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
