{% set version = '0.4.1' %}

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

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

source:
  fn: checkpoint_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/checkpoint_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/checkpoint/checkpoint_{{ version }}.tar.gz
  sha256: fb50dcd0d482a3af7e57dfa610bf79d7e1ef05ce770b5e26df514520993ee342

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

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

requirements:
  build:
    - r-base

  run:
    - r-base

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

about:
  home: https://github.com/RevolutionAnalytics/checkpoint
  license: GPL-2
  summary: The goal of checkpoint is to solve the problem of package reproducibility in R. Specifically,
    checkpoint allows you to install packages as they existed on CRAN on a specific
    snapshot date as if you had a CRAN time machine. To achieve reproducibility, the
    checkpoint() function installs the packages required or called by your project and
    scripts to a local library exactly as they existed at the specified point in time.
    Only those packages are available to your project, thereby avoiding any package
    updates that came later and may have altered your results. In this way, anyone using
    checkpoint's checkpoint() can ensure the reproducibility of your scripts or projects
    at any time. To create the snapshot archives, once a day (at midnight UTC) Microsoft
    refreshes the Austria CRAN mirror on the "Microsoft R Archived Network" server (<https://mran.microsoft.com/>).
    Immediately after completion of the rsync mirror process, the process takes a snapshot,
    thus creating the archive. Snapshot archives exist starting from 2014-09-17.
  license_family: GPL2

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
