#!/bin/bash
set -xeuo pipefail
# This script copies the manifests from the current directory
# into their installed location.
manifestdir=/usr/share/doc/bootc-base-imagectl/manifests
mkdir -p "$manifestdir/"
for image in minimal standard tier-x; do
    # Embed the generic defaults
    cp -a $image $manifestdir/
    # And the Fedora-specific tweaks
    cp -a fedora-$image.yaml $manifestdir/
done
# Set the default
ln -s fedora-standard.yaml $manifestdir/default.yaml
# And install dependency manifests
cp -a fedora-includes $manifestdir
# And embed the rebuild script
install -m 0755 -t /usr/libexec ./bootc-base-imagectl
