{% set version = "9.6.6" %}
{% set sha256 = "399cdffcb872f785ba67e25d275463d74521566318cfef8fe219050d063c8154" %}

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

source:
  fn: postgresql-{{ version }}.tar.bz2
  url: https://ftp.postgresql.org/pub/source/v{{ version }}/postgresql-{{ version }}.tar.bz2
  sha256: {{ sha256 }}
  patches:
    - fix_libraries_win.patch  # [win]
    # https://www.postgresql.org/message-id/attachment/43919/0002-Support-parallel-build-with-MSBuild.patch
    - symbol_tempfile.patch  # [win]

build:
  number: 0
  run_exports:
    - libpq  >={{ version }}

requirements:
  build:
    - {{ compiler('c') }}
    - m2-bison  # [win]
    - m2-diffutils  # [win]
    - m2-flex  # [win]
    - perl   # [win]
    - posix  # [win]
  host:
    - openssl
    - readline  # [not win]
    - zlib
    - krb5  # [not osx]

test:
  commands:
    - pg_config
    - postgres --help
    - conda inspect linkages postgresql  # [not win]
    - conda inspect objects postgresql  # [osx]

about:
  home: http://www.postgresql.org/
  license: PostgreSQL
  license_file: COPYRIGHT
  summary: 'PostgreSQL is a powerful, open source object-relational database system.'

extra:
  recipe-maintainers:
    - gillins
    - msarahan
    - ocefpaf
    - mariusvniekerk
