{% set version = '0.5' %}

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

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

source:
  fn: mime_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/mime_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/mime/mime_{{ version }}.tar.gz
  sha256: fcc72115afb0eb43237da872754464f37ae9ae097f332ec7984149b5e3a82145

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('mime')"  # [not win]
    - "\"%R%\" -e \"library('mime')\""  # [win]

about:
  home: https://github.com/yihui/mime
  license: GPL
  summary: Guesses the MIME type from a filename extension using the data derived from /etc/mime.types
    in UNIX-type systems.
  license_family: GPL

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
