{% set version = "0.9.9.2" %}

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

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

source:
  fn: fts_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/fts_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/fts/fts_{{ version }}.tar.gz
  sha256: f894988ab793508c56976cd845646baa62a43aa2b94c6d491b27ac964284fc22

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

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

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

  run:
    - r-base
    - r-bh
    - r-zoo

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

about:
  home: https://CRAN.R-project.org/package=fts
  license: GPL-3
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]
  summary: fast operations for time series objects

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - nsoranzo
