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

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

source:
  fn: caTools_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/caTools_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/caTools/caTools_{{ version }}.tar.gz
  sha256: d53e2c5c77f1bd4744703d7196dbc9b4671a120bbb5b9b3edc45fc57c0650c06

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-bitops
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-bitops

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

about:
  home: https://CRAN.R-project.org/package=caTools
  license: GPL-3
  summary: 'Contains several basic utility functions including: moving (rolling, running) window
    statistic functions, read/write for GIF and ENVI binary files, fast calculation
    of AUC, LogitBoost classifier, base64 encoder/decoder, round-off-error-free sum
    and cumsum, etc.'
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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