{% set version = '0.9-6' %}

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

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

source:
  fn: ipred_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/ipred_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/ipred/ipred_{{ version }}.tar.gz
  sha256: b8d36438eb9b7209d27b85738dcad03b2e535dcb2f4191432780d9cbf00d3cef

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

requirements:
  build:
    - r-base
    - r-mass
    - r-class
    - r-nnet
    - r-prodlim
    - r-rpart >=3.1_8
    - r-survival
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-mass
    - r-class
    - r-nnet
    - r-prodlim
    - r-rpart >=3.1_8
    - r-survival
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=ipred
  license: GPL (>= 2)
  summary: Improved predictive models by indirect classification and bagging for classification,
    regression and survival problems  as well as resampling based estimators of prediction
    error.
  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:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
