{% set version = '0.8-67' %}

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

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

source:
  fn: foreign_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/foreign_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/foreign/foreign_{{ version }}.tar.gz
  sha256: ea797e171bdd5e80e31e40a7a1e93662a11c1a32934233f349165dff4b401f48

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

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

about:
  home: https://CRAN.R-project.org/package=foreign
  license: GPL (>= 2)
  summary: Functions for reading and writing data stored by some versions of Epi Info, Minitab,
    S, SAS, SPSS, Stata, Systat and Weka and for reading and writing some dBase files.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
