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

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

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

source:
  fn: tm_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/tm_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/tm/tm_{{ version }}.tar.gz
  sha256: 184dc285d3c53b8b4adacfd78b2b098c1bf8ead948d18719efa979a4a6cfe6fc

build:
  number: 0
  skip: true  # [win32]

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

requirements:
  build:
    - r-base
    - r-bh
    - r-nlp >=0.1_6.2
    - r-rcpp
    - r-slam >=0.1_37
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-bh
    - r-nlp >=0.1_6.2
    - r-rcpp
    - r-slam >=0.1_37

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

about:
  home: http://tm.r-forge.r-project.org/
  license: GPL-3
  summary: A framework for text mining applications within R.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
