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

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

source:
  fn: mlogit_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/mlogit_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/mlogit/mlogit_{{ version }}.tar.gz
  sha256: c1d99d39fd411fb01d593f289325ff025bc714611818ed9310da7d1f167f2f3b

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-formula
    - r-mass
    - r-lmtest
    - r-maxlik
    - r-statmod
    - r-zoo
  run:
    - r-base
    - r-formula
    - r-mass
    - r-lmtest
    - r-maxlik
    - r-statmod
    - r-zoo

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

about:
  home: https://cran.r-project.org/package=mlogit, https://r-forge.r-project.org/projects/mlogit/
  license: GPL (>= 2)
  summary: Maximum Likelihood estimation of random utility discrete choice models (logit and
    probit).
  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
    - cbrueffer
    - dbast
    - nsoranzo
