mid-kid 9 years ago
parent
commit
8da04b6f36
  1. 17
      astronaut/astronaut
  2. 30
      astronaut/astronaut.sat
  3. 2
      astronaut/template.sat
  4. 19
      satellites/astronaut.sat
  5. 1
      satellites/astronaut.sat

17
astronaut/astronaut

@ -8,7 +8,7 @@ dir_source="/tmp/astronaut/source" # Directory where the package sources will b
dir_install="/tmp/astronaut/install" # Directory where the package will be installed dir_install="/tmp/astronaut/install" # Directory where the package will be installed
# Runtime directories # Runtime directories
dir_sysroot="" # The root directory of the system dir_sysroot="/" # The root directory of the system
dir_prefix="/usr" # Prefix directory (for /bin, /lib, /share and such) dir_prefix="/usr" # Prefix directory (for /bin, /lib, /share and such)
# Default commands # Default commands
@ -258,7 +258,7 @@ if [ "$_download_only" = true ]; then
header_end() { exit; } header_end() { exit; }
fi fi
_satellite="$(realpath "$1")" _satellite="$1"
_satname="$(basename "$_satellite" .sat)" _satname="$(basename "$_satellite" .sat)"
# Try to find the satellite file if it can't be found. # Try to find the satellite file if it can't be found.
@ -266,7 +266,7 @@ if [ ! -f "$_satellite" ]; then
if [ -d "$dir_satellites" ]; then if [ -d "$dir_satellites" ]; then
file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)" file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)"
if [ -f "$file" ]; then if [ -f "$file" ]; then
_satellite="$(realpath "$file")" _satellite="$file"
_satname="$(basename "$_satellite" .sat)" _satname="$(basename "$_satellite" .sat)"
fi fi
fi fi
@ -277,10 +277,15 @@ if [ ! -f "$_satellite" ]; then
fi fi
fi fi
_satellite="$(realpath "$_satellite")"
# Build the definitive options list # Build the definitive options list
options="$_user_options$(package_options "$_satname"),$options" options="$_user_options$(package_options "$_satname"),$options"
# Create the directories # Create the directories
mkdir -p "$dir_source"
dir_source="$(realpath "$dir_source")"
if [ "$_download_only" = false ]; then if [ "$_download_only" = false ]; then
# This variable can be set by a wrapper script in need to nuke the install dir. # This variable can be set by a wrapper script in need to nuke the install dir.
if [ "$_nuke_dir_install" = true -a ! -z "$dir_install" ]; then if [ "$_nuke_dir_install" = true -a ! -z "$dir_install" ]; then
@ -289,7 +294,11 @@ if [ "$_download_only" = false ]; then
rm -rf "$dir_build" rm -rf "$dir_build"
mkdir -p "$dir_build" mkdir -p "$dir_build"
[ ! -z "$dir_install" ] && mkdir -p "$dir_install" mkdir -p "$dir_install"
dir_build="$(realpath "$dir_build")"
dir_install="$(realpath "$dir_install")"
dir_sysroot="$(realpath "$dir_sysroot")"
cd "$dir_build" cd "$dir_build"
fi fi

30
astronaut/astronaut.sat

@ -2,18 +2,28 @@ name=astronaut
version=$(date +%Y%m%d) version=$(date +%Y%m%d)
extrafile "astronaut" extrafile "astronaut"
extrafile "astrohelp"
extrafile "freshnaut" if option helpers; then
extrafile "xbps-astronaut" extrafile "astrohelp"
extrafile "pacman-astronaut" extrafile "freshnaut"
extrafile "astronautpkg" fi
option xbps extrafile "xbps-astronaut"
option pacman extrafile "pacman-astronaut"
option pkgtools extrafile "astronautpkg"
header_end header_end
install -D "astronaut" "$dir_install/$dir_prefix/bin/astronaut" install -D "astronaut" "$dir_install/$dir_prefix/bin/astronaut"
install -D "astrohelp" "$dir_install/$dir_prefix/bin/astrohelp"
install -D "freshnaut" "$dir_install/$dir_prefix/bin/freshnaut" # Optional helper tools
install -D "xbps-astronaut" "$dir_install/$dir_prefix/bin/xbps-astronaut" if option helpers; then
install -D "pacman-astronaut" "$dir_install/$dir_prefix/bin/pacman-astronaut" install -D "astrohelp" "$dir_install/$dir_prefix/bin/astrohelp"
install -D "astronautpkg" "$dir_install/$dir_prefix/bin/astronautpkg" install -D "freshnaut" "$dir_install/$dir_prefix/bin/freshnaut"
fi
# Wrappers for specific package managers
option xbps install -D "xbps-astronaut" "$dir_install/$dir_prefix/bin/xbps-astronaut"
option pacman install -D "pacman-astronaut" "$dir_install/$dir_prefix/bin/pacman-astronaut"
option pkgtools install -D "astronautpkg" "$dir_install/$dir_prefix/bin/astronautpkg"
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: # vim:set tabstop=4 shiftwidth=4 syntax=sh et:

2
astronaut/template.sat

@ -14,6 +14,6 @@ cd "$name-$version"
make make
option !no_check make check option !no_check make check
make DESTDIR="$dir_install" install make DESTDIR="$dir_install" install
rm "$dir_install/$dir_prefix/share/info/dir" # This file collides with some other packages. rm -f "$dir_install/$dir_prefix/share/info/dir" # This file collides with some other packages.
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: # vim:set tabstop=4 shiftwidth=4 syntax=sh et:

19
satellites/astronaut.sat

@ -1,19 +0,0 @@
name=astronaut
version=$(date +%Y%m%d)
extrafile "astronaut"
extrafile "astrohelp"
extrafile "freshnaut"
extrafile "xbps-astronaut"
extrafile "pacman-astronaut"
extrafile "astronautpkg"
header_end
install -D "astronaut" "$dir_install/$dir_prefix/bin/astronaut"
install -D "astrohelp" "$dir_install/$dir_prefix/bin/astrohelp"
install -D "freshnaut" "$dir_install/$dir_prefix/bin/freshnaut"
install -D "xbps-astronaut" "$dir_install/$dir_prefix/bin/xbps-astronaut"
install -D "pacman-astronaut" "$dir_install/$dir_prefix/bin/pacman-astronaut"
install -D "astronautpkg" "$dir_install/$dir_prefix/bin/astronautpkg"
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:

1
satellites/astronaut.sat

@ -0,0 +1 @@
../astronaut/astronaut.sat
Loading…
Cancel
Save