diff --git a/astronaut/astronaut b/astronaut/astronaut index 124b626..a9f5bfb 100755 --- a/astronaut/astronaut +++ b/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 # 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) # Default commands @@ -258,7 +258,7 @@ if [ "$_download_only" = true ]; then header_end() { exit; } fi -_satellite="$(realpath "$1")" +_satellite="$1" _satname="$(basename "$_satellite" .sat)" # 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 file="$(find "$dir_satellites" -type f \( -name "$_satname.sat" -o -name "$_satname" \) -print -quit)" if [ -f "$file" ]; then - _satellite="$(realpath "$file")" + _satellite="$file" _satname="$(basename "$_satellite" .sat)" fi fi @@ -277,10 +277,15 @@ if [ ! -f "$_satellite" ]; then fi fi +_satellite="$(realpath "$_satellite")" + # Build the definitive options list options="$_user_options$(package_options "$_satname"),$options" # Create the directories +mkdir -p "$dir_source" +dir_source="$(realpath "$dir_source")" + if [ "$_download_only" = false ]; then # 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 @@ -289,7 +294,11 @@ if [ "$_download_only" = false ]; then rm -rf "$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" fi diff --git a/astronaut/astronaut.sat b/astronaut/astronaut.sat index 1d81a10..319c3ad 100644 --- a/astronaut/astronaut.sat +++ b/astronaut/astronaut.sat @@ -2,18 +2,28 @@ name=astronaut version=$(date +%Y%m%d) extrafile "astronaut" -extrafile "astrohelp" -extrafile "freshnaut" -extrafile "xbps-astronaut" -extrafile "pacman-astronaut" -extrafile "astronautpkg" + +if option helpers; then + extrafile "astrohelp" + extrafile "freshnaut" +fi + +option xbps extrafile "xbps-astronaut" +option pacman extrafile "pacman-astronaut" +option pkgtools 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" + +# Optional helper tools +if option helpers; then + install -D "astrohelp" "$dir_install/$dir_prefix/bin/astrohelp" + 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: diff --git a/astronaut/template.sat b/astronaut/template.sat index 996797a..37f4d65 100644 --- a/astronaut/template.sat +++ b/astronaut/template.sat @@ -14,6 +14,6 @@ cd "$name-$version" make option !no_check make check 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: diff --git a/satellites/astronaut.sat b/satellites/astronaut.sat deleted file mode 100644 index 1d81a10..0000000 --- a/satellites/astronaut.sat +++ /dev/null @@ -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: diff --git a/satellites/astronaut.sat b/satellites/astronaut.sat new file mode 120000 index 0000000..df636ec --- /dev/null +++ b/satellites/astronaut.sat @@ -0,0 +1 @@ +../astronaut/astronaut.sat \ No newline at end of file