{% set version = '1.4.2' %}

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

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

source:
  fn: chemometrics_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/chemometrics_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/chemometrics/chemometrics_{{ version }}.tar.gz
  sha256: b705832fa167dc24b52b642f571ed1efd24c5f53ba60d02c7797986481b6186a

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

requirements:
  build:
    - r-base
    - r-class
    - r-e1071
    - r-mass
    - r-nnet
    - r-pcapp
    - r-robustbase
    - r-som
    - r-lars
    - r-pls
    - r-mclust
    - r-rpart

  run:
    - r-base
    - r-class
    - r-e1071
    - r-mass
    - r-nnet
    - r-pcapp
    - r-robustbase
    - r-som
    - r-lars
    - r-pls
    - r-mclust
    - r-rpart

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

about:
  home: https://CRAN.R-project.org/package=chemometrics
  license: GPL (>= 3)
  summary: 'R companion to the book "Introduction to Multivariate Statistical Analysis in Chemometrics" written by K. Varmuza and P. Filzmoser (2009).'
  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
