{% set version = '0.1.9' %}

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

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

source:
  fn: blockmodeling_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/blockmodeling_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/blockmodeling/blockmodeling_{{ version }}.tar.gz
  sha256: c93a74d439de861fc7a1c484dc0cc983a7330904f1cdef15a03ee1b2b98ba8e5

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=blockmodeling
  license: GPL-2 | GPL-3
  summary: This is primarily meant as an implementation of Generalized blockmodeling for valued
    networks. In addition, measures of similarity or dissimilarity based on structural
    equivalence and regular equivalence (REGE algorithm) can be computed and partitioned
    matrices can be plotted. This is a CRAN version. A newer version is available on
    R-forge, which for however lacks help files.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
