# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
task-defaults:
    run:
        using: ubuntu-package
        dist: bionic

ub18-libc6:
    description: "Older version of glibc in Ubuntu 18.04 that doesn't cause bug 1678451"
    treeherder:
        symbol: Ub18(libc6)
    run:
        dsc:
            url: https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/glibc/2.27-3ubuntu1.2/glibc_2.27-3ubuntu1.2.dsc
            sha256: 2ac325cce2251c710dd041f4725925cdbccefba6f6f0f0d95a2a5a09e2050c2e
        patch: ubuntu-glibc.diff

ub18-32-libc6:
    description: "Older version of glibc in Ubuntu 18.04 that doesn't cause bug 1678451"
    treeherder:
        symbol: Ub18(libc6-32)
    run:
        dsc:
            url: https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/glibc/2.27-3ubuntu1.2/glibc_2.27-3ubuntu1.2.dsc
            sha256: 2ac325cce2251c710dd041f4725925cdbccefba6f6f0f0d95a2a5a09e2050c2e
        arch: i386
        patch: ubuntu-glibc.diff

ub18-python-psutil:
    description: "python-psutil for Ubuntu bionic"
    treeherder:
        symbol: Ub18(python-psutil)
    run:
        dsc:
            url: https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-psutil/5.4.2-1ubuntu0.1/python-psutil_5.4.2-1ubuntu0.1.dsc
            sha256: a0ca4560d25fcfe5b7407d2cb21318f0635f2c3559898efce1679eef35b61f05
        name: python-psutil
        pre-build-command: >-
            apt-get install python3.8-dev python3.8-dbg &&
            export DEBPYTHON3_SUPPORTED="3.8"

ub18-python-dbus:
    description: "python-dbus for Ubuntu bionic"
    treeherder:
        symbol: Ub18(python-dbus)
    run:
        dsc:
            url: https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/dbus-python/1.2.6-1/dbus-python_1.2.6-1.dsc
            sha256: a81fd35d3ca142910d1f7e3f8de57b99596d6e927173a57a44a2917c57eeb72f
        name: dbus-python
        pre-build-command: >-
            apt-get install python3.6-dev python3.6-dbg python3.8-dev python3.8-dbg &&
            export DEBPYTHON3_SUPPORTED="3.8,3.6"

ub18-pygobject:
    description: "pygobject for Ubuntu bionic"
    treeherder:
        symbol: Ub18(pygobject)
    run:
        dsc:
            url: http://archive.ubuntu.com/ubuntu/pool/main/p/pygobject/pygobject_3.26.1-2ubuntu1.dsc
            sha256: b77f84885d9b6d2c03422ecb3bf69d50dd0607d3456154943671e5a1f87946aa
        name: pygobject
        patch: pygobject.diff
        pre-build-command: >-
            apt-get install python3.8-dev python3.8-dbg &&
            export DEBPYTHON3_SUPPORTED="3.6,3.8"

ub18-pyatspi:
    description: "pyatspi for Ubuntu bionic"
    treeherder:
        symbol: Ub18(pyatspi)
    run:
        dsc:
            url: http://archive.ubuntu.com/ubuntu/pool/main/p/pyatspi/pyatspi_2.26.0+dfsg-1.dsc
            sha256: 83c57052b055c0e2ee8307e3467d069de859db6c362137be01d142e085026826
        name: pyatspi
        pre-build-command: >-
            sed -i s/\\basync\\b/asynchronous/ pyatspi/registry.py &&
            EDITOR=cat dpkg-source --commit . sync &&
            apt-get install python3.8-dev python3.8-dbg &&
            export DEBPYTHON3_SUPPORTED="3.6,3.8"

ub18-python-zstandard:
    description: "python-zstandard for Ubuntu bionic"
    treeherder:
        symbol: Ub18(python-zstandard)
    run:
        tarball:
            url: https://github.com/indygreg/python-zstandard/releases/download/0.19.0/zstandard-0.19.0.tar.gz
            sha256: 31d12fcd942dd8dbf52ca5f6b1bbe287f44e5d551a081a983ff3ea2082867863
        name: python-zstandard
        pre-build-command: >-
            apt-get install python3.8-dev &&
            export DEBPYTHON3_SUPPORTED="3.8" &&
            debchange -v 0.19.0-1.ub18moz --distribution bionic "Mozilla backport for bionic"

