# See the documentation for more information:
# https://packit.dev/docs/configuration/

specfile_path: python-drgn.spec
files_to_sync:
  - python-drgn.spec
  - .packit.yaml

upstream_package_name: drgn
downstream_package_name: python-drgn
actions:
  get-current-version: "python3 setup.py --version"
  # Fetch the specfile from Rawhide, drop any patches and disable rpmautospec
  post-upstream-clone: "bash -c \"curl -s https://src.fedoraproject.org/rpms/python-drgn/raw/main/f/python-drgn.spec | sed -e '/^Patch[0-9]/d' -e '/^%autochangelog$/d' > python-drgn.spec\""

srpm_build_deps:
  - bash
  - curl
  - python3-setuptools
  - sed

jobs:
- job: copr_build
  trigger: commit
  owner: "@meta"
  project: drgn
  targets:
    fedora-all-aarch64: {}
    fedora-all-i386: {}
    fedora-all-ppc64le: {}
    fedora-all-s390x: {}
    fedora-all-x86_64: {}
    fedora-eln-aarch64: {}
    fedora-eln-ppc64le: {}
    fedora-eln-s390x: {}
    fedora-eln-x86_64: {}
    epel-8-aarch64: {}
    epel-8-ppc64le: {}
    epel-8-s390x: {}
    epel-8-x86_64: {}
    centos-stream+epel-next-9-aarch64:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/aarch64/
    centos-stream+epel-next-9-ppc64le:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/ppc64le/
    centos-stream+epel-next-9-s390x:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/s390x/
    centos-stream+epel-next-9-x86_64:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/x86_64/

- job: copr_build
  trigger: pull_request
  owner: "@meta"
  project: drgn
  targets:
    fedora-all-aarch64: {}
    fedora-all-i386: {}
    fedora-all-ppc64le: {}
    fedora-all-s390x: {}
    fedora-all-x86_64: {}
    fedora-eln-aarch64: {}
    fedora-eln-ppc64le: {}
    fedora-eln-s390x: {}
    fedora-eln-x86_64: {}
    epel-8-aarch64: {}
    epel-8-ppc64le: {}
    epel-8-s390x: {}
    epel-8-x86_64: {}
    centos-stream+epel-next-9-aarch64:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/aarch64/
    centos-stream+epel-next-9-ppc64le:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/ppc64le/
    centos-stream+epel-next-9-s390x:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/s390x/
    centos-stream+epel-next-9-x86_64:
      additional_repos:
        - https://kojihub.stream.centos.org/kojifiles/repos/c9s-build/latest/x86_64/
