<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--
  Distribution template for the GAIA terminal hub, rendered and handed to
  productbuild by build-pkg.sh.

  Placeholders are substituted by build-pkg.sh. Every value it injects is
  derived from the CLI arguments, so the rendered file is deterministic:
    0.24.1             release version, e.g. 1.4.0
    x86_64  arm64 | x86_64  (matches the payload's architecture)
    ai.amd.gaia.terminal-hub      bundle identifier of the binaries component
    ai.amd.gaia.terminal-hub.docs     bundle identifier of the licence component
    gaia-terminal-hub-component.pkg       filename of the binaries component productbuild locates
    gaia-terminal-hub-docs-component.pkg  filename of the licence component productbuild locates

  Two components, not one: each is rooted at a directory holding only its own
  files, so its install location (/usr/local/bin, /usr/local/share/doc/gaia-tui)
  is never a payload entry. A package that shipped a /usr/local directory entry
  would reset it to root:wheel and break Homebrew on an Intel Mac.
-->
<installer-gui-script minSpecVersion="2">
    <title>GAIA Terminal Hub 0.24.1</title>
    <!-- macOS 11 Big Sur is the floor: it is the first release with arm64
         support, so a single minimum covers both slices we ship. -->
    <allowed-os-versions>
        <os-version min="11.0"/>
    </allowed-os-versions>
    <!-- System volume only. /usr/local/bin is not relocatable, so offering a
         destination choice would only let the user pick one that breaks. -->
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <!-- customize="never": the split into two components is a packaging
         detail, not a choice to offer; both are always installed.
         require-scripts="false": this distribution contains no JavaScript, so
         every attribute below is a literal, not an expression.
         hostArchitectures selects the architecture Installer.app itself runs
         as, which is the closest thing to an arch gate a script-free
         distribution has. Pinning it to the payload's own arch means the
         arm64 package will not open on Intel — better than installing a
         binary that cannot execute — and the x86_64 package asks for Rosetta
         on Apple silicon, which its payload needs anyway. -->
    <options customize="never" require-scripts="false" hostArchitectures="x86_64"/>
    <!-- Install order. The binaries component is last because it carries the
         postinstall that prints the finished install, and Installer runs the
         components in the order they are listed here. -->
    <choices-outline>
        <line choice="ai.amd.gaia.terminal-hub.docs"/>
        <line choice="ai.amd.gaia.terminal-hub"/>
    </choices-outline>
    <choice id="ai.amd.gaia.terminal-hub.docs" title="GAIA Terminal Hub licence" description="Installs LICENSE.md into /usr/local/share/doc/gaia-tui." visible="false" selected="true" enabled="false">
        <pkg-ref id="ai.amd.gaia.terminal-hub.docs"/>
    </choice>
    <choice id="ai.amd.gaia.terminal-hub" title="GAIA Terminal Hub" description="Installs the gaia-tui and gaia-agent command-line tools into /usr/local/bin." visible="false" selected="true" enabled="false">
        <pkg-ref id="ai.amd.gaia.terminal-hub"/>
    </choice>
    <pkg-ref id="ai.amd.gaia.terminal-hub.docs" version="0.24.1" onConclusion="none" installKBytes="2" updateKBytes="0">#gaia-terminal-hub-docs-component.pkg</pkg-ref>
    <pkg-ref id="ai.amd.gaia.terminal-hub" version="0.24.1" onConclusion="none" installKBytes="110279" updateKBytes="0">#gaia-terminal-hub-component.pkg</pkg-ref>
    <pkg-ref id="ai.amd.gaia.terminal-hub.docs">
        <bundle-version/>
    </pkg-ref>
    <pkg-ref id="ai.amd.gaia.terminal-hub">
        <bundle-version/>
    </pkg-ref>
</installer-gui-script>