{% set version = '3.0.0' %}

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

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

source:
  fn: ecp_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/ecp_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/ecp/ecp_{{ version }}.tar.gz
  sha256: 12dc4ccb2b1dfeb652df68c534e2b5150ce1407f152e9a5101f0c6e5ce54076c

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

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-rcpp

  run:
    - r-base
    - r-rcpp

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

about:
  home: https://CRAN.R-project.org/package=ecp
  license: GPL (>= 2)
  summary: Implements various procedures for finding  multiple change-points. Two methods make
    use of dynamic  programming and probabilistic pruning, with no distributional  assumptions
    other than the existence of certain absolute  moments in one method. Hierarchical
    and exact search methods  are included. All methods return the set of estimated
    change- points as well as other summary information.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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