{% set version = "0.7-10" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/cplm_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/cplm/cplm_{{ version }}.tar.gz
  sha256: b3533e031f79579ce31d7dd3765ff0ea3b44435fafc258d84a18162340981257

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

requirements:
  build:
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-matrix
    - r-biglm
    - r-coda
    - r-ggplot2
    - r-minqa
    - r-nlme
    - r-reshape2
    - r-statmod
    - r-tweedie
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-matrix
    - r-biglm
    - r-coda
    - r-ggplot2
    - r-minqa
    - r-nlme
    - r-reshape2
    - r-statmod
    - r-tweedie

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

about:
  home: https://github.com/actuaryzhang/cplm
  license: GPL-2.0-or-later
  summary: Likelihood-based and Bayesian methods for various compound Poisson linear models based on Zhang, Yanwei (2013) <https://link.springer.com/article/10.1007/s11222-012-9343-7>.
  license_family: GPL3
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

extra:
  recipe-maintainers:
    - conda-forge/r
    - npavlovikj
