{% set version = "7.65.3" %}

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

source:
  url: http://curl.haxx.se/download/curl-{{ version }}.tar.bz2
  sha256: 0a855e83be482d7bc9ea00e05bdb1551a44966076762f9650959179c89fce509

build:
  number: 0

requirements:
  build:
    - {{ compiler("c") }}
    - make             # [unix]
    # perl is required to run the tests on UNIX.
    - perl  # [unix]
    - pkg-config  # [unix]
  host:
    - zlib
    - krb5
    - libssh2
    # uses winssl for windows, so no openssl there
    - openssl        # [unix]
    - zlib


outputs:
  - name: libcurl
    requirements:
      build:
        - {{ compiler("c") }}
      host:
        - openssl   # [unix]
        - zlib
        - libssh2
        - krb5
      run:
        - libssh2
    build:
      run_exports:
        - {{ pin_subpackage('libcurl') }}
    files:
      - include/curl             # [unix]
      - lib/libcurl*             # [unix]
      - lib/pkgconfig/libcurl*   # [unix]
      - bin/curl-config          # [unix]
      - Library/bin/libcurl.dll  # [win]
      - Library/include/curl     # [win]
      - Library/lib/libcurl*     # [win]
    test:
      commands:
        - curl-config --features       # [not win]
        - curl-config --protocols      # [not win]

  - name: curl
    files:
      - bin/curl               # [unix]
      - Library/bin/curl.exe   # [win]
      - Library/bin/curl.exe.manifest  # [win]
    requirements:
      build:
        - {{ compiler('c') }}
      host:
        - {{ pin_subpackage('libcurl', exact=True) }}
        - zlib
        - libssh2
        - krb5
      run:
        - {{ pin_subpackage('libcurl', exact=True) }}
        - libssh2
    test:
      commands:
        # curl help commands on Windows have non-zero status codes.  Need other test.
        - curl --help
        # Try downloading something from https to make sure the certs are used correctly.
        - curl https://raw.githubusercontent.com/conda-forge/curl-feedstock/master/LICENSE

about:
  home: http://curl.haxx.se/
  license: MIT/X derivate (http://curl.haxx.se/docs/copyright.html)
  license_family: MIT
  license_file: COPYING
  summary: tool and library for transferring data with URL syntax
  
  description: |
    Curl is an open source command line tool and library for transferring data
    with URL syntax. It is used in command lines or scripts to transfer data.
  doc_url: https://curl.haxx.se/docs/
  dev_url: https://github.com/curl/curl
  doc_source_url: https://github.com/curl/curl/tree/master/docs

extra:
  recipe-maintainers:
    - msarahan
    - jakirkham
    - ocefpaf
    - mingwandroid
