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

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

source:
  fn: base64url_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/base64url_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/base64url/base64url_{{ version }}.tar.gz
  sha256: 1d058f138660e9155ebb331d7a2561e2541ee3321b8da90f6c41fd8dcc122c58

build:
  merge_build_host: True  # [win]
  number: 1002
  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
    - r-backports >=1.1.0
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-backports >=1.1.0

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

about:
  home: https://github.com/mllg/base64url
  license: GPL-3
  summary: In contrast to RFC3548, the 62nd character ("+") is replaced with "-", the 63rd character
    ("/") is replaced with "_". Furthermore, the encoder does not fill the string with
    trailing "=". The resulting encoded strings comply to the regular expression pattern
    "[A-Za-z0-9_-]" and thus are safe to use in URLs or for file names. The package
    also comes with a simple base32 encoder/decoder suited for case insensitive file
    systems.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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