{% set version = '5.0-0' %}

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

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

source:
  fn: Lahman_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/Lahman_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/Lahman/Lahman_{{ version }}.tar.gz
  sha256: 9d0ef0a8309e3fdf7598477fdf4d834d946ff1b5013a9ca9d4969ae19e7eee0f

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

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

requirements:
  build:
    - r-base
    - r-dplyr

  run:
    - r-base
    - r-dplyr

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

about:
  home: http://lahman.r-forge.r-project.org/
  license: GPL
  summary: Provides the tables from the 'Sean Lahman Baseball Database' as a set of R data.frames.
    It uses the data on pitching, hitting and fielding performance and other tables
    from 1871 through 2015, as recorded in the 2016 version of the database.
  license_family: GPL

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
