{% set version = '2.0-4' %}

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

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

source:
  fn: ifultools_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/ifultools_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/ifultools/ifultools_{{ version }}.tar.gz
  sha256: 22014c9f8ebe0ed5874c92ae83e06eeea6c7a5889fb2d63543b2e6a094ae625f

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

requirements:
  build:
    - r-base
    - r-mass
    - r-splus2r >=1.2_0
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-mass
    - r-splus2r >=1.2_0
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=ifultools
  license: GPL-2
  summary: Insightful Research Tools.
  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:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
