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

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

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

source:
  fn: spam_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/spam_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/spam/spam_{{ version }}.tar.gz
  sha256: acd3b00a4a3c8d61681620f11eb5d3b266ca911c0df09470bdcfeae1fcbddec8

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

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

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

  run:
    - r-base
    - r-dotcall64
    - libgcc  # [not win]

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

about:
  home: http://www.math.uzh.ch/furrer/software/spam/
  license: LGPL-2
  summary: 'Set of functions for sparse matrix algebra. Differences with other sparse matrix
    packages are: (1) we only support (essentially) one sparse matrix format, (2) based
    on transparent and simple structure(s), (3) tailored for MCMC calculations within
    G(M)RF. (4) and it is fast and scalable (with the extension package spam64).'

  license_family: LGPL

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