{% set version = '2.0.6' %}

{% 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:
    - https://cran.r-project.org/src/contrib/cluster_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/cluster/cluster_{{ version }}.tar.gz
  sha256: f424b87f10595ed358b1ac80471b520ab9c767a4d203663c25b177c8ce5f8ffc

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

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

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base

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

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
