debian-forge-cli/tools/rpm_spec_add_provides_bundle.sh
Simon de Vlieger 60c22e3214 package: spec file
Provide a spec file for `image-builder-cli`. The spec file is based on
`osbuild-composer`'s spec file except it is simplified as (some)
usecases would currently cloud the intent of the specfile. We can add
back RHEL conditionals when/if we start shipping and building for RHEL.

Some tools from `osbuild-composer` are also included; most notably the
one that generates bundled dependencies from vendored modules.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-12-19 14:45:01 +00:00

13 lines
423 B
Bash
Executable file

#!/usr/bin/bash
SPEC_FILE=${1:-"image-builder-cli.spec"}
# Save the list of bundled packages into a file
WORKDIR=$(mktemp -d)
BUNDLES_FILE=${WORKDIR}/bundles.txt
./tools/rpm_spec_vendor2provides vendor/modules.txt > "${BUNDLES_FILE}"
# Remove the current bundle lines
sed -i '/^# BUNDLE_START/,/^# BUNDLE_END/{//p;d;}' "${SPEC_FILE}"
# Add the new bundle lines
sed -i "/^# BUNDLE_START/r ${BUNDLES_FILE}" "${SPEC_FILE}"