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

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

source:
  fn: gam_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/gam_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/gam/gam_{{ version }}.tar.gz
  sha256: 020532e49e59b8691dbbdd44fdaee6c0cf7334708b3080c24706140edf238f2e

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

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

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

about:
  home: https://CRAN.R-project.org/package=gam
  license: GPL-2
  summary: Functions for fitting and working with generalized additive models, as described in
    chapter 7 of "Statistical Models in S" (Chambers and Hastie (eds), 1991), and "Generalized
    Additive Models" (Hastie and Tibshirani, 1990).
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
