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

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

source:
  fn: pingr_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/pingr_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/pingr/pingr_{{ version }}.tar.gz
  sha256: af5edb7f5906021cd0777ba6574095e845b9a33307131191e7c6f34ae513d09d

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

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

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

about:
  home: https://github.com/gaborcsardi/pingr
  license: MIT
  summary: Check if a remote computer is up. It can either just call the system ping command,
    or check a specified TCP port.
  license_family: MIT

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