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

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

source:
  fn: SEL_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/SEL_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/SEL/SEL_{{ version }}.tar.gz
  sha256: 41103d0d8f0c8a911956598f0ac076b68374c0dd532b849702633867ba0333db

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-lattice
    - r-quadprog
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-lattice
    - r-quadprog

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

about:
  home: https://CRAN.R-project.org/package=SEL
  license: GPL
  summary: This package implements a novel method for fitting a bounded probability distribution
    to quantiles (for example stated by an expert), see Bornkamp and Ickstadt (2009)
    for details.  For this purpose B-splines are used, and the density is obtained by
    penalized least squares based on a Brier entropy penalty.  The package provides
    methods for fitting the distribution as well as methods for evaluating the underlying
    density and cdf. In addition methods for plotting the distribution, drawing random
    numbers and calculating quantiles of the obtained distribution are provided.
  license_family: GPL
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - conda-forge/r
    - alexetnunes
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
