{% set version = '5.1-1' %}

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

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

source:
  fn: rms_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/rms_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/rms/rms_{{ version }}.tar.gz
  sha256: c489948df5c434b40bcf5288844f5b4e08d157f36939d09230c1600f88d1bfe3

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

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

requirements:
  build:
    - r-base
    - r-hmisc >=4.0_2
    - r-sparsem
    - r-ggplot2 >=2.2
    - r-htmltable
    - r-htmltools
    - r-lattice
    - r-multcomp
    - r-nlme >=3.1_123
    - r-polspline
    - r-quantreg
    - r-rpart
    - r-survival >=2.40_1
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-hmisc >=4.0_2
    - r-sparsem
    - r-ggplot2 >=2.2
    - r-htmltable
    - r-htmltools
    - r-lattice
    - r-multcomp
    - r-nlme >=3.1_123
    - r-polspline
    - r-quantreg
    - r-rpart
    - r-survival >=2.40_1
    - {{native}}gcc-libs   # [win]
    - libgcc               # [not win]

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

about:
  home: http://biostat.mc.vanderbilt.edu/rms
  license: GPL (>= 2)
  summary: "Regression modeling, testing, estimation, validation, graphics, prediction, and typesetting
    by storing enhanced model design attributes in the fit.  'rms' is a collection of
    functions that assist with and streamline modeling.  It also contains functions
    for binary and ordinal logistic regression models, ordinal models for continuous
    Y with a variety of distribution families, and the Buckley-James multiple regression
    model for right-censored responses, and implements penalized maximum likelihood
    estimation for logistic and ordinary linear models.  'rms' works with almost any
    regression model, but it was especially written to work with binary or ordinal regression
    models, Cox regression, accelerated failure time models, ordinary linear models,\tthe
    Buckley-James model, generalized least squares for serially or spatially correlated
    observations, generalized linear models, and quantile regression."
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'   # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'   # [win]

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