{% set version = "1.3-3" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

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

source:
  fn: splus2R_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/splus2R_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/splus2R/splus2R_{{ version }}.tar.gz
  sha256: 7d5c90842debaf6046d445e3fce4f9721baad0339aa7193339705ef68568bf0c

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_fortran') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: https://CRAN.R-project.org/package=splus2R
  license: GPL-2.0-only
  summary: Currently there are many functions in S-PLUS that are missing in R. To facilitate the conversion of S-PLUS packages to R packages, this package provides some missing S-PLUS functionality in R.
  license_family: GPL2
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

extra:
  recipe-maintainers:
    - conda-forge/r
