{% set version = '2.1.1' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/openssl_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/openssl/openssl_{{ version }}.tar.gz
  sha256: faa726f9af2a97d5fa1e1044f4a38ee2edd4c81f0beb5830f6a36ff249b64bdc

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: curl, testthat (>= 2.1.0), digest, knitr, rmarkdown, jsonlite, jose, sodium
requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [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
    - r-askpass
    - openssl

  run:
    - r-base
    - openssl
    - {{native}}gcc-libs         # [win]
    - r-askpass

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('openssl')"           # [not win]
    - "\"%R%\" -e \"library('openssl')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://jeroen.r-universe.dev/openssl
  license: MIT
  summary: Bindings to OpenSSL libssl and libcrypto, plus custom SSH key parsers. Supports RSA,
    DSA and EC curves P-256, P-384, P-521, and curve25519. Cryptographic signatures
    can either be created and verified manually or via x509 certificates. AES can be
    used in cbc, ctr or gcm mode for symmetric encryption; RSA for asymmetric (public
    key) encryption or EC for Diffie Hellman. High-level envelope functions combine
    RSA and AES for encrypting arbitrary sized data. Other utilities include key generators,
    hash functions (md5, sha1, sha256, etc), base64 encoder, a secure random number
    generator, and 'bignum' math methods for manually performing crypto calculations
    on large multibyte integers.
  license_family: MIT
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
    - LICENSE

extra:
  recipe-maintainers:
    - mingwandroid

# The original CRAN metadata for this package was:

# Package: openssl
# Type: Package
# Title: Toolkit for Encryption, Signatures and Certificates Based on OpenSSL
# Version: 2.1.1
# Authors@R: c(person("Jeroen", "Ooms", role = c("aut", "cre"), email = "jeroen@berkeley.edu", comment = c(ORCID = "0000-0002-4035-0289")), person("Oliver", "Keyes", role = "ctb"))
# Description: Bindings to OpenSSL libssl and libcrypto, plus custom SSH key parsers. Supports RSA, DSA and EC curves P-256, P-384, P-521, and curve25519. Cryptographic signatures can either be created and verified manually or via x509 certificates. AES can be used in cbc, ctr or gcm mode for symmetric encryption; RSA for asymmetric (public key) encryption or EC for Diffie Hellman. High-level envelope functions combine RSA and AES for encrypting arbitrary sized data. Other utilities include key generators, hash functions (md5, sha1, sha256, etc), base64 encoder, a secure random number generator, and 'bignum' math methods for manually performing crypto calculations on large multibyte integers.
# License: MIT + file LICENSE
# URL: https://jeroen.r-universe.dev/openssl
# BugReports: https://github.com/jeroen/openssl/issues
# SystemRequirements: OpenSSL >= 1.0.2
# VignetteBuilder: knitr
# Imports: askpass
# Suggests: curl, testthat (>= 2.1.0), digest, knitr, rmarkdown, jsonlite, jose, sodium
# RoxygenNote: 7.2.3
# Encoding: UTF-8
# NeedsCompilation: yes
# Packaged: 2023-09-25 17:30:46 UTC; jeroen
# Author: Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>), Oliver Keyes [ctb]
# Maintainer: Jeroen Ooms <jeroen@berkeley.edu>
# Repository: CRAN
# Date/Publication: 2023-09-25 19:10:02 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
