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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/arules_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/arules/arules_{{ version }}.tar.gz
  sha256: 26bde38c89d319fb86a7d4d5c7cef9935dea11ce058ec8d624a68c3995d1da6e

build:
  merge_build_host: True  # [win]
  number: 0
  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
    - r-matrix >=1.2_0
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-matrix >=1.2_0

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

about:
  home: https://github.com/mhahsler/arules, http://lyle.smu.edu/IDA/arules
  license: GPL-3
  summary: Provides the infrastructure for representing, manipulating and analyzing transaction
    data and patterns (frequent itemsets and association rules). Also provides C implementations
    of the association mining algorithms Apriori and Eclat.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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