{% set version = '1.0-6' %}

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

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

source:
  fn: BradleyTerry2_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/BradleyTerry2_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/BradleyTerry2/BradleyTerry2_{{ version }}.tar.gz
  sha256: 2d8cf29094552f01d28880e0ad2084be4441c6ef820f288117d479c2ddc10081

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-brglm
    - r-gtools
    - r-lme4 >=1.0
  run:
    - r-base
    - r-brglm
    - r-gtools
    - r-lme4 >=1.0

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

about:
  home: http://bradleyterry2.r-forge.r-project.org
  license: GPL (>= 2)
  summary: |
    Specify and fit the Bradley-Terry model, including structured versions in which the
    parameters are related to explanatory variables through a linear predictor and versions
    with contest-specific effects, such as a home advantage.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
