New paste Repaste Download
#!/bin/bash
ZSRC=${ZSRC:-/sources}
cp -v alsa-package/sources/*.tar.* $ZSRC || { echo "Failed to Copy Sources. Exiting."; exit 1; }
stage_build=(alsa-package/alsa-lib-1.2.14.zbc  alsa-package/alsa-plugins-1.2.12.zbc
alsa-package/alsa-utils-1.2.14.zbc  alsa-package/nasm-2.16.03.zbc  alsa-package/yasm-1.3.0.zbc)
echo ${stage_build[@]}
## Creation: tar -cf alsaPack.tar alsa-install.sh alsa-package/*
Filename: alsa-install.sh. Size: 418b. View raw, , hex, or download this file.
#!/bin/bash
set +h
umask 022
zprint() { echo -e "${zzwhite} *** $* *** ${zzreset}"; }
zmsg() { echo -e "${zzred} *** $* *** ${zzreset}"; }
stars() { echo -e "${zzpurple} $(printf '%.0s*' {1..100}) ${zzreset}"; }
print_formatted_duration() {
    duration=$1
    hour=$((duration / 3600))
    mins=$(( (duration % 3600) / 60 ))
    sec=$((duration % 60))
    zprint $(printf "%02d Hours, %02d Minutes and %02d Seconds \n" ${hour} ${mins} ${sec})
}
zbuild_check() {
    local file="$1"
    if [[ -f ${ZBUILD}/${file} ]]; then
        return 0
    else
        stars
        zprint "Error: Missing $file ... Exiting"
        return 1
    fi
}
zbuild_wait() {
    local wait=${1:-5}
    zmsg "Waiting $wait seconds or Press [SPACE] to continue..."
    read -t $wait -n 1 key
    if [[ $key == " " ]]; then
        zmsg "Skipped wait."
    else
        zmsg "Continuing..."
    fi
}
zbuild_exec() {
    local file="$1"
    case "$file" in
        *.zbc)
            ${ZBUILD}/zbuild "${ZBUILD}/$file" || { echo "Error: $file - Exiting: $?"; return 1; }
            ;;
        *.sh)
            "${ZBUILD}/$file" || { echo "Error: $file - Exiting: $?"; return 1; }
            ;;
        *)
            zmsg "Invalid File Found in Stream"
            return 666
            ;;
    esac
}
#
#   Start of Package Builder
#
ZBefore=`date +%s`
zzreset="\033[0m"
zzwhite="\033[1;37m"
zzred="\033[1;31m"
zzpurple="\033[1;35m"
export ZSRC=/sources
export ZBUILD=/zbuild
if [[ -z $1 ]]; then
    zmsg "Source script required to run"
    exit 1
else
    source "$1"
fi
if [[ ${#stage_build[@]} -eq 0 ]]; then
    zmsg "Requires stage_build list of packages"
    exit 1
fi
for script in ${stage_build[@]}; do
    stars
    zprint "Executing ${script}"
    zbuild_check "${script}" || break
    zbuild_wait 5
    zbuild_exec "${script}"
    stars
done
ZAfter=`date +%s`
let duration=ZAfter-ZBefore
print_formatted_duration $duration
Filename: packBuild.sh. Size: 2kb. View raw, , hex, or download this file.

This paste expires on 2025-07-28 16:57:00.503100. Pasted through web.