{% set name = "s2n" %}
{% set version = "1.3.27" %}

package:
  name: {{ name|lower }}-split
  version: {{ version }}

source:
  url: https://github.com/awslabs/{{ name }}/archive/v{{ version }}.tar.gz
  sha256: 58dde9979867a3209a19098ffcd748a144b2462ec81edca5baf864313ff4f589

build:
  number: 0
  skip: true  # [win]
  run_exports:
    - {{ pin_subpackage("s2n", max_pin="x.x.x") }}

outputs:
  - name: s2n
    script: build-shared.sh  # [unix]
    script: bld-shared.bat  # [win]
    build:
      activate_in_script: true
      run_exports:
        - {{ pin_subpackage("s2n", max_pin="x.x.x") }}
      missing_dso_whitelist:
        - '$RPATH/ld64.so.1'  # [s390x]

    requirements:
      build:
        - cmake
        - {{ compiler('c') }}
        - ninja-base
      host:
        - openssl {{ openssl }}
    test:
      commands:
        - test -f $PREFIX/lib/libs2n${SHLIB_EXT}  # [unix]
        - test ! -f $PREFIX/lib/libs2n.a  # [unix]
        - test -f $PREFIX/include/s2n.h  # [unix]
  - name: s2n-static
    script: build-static.sh  # [unix]
    script: bld-static.bat  # [win]
    build:
      activate_in_script: true
    requirements:
      build:
        - cmake
        - {{ compiler('c') }}
        - ninja-base
      host:
        - openssl {{ openssl }}
        - {{ pin_subpackage("s2n", exact=True) }}
    test:
      commands:
        - test -f $PREFIX/lib/libs2n.a  # [unix]

about:
  home: https://github.com/awslabs/s2n
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE
  dev_url: https://github.com/aws/s2n-tls
  doc_url: https://aws.github.io/s2n-tls/doxygen/
  summary: an implementation of the TLS/SSL protocols
  description: |
    s2n-tls is a C99 implementation of the TLS/SSL protocols that is designed to be simple, small, fast, 
    and with security as a priority. It is released and licensed under the Apache License 2.0.

extra:
  recipe-maintainers:
    - xhochy
    - davidbrochart
