{% set version = '1.7-3' %}

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

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

source:
  fn: Rserve_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/Rserve_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/Rserve/Rserve_{{ version }}.tar.gz


  sha256: f6d636c736c3f16487d9987e54554fe0c55257b9bc0671b43e536d832e513027

build:
  number: 0

  rpaths:
    - lib/R/lib/
    - lib/
  skip: True  # [win32]

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
    - make
    - libiconv             # [osx]

  run:
    - r-base
    - libiconv             # [osx]

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



about:
  home: http://www.rforge.net/Rserve/
  license: GPL-2
  summary: Rserve acts as a socket server (TCP/IP or local sockets)  which allows binary requests
    to be sent to R. Every connection has a separate workspace and working directory.
    Client-side implementations are available for popular languages such as C/C++ and
    Java, allowing any application to use facilities of R without the need of linking
    to R code. Rserve supports remote connection, user authentication and file transfer.
    A simple R client is included in this package as well.
  license_family: GPL2
  license_file: LICENSE



extra:
  recipe-maintainers:
    - croth1
