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

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

source:
  fn: segmented_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/segmented_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/segmented/segmented_{{ version }}.tar.gz
  sha256: 98f2f0c23693d49527b43e7b6eb0746f2be7cb25715d2679e43015ec5d99315b

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=segmented
  license: GPL
  summary: Given a regression model, segmented `updates' the model by adding one or more segmented
    (i.e., piece-wise linear) relationships. Several variables with multiple breakpoints
    are allowed.
  license_family: GPL

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