|
@ -8,6 +8,7 @@ dir_source="$PWD/source" |
|
|
dir_install="$PWD/install" |
|
|
dir_install="$PWD/install" |
|
|
cmd_download="curl -#L -o {dst} {src}" |
|
|
cmd_download="curl -#L -o {dst} {src}" |
|
|
cmd_extract="tar xf {src}" |
|
|
cmd_extract="tar xf {src}" |
|
|
|
|
|
enable_movedirs=true |
|
|
enable_check=true |
|
|
enable_check=true |
|
|
if [ -f /etc/astronaut.conf ]; then |
|
|
if [ -f /etc/astronaut.conf ]; then |
|
|
. /etc/astronaut.conf |
|
|
. /etc/astronaut.conf |
|
@ -17,13 +18,15 @@ fi |
|
|
show_help() { |
|
|
show_help() { |
|
|
echo "This astronaut will help you build some satellites. |
|
|
echo "This astronaut will help you build some satellites. |
|
|
Just describe what he's got to do in a satellite file. |
|
|
Just describe what he's got to do in a satellite file. |
|
|
Usage: $0 [-s <dir>] [-b <dir>] [-i <dir>] [-cC] <satellite> |
|
|
Usage: $0 [-sbi <dir>] [-cCmM] <satellite> |
|
|
|
|
|
|
|
|
-s Set source directory |
|
|
-s Set source directory |
|
|
-b Set build directory [WARNING: Will be deleted before build] |
|
|
-b Set build directory [WARNING: Will be deleted before build] |
|
|
-i Set install directory |
|
|
-i Set install directory |
|
|
-c Enable package checking |
|
|
-c Enable package checking |
|
|
-C Disable package checking" |
|
|
-C Disable package checking |
|
|
|
|
|
-m Enable moving directories to match custom tree |
|
|
|
|
|
-M Disable moving directories to match custom tree" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
msg() { |
|
|
msg() { |
|
@ -36,7 +39,7 @@ exiterr() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Gather info |
|
|
# Gather info |
|
|
while getopts "h?s:b:i:cC" opt; do |
|
|
while getopts "h?s:b:i:cCmM" opt; do |
|
|
case "$opt" in |
|
|
case "$opt" in |
|
|
h|\?) |
|
|
h|\?) |
|
|
show_help |
|
|
show_help |
|
@ -55,10 +58,16 @@ while getopts "h?s:b:i:cC" opt; do |
|
|
dir_install="$(realpath "$OPTARG")" |
|
|
dir_install="$(realpath "$OPTARG")" |
|
|
;; |
|
|
;; |
|
|
c) |
|
|
c) |
|
|
enable_checking=true |
|
|
enable_check=true |
|
|
;; |
|
|
;; |
|
|
C) |
|
|
C) |
|
|
enable_checking=false |
|
|
enable_check=false |
|
|
|
|
|
;; |
|
|
|
|
|
m) |
|
|
|
|
|
enable_movedirs=true |
|
|
|
|
|
;; |
|
|
|
|
|
M) |
|
|
|
|
|
enable_movedirs=false |
|
|
;; |
|
|
;; |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |
|
@ -135,7 +144,7 @@ extrafile() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
do_check() { |
|
|
do_check() { |
|
|
if [ "$enable_check" = true ]; then |
|
|
if $enable_check; then |
|
|
if [ "$1" ]; then |
|
|
if [ "$1" ]; then |
|
|
$@ |
|
|
$@ |
|
|
else |
|
|
else |
|
@ -153,3 +162,18 @@ mkdir -p "$dir_install" |
|
|
|
|
|
|
|
|
cd "$dir_build" |
|
|
cd "$dir_build" |
|
|
. "$satellite" |
|
|
. "$satellite" |
|
|
|
|
|
|
|
|
|
|
|
if $enable_movedirs; then |
|
|
|
|
|
if [ "$(uname -m)" == "x86_64" ]; then |
|
|
|
|
|
if [ -d "$dir_install/lib64" ]; then |
|
|
|
|
|
mkdir -p "$dir_install/lib" |
|
|
|
|
|
mv $(find "$dir_install/lib64/" -maxdepth 1 -mindepth 1) "$dir_install/lib" |
|
|
|
|
|
rmdir "$dir_install/lib64" |
|
|
|
|
|
fi |
|
|
|
|
|
if [ -d "$dir_install/usr/lib64" ]; then |
|
|
|
|
|
mkdir -p "$dir_install/usr/lib" |
|
|
|
|
|
mv $(find "$dir_install/usr/lib64/" -maxdepth 1 -mindepth 1) "$dir_install/usr/lib" |
|
|
|
|
|
rmdir "$dir_install/usr/lib64" |
|
|
|
|
|
fi |
|
|
|
|
|
fi |
|
|
|
|
|
fi |
|
|