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

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

source:
  fn: fracdiff_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/fracdiff_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/fracdiff/fracdiff_{{ version }}.tar.gz
  sha256: 983781cedc2b4e3ba9fa020213957d5133ae9cd6710bc61d6225728e2f6e850e

build:
  merge_build_host: True  # [win]
  number: 1003
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}        # [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('fracdiff')"           # [not win]
    - "\"%R%\" -e \"library('fracdiff')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=fracdiff
  license: GPL (>= 2)
  summary: Maximum likelihood estimation of the parameters of a fractionally differenced ARIMA(p,d,q)
    model (Haslett and Raftery, Appl.Statistics, 1989).
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - conda-forge/r
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
