{% set name = "cyrus-sasl" %}
{% set version = "2.1.26" %}
{% set hashtype = "sha256" %}
{% set hash = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3" %}

package:
  name: {{ name }}
  version: {{ version }}

source:
  - url: ftp://ftp.cyrusimap.org/cyrus-sasl/{{ name }}-{{ version }}.tar.gz
    {{ hashtype }}: {{ hash }}
    patches:
      - 0001-Include-stddef-in-sasl.h-for-size_t.patch
      - 0002-adjust-Makefile.am-files-for-osx.patch  # [osx]
      - 0003-fix-CVE-2013-4122.patch
      - 0004-windows-fixes.patch
      - 0005-openssl-1.1.1-support.patch
      - 0006-openssl-1.1.1-support-on-windows.patch
  # - url: https://github.com/cyrusimap/cyrus-sasl/raw/master/autogen.sh
  #   fn: cyrus-sasl-autogen.sh
  #   sha256: 59b2d067f956a2613bf6348fb3bfeb7f4197c53427fda3ac2774a143f9373eca
  # - url: http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
  #   fn: config.guess
  # - url: http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
  #   fn: config.sub

build:
  number: 4
  missing_dso_whitelist:          # [osx]
    - /usr/lib/libresolv.9.dylib  # [osx]
    - /usr/lib/libpam.2.dylib     # [osx]
  run_exports:
    # https://abi-laboratory.pro/tracker/timeline/cyrus-sasl/
    # SONAME was changed once in a patch release but it was 6 years ago so
    # giving them the benefit of the doubt that it was a one-off mistake.
    - {{ pin_subpackage('cyrus-sasl') }}

requirements:
  build:
    - {{ compiler('c') }}
    # - libtool
    # - pkg-config
    # - automake
    # - autoconf
    - make      # [unix]
  host:
    - krb5
    - libdb
    - openssl
    - libntlm   # [unix]
    - sqlite    # [win]
    - ldap3     # [win]

about:
  home: https://www.cyrusimap.org/sasl/
  license: BSD-3-Clause-Attribution
  license_family: BSD
  license_file: COPYING
  summary: |
    This is the Cyrus SASL API implementation. It can be used on the client or server side to provide
    authentication and authorization services. See RFC 4422 for more information.
  description: |
    Simple Authentication and Security Layer (SASL) is a specification that describes how
    authentication mechanisms can be plugged into an application protocol on the wire. Cyrus
    SASL is an implementation of SASL that makes it easy for application developers to integrate
    authentication mechanisms into their application in a generic way.
  dev_url: https://github.com/cyrusimap/cyrus-sasl
  doc_url: https://www.cyrusimap.org/sasl/

extra:
  recipe-maintainers:
    - mariusvniekerk
    - martindurant
    - mingwandroid
    - wesm
