|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
# A hacky script to generate .xbps files using satellites.
|
|
|
|
# It's a fairly simple wrapper to astronaut, that generates xbps packages.
|
|
|
|
|
|
|
|
# This may also serve as an example on how you can wrap astronaut to package in any format.
|
|
|
|
# Sure, no dependency resolution, and the packages won't make it in any official repositories,
|
|
|
|
# but it isn't meant for that anyway.
|
|
|
|
|
|
|
|
# Find astronaut
|
|
|
|
_astronaut="$(dirname "$0")/astronaut"
|
|
|
|
[ ! -f "$_astronaut" ] && _astronaut="astronaut"
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
wrapper_xbps_dir="$PWD"
|
|
|
|
|
|
|
|
# Wrapper functions
|
|
|
|
_astronaut_wrapper_pre() {
|
|
|
|
# Make sure to remove the contents of the install directory before building
|
|
|
|
_astronaut_nuke_install=true
|
|
|
|
}
|
|
|
|
|
|
|
|
_astronaut_wrapper_post() {
|
|
|
|
mkdir -p "$wrapper_xbps_dir"
|
|
|
|
cd "$wrapper_xbps_dir"
|
|
|
|
|
|
|
|
# Create the package
|
|
|
|
xbps-create --compression none -A "$(uname -m)" -n "$name_sat-${version}_astro" -s "Generated with xbps-astronaut" -H "$update_url" "$dir_install"
|
|
|
|
xbps-rindex -f -a "$name_sat-${version}_astro.$(uname -m).xbps"
|
|
|
|
}
|
|
|
|
|
|
|
|
. "$_astronaut"
|