{% set version = '0.5-1' %}

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

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

source:
  fn: units_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/units_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/units/units_{{ version }}.tar.gz
  sha256: 749bc6b81d623d27e6a8784eff34526aa4e371ce4880e91f49cbdd7de6830b1e

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-udunits2 >=0.13

  run:
    - r-base
    - r-udunits2 >=0.13

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

about:
  home: https://github.com/edzer/units/
  license: GPL-2
  summary: Support for measurement units in R vectors; automatic propagation, conversion, derivation
    and simplification of units; raising errors in case of unit incompatibility. Compatible
    with the difftime class. Uses the UNIDATA udunits library and unit database for
    unit conversion and compatibility checking.
  license_family: GPL2

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
