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

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

source:
  fn: C50_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/C50_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/C50/C50_{{ version }}.tar.gz
  sha256: 8f459856e0309274bee24462b7145db4eba1d71031c236db39000a5375bdfaba

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}sed               # [win]
    - {{posix}}grep              # [win]
    - {{posix}}autoconf
    - {{posix}}automake-wrapper  # [win]
    - {{posix}}pkg-config
    - {{posix}}make
    - {{posix}}sed  # [win]
    - {{posix}}coreutils  # [win]

  host:
    - r-base
    - r-cubist >=0.2.1
    - r-partykit

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-cubist >=0.2.1
    - r-partykit

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

about:
  home: https://topepo.github.io/C5.0
  license: GPL-3
  summary: C5.0 decision trees and rule-based models for pattern recognition that extend the
    work of Quinlan (1993, ISBN:1-55860-238-0).
  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
