{% set version = '6.1.0' %}

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

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

source:
  fn: Delaporte_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/Delaporte_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/Delaporte/Delaporte_{{ version }}.tar.gz
  sha256: badfa181f5f0894287a647e6a455f01381b75bef351313dc950c80b60d9fecbe

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

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

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - libgcc  # [not win]

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

about:
  home: https://bitbucket.org/aadler/delaporte
  license: BSD_2_clause
  summary: Provides probability mass, distribution, quantile, random-variate generation, and
    method-of-moments parameter-estimation functions for the Delaporte distribution.
    The Delaporte is a discrete probability distribution which can be considered the
    convolution of a negative binomial distribution with a Poisson distribution. Alternatively,
    it can be considered a counting distribution with both Poisson and negative binomial
    components. It has been studied in actuarial science as a frequency distribution
    which has more variability than the Poisson, but less than the negative binomial.
  license_family: BSD

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