{% set version = '2.0.7-1' %}

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

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

source:
  fn: cluster_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/cluster_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/cluster/cluster_{{ version }}.tar.gz
  sha256: b10141090cf3c2b62260611a0ea822eb2f7bab9f4fd656c48bdc12b65c5c3dbf

build:
  merge_build_host: True  # [win]
  number: 0

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{native}}gcc-libs         # [win]

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

about:
  home: https://CRAN.R-project.org/package=cluster
  license: GPL (>= 2)
  summary: Methods for Cluster analysis.  Much extended the original from Peter Rousseeuw, Anja
    Struyf and Mia Hubert, based on Kaufman and Rousseeuw (1990) "Finding Groups in
    Data".
  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
