{% set version = '0.5.4' %}

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

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

source:
  fn: sparklyr_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/sparklyr_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/sparklyr/sparklyr_{{ version }}.tar.gz
  sha256: 571472524d368308fbc2a1269bfdbf4ba9484f3e382a22501b8d0e696df84e98

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-dbi >=0.6
    - r-assertthat
    - r-base64enc
    - r-config
    - r-digest
    - r-dplyr >=0.5.0
    - r-httr
    - r-jsonlite
    - r-lazyeval >=0.2.0
    - r-rappdirs
    - r-readr >=0.2.0
    - r-rprojroot
    - r-withr

  run:
    - r-base
    - r-dbi >=0.6
    - r-assertthat
    - r-base64enc
    - r-config
    - r-digest
    - r-dplyr >=0.5.0
    - r-httr
    - r-jsonlite
    - r-lazyeval >=0.2.0
    - r-rappdirs
    - r-readr >=0.2.0
    - r-rprojroot
    - r-withr

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

about:
  home: http://spark.rstudio.com
  license: Apache 2.0
  summary: |
    R interface to Apache Spark, a fast and general engine for big data processing.
    This package supports connecting to local and remote
    Apache Spark clusters, provides a 'dplyr' compatible back-end, and provides an interface
    to Spark's built-in machine learning algorithms.
  license_family: APACHE

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
