{% set version = '1.6.0' %}

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

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

source:
  fn: lubridate_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/lubridate_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/lubridate/lubridate_{{ version }}.tar.gz
  sha256: 1a87edfc2c57b22b6d9b49354545dd063e6c03a415544090b531c42423cf2632

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

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

requirements:
  build:
    - r-base
    - r-stringr
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-stringr
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=lubridate
  license: GPL-2
  summary: |
    Functions to work with date-times and time-spans: fast and user friendly parsing
    of date-time data, extraction and updating of components of a date-time (years,
    months, days, hours, minutes, and seconds), algebraic manipulation on date-time
    and time-span objects. The ''lubridate'' package has a consistent and memorable
    syntax that makes working with dates easy and fun.

  license_family: GPL2

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
