#!/usr/bin/bash set -e # Download the required files curl -L -o /app/stalwart-cli.tar.gz https://github.com/stalwartlabs/stalwart/releases/download/v${PACKAGE_VERSION}/stalwart-cli-x86_64-unknown-linux-gnu.tar.gz # Extract the binary tar -xzf /app/stalwart-cli.tar.gz -C /app # Make the binary executable chmod +x /app/stalwart-cli # Process the nfpm.yaml template with environment variables envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm