{% set version = '2.1.3' %}

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

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

source:
  fn: gbm_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/gbm_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/gbm/gbm_{{ version }}.tar.gz
  sha256: eaf24be931d762f1ccca4f90e15997719d01005f152160a3d20d858a0bbed92b

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-lattice
    - r-survival

  run:
    - r-base
    - r-lattice
    - r-survival

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

about:
  home: http://code.google.com/p/gradientboostedmodels/
  license: GPL (>= 2)
  summary: An implementation of extensions to Freund and Schapire's AdaBoost algorithm and Friedman's
    gradient boosting machine. Includes regression methods for least squares, absolute
    loss, t-distribution loss, quantile regression, logistic, multinomial logistic,
    Poisson, Cox proportional hazards partial likelihood, AdaBoost exponential loss,
    Huberized hinge loss, and Learning to Rank measures (LambdaMart).
  license_family: GPL3

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