improve compiled
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
version=1.7
|
version=1.7
|
||||||
wget=http://www.cantab.net/users/john.wiseman/Downloads/QtTermSource.zip
|
wget=http://www.cantab.net/users/john.wiseman/Downloads/QtTermSource.zip
|
||||||
install=$HOME/.local/bin
|
install=$HOME/.local/bin
|
||||||
steps=mkdir qttermtcp, cd qttermtcp, unzip, qmake, make
|
steps=qmake, make, mv QtTermTCP $HOME/.local/bin/
|
||||||
|
|
||||||
#[wsjtx]
|
#[wsjtx]
|
||||||
#version=2.7.0
|
#version=2.7.0
|
||||||
|
|||||||
@@ -106,27 +106,59 @@ fetch_source() {
|
|||||||
if [ -n "$git_url" ]; then
|
if [ -n "$git_url" ]; then
|
||||||
echo " Cloning $git_url..."
|
echo " Cloning $git_url..."
|
||||||
git clone "$git_url" "$src_dir"
|
git clone "$git_url" "$src_dir"
|
||||||
|
|
||||||
elif [ -n "$wget_url" ]; then
|
elif [ -n "$wget_url" ]; then
|
||||||
echo " Downloading $wget_url..."
|
echo " Downloading $wget_url..."
|
||||||
wget -q "$wget_url" -P "$TMP_DIR"
|
|
||||||
local filename="${wget_url##*/}"
|
local filename="${wget_url##*/}"
|
||||||
tar -xf "$TMP_DIR/$filename" -C "$src_dir" --strip-components=1
|
local filepath="$TMP_DIR/$filename"
|
||||||
rm -f "$TMP_DIR/$filename"
|
|
||||||
|
wget -q "$wget_url" -O "$filepath"
|
||||||
|
|
||||||
|
echo " Extracting $filename..."
|
||||||
|
case "$filename" in
|
||||||
|
*.zip)
|
||||||
|
unzip -q "$filepath" -d "$TMP_DIR"
|
||||||
|
local extracted
|
||||||
|
extracted=$(unzip -qql "$filepath" | head -n1 | awk '{print $NF}' | cut -d/ -f1)
|
||||||
|
mv "$TMP_DIR/$extracted" "$src_dir"
|
||||||
|
;;
|
||||||
|
*.tar.gz|*.tgz)
|
||||||
|
tar -xzf "$filepath" -C "$src_dir" --strip-components=1
|
||||||
|
;;
|
||||||
|
*.tar.bz2)
|
||||||
|
tar -xjf "$filepath" -C "$src_dir" --strip-components=1
|
||||||
|
;;
|
||||||
|
*.tar.xz)
|
||||||
|
tar -xJf "$filepath" -C "$src_dir" --strip-components=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo " Error: unknown file type for $filename"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
rm -f "$filepath"
|
||||||
else
|
else
|
||||||
echo " Error: no git or wget URL specified for $app"
|
echo " Error: no git or wget URL specified for $app"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Parse and run steps for a given app
|
# cd into source directory and run steps
|
||||||
run_steps() {
|
run_steps() {
|
||||||
local app="$1"
|
local app="$1"
|
||||||
local steps="$2"
|
local steps="$2"
|
||||||
local src_dir="$TMP_DIR/$app"
|
local src_dir="$TMP_DIR/$app"
|
||||||
|
|
||||||
echo " Building $app..."
|
if [ ! -d "$src_dir" ]; then
|
||||||
|
echo " Error: source directory $src_dir not found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " Changing into $src_dir..."
|
||||||
cd "$src_dir"
|
cd "$src_dir"
|
||||||
|
|
||||||
|
echo " Building $app..."
|
||||||
IFS=',' read -ra step_list <<< "$steps"
|
IFS=',' read -ra step_list <<< "$steps"
|
||||||
for step in "${step_list[@]}"; do
|
for step in "${step_list[@]}"; do
|
||||||
step=$(echo "$step" | xargs)
|
step=$(echo "$step" | xargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user