abinfo Detect architecture
hdsentinelVer="017"
hdsentinelBaseName="hdsentinel-$hdsentinelVer"
if [[ "${CROSS:-$ARCH}" = "amd64" ]]; then
    hdsentinelFileName="$hdsentinelBaseName-x64"
elif [[ "${CROSS:-$ARCH}" = "i386" ]]; then
    hdsentinelFileName="$hdsentinelBaseName"
elif [[ "${CROSS:-$ARCH}" = "armv4" ]]; then
    hdsentinelFileName="$hdsentinelBaseName-arm"
elif [[ "${CROSS:-$ARCH}" = "armv6hf" ]]; then
    hdsentinelFileName="$hdsentinelBaseName-arm"
elif [[ "${CROSS:-$ARCH}" = "armv7hf" ]]; then
    hdsentinelFileName="$hdsentinelBaseName-arm"
else
    exit 1
fi

abinfo Downloading pre-built binaries
wget https://www.hdsentinel.com/hdslin/"$hdsentinelFileName".gz
gzip -d "$hdsentinelFileName".gz
chmod 0755 "$hdsentinelFileName"

abinfo Deploy files
mkdir -p "$PKGDIR"/usr/bin
mv "$hdsentinelFileName" "$PKGDIR"/usr/bin/hdsentinel
