{% set name = "libzip" %}
{% set version = "1.5.1" %}
{% set sha256 = "47eaa45faa448c72bd6906e5a096846c469a185f293cafd8456abb165841b3f2" %}

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

source:
  fn: {{ name }}-{{ version }}.tar.gz
  url: https://libzip.org/download/libzip-{{ version }}.tar.gz
  sha256: {{ sha256 }}

build:
  # Skip py35 since py36 is built and uses same vc14
  number: 1002

requirements:
  build:
    - cmake
    - make                  # [not win]
    - perl
    - {{ compiler('c') }}
  host:
    - zlib
    - bzip2
    - openssl
    # perl is needed to run the package test
  run:
    - zlib
    - bzip2
    - openssl

test:
  commands:
    - test -f ${PREFIX}/bin/ziptool  # [linux or osx]
    - test -f ${PREFIX}/lib/libzip.so  # [linux]
    - test -f ${PREFIX}/lib/libzip.dylib  # [osx]
    - if not exist %LIBRARY_BIN%\\ziptool.exe exit 1  # [win]
    - if not exist %LIBRARY_LIB%\\zip.lib exit 1  # [win]

about:
  home: https://libzip.org/
  license: BSD-3-Clause
  license_family: BSD
  license_file: LICENSE
  summary: 'A C library for reading, creating, and modifying zip archives.'
  description: |
      libzip is a C library for reading, creating, and modifying zip archives.
      Files can be added from data buffers, files, or compressed data copied
      directly from other zip archives. Changes made without closing the
      archive can be reverted. The API is documented by man pages.
  doc_url: https://libzip.org/documentation/
  dev_url: https://github.com/nih-at/libzip

extra:
  recipe-maintainers:
    - ceholden
    - katietz
