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

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

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

source:
  fn: PKI_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/PKI_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/PKI/PKI_{{ version }}.tar.gz
  sha256: 2fcca38b387ecaae6bbfea795f175adb06a21d653c7fceb972fbeb4826410cf6

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

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

  run:
    - r-base
    - r-base64enc

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

about:
  home: http://www.rforge.net/PKI
  license: GPL-2 (>= 2)
  summary: PKI functions such as verifying certificates, RSA encription and signing which can
    be used to build PKI infrastructure and perform cryptographic tasks.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
