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

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

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

source:
  fn: PolynomF_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/PolynomF_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/PolynomF/PolynomF_{{ version }}.tar.gz

  sha256: 177dd41678886d9da2fde35ab8a33ddbda4b5eaea36e3084f0cd870b07d9256b

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

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

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

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=PolynomF
  license: GPL-2
  summary: Implements univariate polynomial operations in R, including polynomial arithmetic,
    finding zeros, plotting, and some operations on lists of polynomials.
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]
extra:
   recipe-maintainers:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - Johanneskoester
    - Bgruening
    - Daler
    - Jdblischak
