{% set version = '0.36' %}

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

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

source:
  fn: bestglm_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/bestglm_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/bestglm/bestglm_{{ version }}.tar.gz
  sha256: 90f9b1e0a718cdc1ea273ae5a6717fa849cc01e0d0d12b333484bfcf2c0e5ab5

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-glmnet
    - r-grpreg
    - r-lattice
    - r-leaps
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-glmnet
    - r-grpreg
    - r-lattice
    - r-leaps
    - libgcc  # [not win]

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

about:
  home: http://www.stats.uwo.ca/faculty/aim
  license: GPL (>= 2)
  summary: Best subset glm using information criteria or cross-validation.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
