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

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

source:
  fn: flexmix_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/flexmix_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/flexmix/flexmix_{{ version }}.tar.gz
  sha256: 837c7f175a211b3c484b2c7b81ec9729889a614c5c6e7d70c95a2c1d60ff846a

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-lattice
    - r-modeltools >=0.2_16
    - r-nnet
  run:
    - r-base
    - r-lattice
    - r-modeltools >=0.2_16
    - r-nnet

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

about:
  home: https://CRAN.R-project.org/package=flexmix
  license: GPL (>= 2)
  summary: A general framework for finite mixtures of regression models using the EM algorithm
    is implemented. The package provides the E-step and all data handling, while the
    M-step can be supplied by the user to easily define new models. Existing drivers
    implement mixtures of standard linear models, generalized linear models and model-based
    clustering.
  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
