{% set version = '2.2.2' %}

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

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

source:
  fn: changepoint_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/changepoint_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/changepoint/changepoint_{{ version }}.tar.gz
  sha256: 727edd88f1e39885654d319688bf088942984e240b28db2fbc204c764b8a73c9

build:
  merge_build_host: True  # [win]
  number: 1002
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
    - r-zoo >=0.9_1

  run:
    - r-base
    - r-zoo >=0.9_1

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

about:
  home: https://github.com/rkillick/changepoint/
  license: GPL
  summary: Implements various mainstream and specialised changepoint methods for finding single
    and multiple changepoints within data.  Many popular non-parametric and frequentist
    methods are included.  The cpt.mean(), cpt.var(), cpt.meanvar() functions should
    be your first point of call.
  license_family: GPL

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