ub18-mercurial:
    description: "Modern Mercurial for Ubuntu bionic"
    treeherder:
        symbol: Ub18(hg)
    run:
        tarball:
            url: https://www.mercurial-scm.org/release/mercurial-6.8.1.tar.gz
            sha256: 030e8a7a6d590e4eaeb403ee25675615cd80d236f3ab8a0b56dcc84181158b05
        pre-build-command: >-
            apt-get install python3.8-dev &&
            export DEB_HG_PYTHON_VERSIONS="3.8" &&
            export DEBPYTHON3_SUPPORTED="3.8" &&
            cp -r contrib/packaging/debian debian &&
            sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub18moz1/" \
                         -e "s/__DATE__/$(date --rfc-2822)/" \
                         -e "s/__CODENAME__/bionic/" debian/changelog

ub20-python-zstandard:
    description: "python-zstandard for Ubuntu focal"
    treeherder:
        symbol: Ub20(python-zstandard)
    run:
        tarball:
            url: https://files.pythonhosted.org/packages/ed/f6/2ac0287b442160a89d726b17a9184a4c615bb5237db763791a7fd16d9df1/zstandard-0.23.0.tar.gz
            sha256: b2d8c62d08e7255f68f7a740bae85b3c9b8e5466baa9cbf7f57f1cde0ac6bc09
        name: python-zstandard
        dist: focal
        pre-build-command: debchange -v 0.23.0-1.ub20moz --distribution bionic "Mozilla backport for focal"

ub20-mercurial:
    description: "Modern Mercurial for Ubuntu focal"
    treeherder:
        symbol: Ub20(hg)
    run:
        tarball:
            url: https://www.mercurial-scm.org/release/mercurial-6.8.1.tar.gz
            sha256: 030e8a7a6d590e4eaeb403ee25675615cd80d236f3ab8a0b56dcc84181158b05
        dist: focal
        pre-build-command: >-
            cp -r contrib/packaging/debian debian &&
            sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub20moz1/" \
                         -e "s/__DATE__/$(date --rfc-2822)/" \
                         -e "s/__CODENAME__/focal/" debian/changelog

ub22-python-zstandard:
    description: "python-zstandard for Ubuntu jammy"
    treeherder:
        symbol: Ub22(python-zstandard)
    run:
        tarball:
            url: https://files.pythonhosted.org/packages/ed/f6/2ac0287b442160a89d726b17a9184a4c615bb5237db763791a7fd16d9df1/zstandard-0.23.0.tar.gz
            sha256: b2d8c62d08e7255f68f7a740bae85b3c9b8e5466baa9cbf7f57f1cde0ac6bc09
        name: python-zstandard
        dist: jammy
        pre-build-command: debchange -v 0.23.0-1.ub22moz --distribution jammy "Mozilla backport for jammy"

ub22-arm64-python-zstandard:
    worker-type: b-linux-gcp-aarch64
    description: "python-zstandard for Ubuntu jammy on ARM64"
    treeherder:
        symbol: Ub22a64(python-zstandard)
    run:
        tarball:
            url: https://files.pythonhosted.org/packages/ed/f6/2ac0287b442160a89d726b17a9184a4c615bb5237db763791a7fd16d9df1/zstandard-0.23.0.tar.gz
            sha256: b2d8c62d08e7255f68f7a740bae85b3c9b8e5466baa9cbf7f57f1cde0ac6bc09
        name: python-zstandard
        dist: jammy
        arch: arm64
        pre-build-command: debchange -v 0.23.0-1.ub22moz --distribution jammy "Mozilla backport for jammy"

