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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/mda_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/mda/mda_{{ version }}.tar.gz
  sha256: bda6409c17f385fae97da458cc742334e7b47aab8217a975b7551e2e18d38463

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
    - r-class
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-class

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

about:
  home: https://CRAN.R-project.org/package=mda
  license: GPL-2.0-only
  summary: Mixture and flexible discriminant analysis, multivariate adaptive regression splines (MARS), BRUTO, ...
  license_family: GPL2
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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

# Package: mda
# Version: 0.4-10
# Date: 2017-11-02
# Author: S original by Trevor Hastie & Robert Tibshirani. Original R port by Friedrich Leisch, Kurt Hornik and Brian D. Ripley.
# Maintainer: Trevor Hastie <hastie@stanford.edu>
# Description: Mixture and flexible discriminant analysis, multivariate adaptive regression splines (MARS), BRUTO, ...
# Title: Mixture and Flexible Discriminant Analysis
# Depends: R (>= 1.9.0), stats, class
# Suggests: earth
# License: GPL-2
# Packaged: 2017-11-02 15:46:34 UTC; hastie
# Repository: CRAN
# Date/Publication: 2017-11-02 16:15:22 UTC
# NeedsCompilation: yes
