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

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

source:
  fn: spls_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/spls_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/spls/spls_{{ version }}.tar.gz
  sha256: 498632a8685e8ae751a668aac408b2f12226173dcda5c8427a88fdd82d37b787

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-mass
    - r-nnet
    - r-pls
  run:
    - r-base
    - r-mass
    - r-nnet
    - r-pls

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

about:
  home: https://CRAN.R-project.org/package=spls
  license: GPL (>= 2)
  summary: Provides functions for fitting a sparse partial least squares (SPLS) regression and
    classification (Chun and Keles (2010) <doi:10.1111/j.1467-9868.2009.00723.x>).
  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