ub22-mercurial:
    description: "Modern Mercurial for Ubuntu jammy"
    treeherder:
        symbol: Ub22(hg)
    run:
        tarball:
            url: https://www.mercurial-scm.org/release/mercurial-6.8.1.tar.gz
            sha256: 030e8a7a6d590e4eaeb403ee25675615cd80d236f3ab8a0b56dcc84181158b05
        dist: jammy
        pre-build-command: >-
            cp -r contrib/packaging/debian debian &&
            sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub22moz1/" \
                         -e "s/__DATE__/$(date --rfc-2822)/" \
                         -e "s/__CODENAME__/jammy/" debian/changelog

ub22-arm64-mercurial:
    worker-type: b-linux-gcp-aarch64
    description: "Modern Mercurial for Ubuntu jammy on ARM64"
    treeherder:
        symbol: Ub22a64(hg)
    run:
        tarball:
            url: https://www.mercurial-scm.org/release/mercurial-6.4.3.tar.gz
            sha256: a77fb62d325934a83a00b2fc6db109f44c67b86768fc40490366f513640c7f64
        dist: jammy
        arch: arm64
        pre-build-command: >-
            cp -r contrib/packaging/debian debian &&
            sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub22moz1/" \
                         -e "s/__DATE__/$(date --rfc-2822)/" \
                         -e "s/__CODENAME__/jammy/" debian/changelog

ub24-python-zstandard:
    description: "python-zstandard for Ubuntu noble"
    treeherder:
        symbol: Ub24(python-zstandard)
    run:
        tarball:
            url: https://files.pythonhosted.org/packages/ed/f6/2ac0287b442160a89d726b17a9184a4c615bb5237db763791a7fd16d9df1/zstandard-0.23.0.tar.gz
            sha256: b2d8c62d08e7255f68f7a740bae85b3c9b8e5466baa9cbf7f57f1cde0ac6bc09
        name: python-zstandard
        dist: noble
        pre-build-command: debchange -v 0.23.0-1.ub24moz --distribution noble "Mozilla backport for noble"

ub24-arm64-python-zstandard:
    worker-type: b-linux-gcp-aarch64
    description: "python-zstandard for Ubuntu noble on ARM64"
    treeherder:
        symbol: Ub24a64(python-zstandard)
    run:
        tarball:
            url: https://files.pythonhosted.org/packages/ed/f6/2ac0287b442160a89d726b17a9184a4c615bb5237db763791a7fd16d9df1/zstandard-0.23.0.tar.gz
            sha256: b2d8c62d08e7255f68f7a740bae85b3c9b8e5466baa9cbf7f57f1cde0ac6bc09
        name: python-zstandard
        dist: noble
        arch: arm64
        pre-build-command: debchange -v 0.23.0-1.ub24moz --distribution noble "Mozilla backport for noble"

ub24-mercurial:
    description: "Modern Mercurial for Ubuntu noble"
    treeherder:
        symbol: Ub24(hg)
    run:
        tarball:
            url: https://www.mercurial-scm.org/release/mercurial-6.8.1.tar.gz
            sha256: 030e8a7a6d590e4eaeb403ee25675615cd80d236f3ab8a0b56dcc84181158b05
        dist: noble
        pre-build-command: >-
            cp -r contrib/packaging/debian debian &&
            sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub24moz1/" \
                         -e "s/__DATE__/$(date --rfc-2822)/" \
                         -e "s/__CODENAME__/noble/" debian/changelog

ub24-arm64-mercurial:
    worker-type: b-linux-gcp-aarch64
    description: "Modern Mercurial for Ubuntu noble on ARM64"
    treeherder:
        symbol: Ub24a64(hg)
    run:
        tarball:
            url: https://www.mercurial-scm.org/release/mercurial-6.8.1.tar.gz
            sha256: 030e8a7a6d590e4eaeb403ee25675615cd80d236f3ab8a0b56dcc84181158b05
        dist: noble
        arch: arm64
        pre-build-command: >-
            cp -r contrib/packaging/debian debian &&
            sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub24moz1/" \
                         -e "s/__DATE__/$(date --rfc-2822)/" \
                         -e "s/__CODENAME__/noble/" debian/changelog
