{% set version = '1.20.0' %}

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

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

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


  sha256: f920baa2a0ef7082155c8b666851af0c77534af8b2ca0cd067e7d56fdf3ec501

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


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

requirements:
  build:
    - r-base

  run:
    - r-base

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



about:
  home: https://github.com/trevorld/getopt
  license: GPL (>= 2)
  summary: Package designed to be used with Rscript to write ``#!'' shebang scripts that accept
    short and long flags/options. Many users will prefer using instead the packages
    optparse or argparse which add extra features like automatically generated help
    option and usage, support for default values, positional argument support, etc.
  license_family: GPL3



extra:
  recipe-maintainers:
    - croth1
