{% set version = '2.2-5.4' %}

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

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

source:
  fn: sm_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/sm_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/sm/sm_{{ version }}.tar.gz

  sha256: 49f26c52728ac9dd2152d80ef1d3d59b98269bdc81616f81548fa4ed842ed842

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

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

  run:
    - r-base
    - libgcc  # [not win]

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

about:
  home: https://cran.r-project.org/web/packages/sm/index.html
  license: GPL (>= 2)
  summary: This is software linked to the book 'Applied Smoothing Techniques for Data Analysis
    - The Kernel Approach with S-Plus Illustrations' Oxford University Press.
  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:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
