{% set version = '1.1.0' %}

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

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

source:
  fn: ps_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/ps_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/ps/ps_{{ version }}.tar.gz
  sha256: 5d5240d5bf1d48c721b3fdf47cfc9dbf878e388ea1f057b764db05bffdc4a9fe

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

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

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

about:
  home: https://github.com/r-lib/ps#readme
  license: BSD_3_clause
  license_file: LICENSE
  license_family: BSD
  summary: List, query and manipulate all system processes, on 'Windows', 'Linux' and 'macOS'

extra:
  recipe-maintainers:
    - ocefpaf
