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

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

source:
  fn: coxphf_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/coxphf_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/coxphf/coxphf_{{ version }}.tar.gz
  sha256: de0bce775b400e38308123e101c9ec5847c2e0909a148dde3bbd97dd91557599

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

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

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

about:
  home: http://cemsiis.meduniwien.ac.at/kb/wf/software/statistische-software/fccoxphf/
  license: GPL-2 and GPL-3
  summary: Implements Firth's penalized maximum likelihood bias reduction method  for Cox regression
    which has been shown to provide a solution in case of monotone likelihood (nonconvergence
    of likelihood function). The program fits profile penalized likelihood confidence
    intervals which were proved to outperform Wald confidence intervals.
  license_family: GPL
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]

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