Yeah, unar's a package, just use Debian's

The Unarchiver for UNIX is available on Debian, Ubuntu, Fedora, and on
macOS under the package name "unar".  It's in Arch Linux as well called
"unarchiver".  What this means is we really have no need whatsoever to
download the source code and compile it, so we won't.

Also made install_archive_tools ignore args it doesn't understand.
This commit is contained in:
T. Joseph Carter 2018-05-10 09:30:10 -07:00
parent f7e46cb167
commit c7818ab379

View File

@ -90,52 +90,33 @@ install_shk2image() {
} }
install_unar() { install_unar() {
# Remove locally installed unar if found
if [[ -f /usr/local/bin/unar ]]; then
echo "Removing local unar in favor of the system package"
sudo rm -f /usr/local/bin/lsar
sudo rm -f /usr/local/bin/unar
sudo rm -f /usr/local/man/man1/lsar.1
sudo rm -f /usr/local/man/man1/unar.1
fi
# http://wakaba.c3.cx/s/apps/unarchiver.html # http://wakaba.c3.cx/s/apps/unarchiver.html
if ! hash unar 2> /dev/null; then if ! hash unar 2> /dev/null; then
echo "a2cloud: Installing unar (The Unarchiver)..."
### ArchiveTools: Install unar package
echo "A2CLOUD: Installing The Unarchiver..."
# jessie and later: Just use the unar package
sudo apt-get -y install unar sudo apt-get -y install unar
sudo apt-get clean sudo apt-get clean
# If all else fails, compile from source.
if ! hash unar 2> /dev/null; then
# Dependencies: build-deps for unar
sudo apt-get -y install build-essential libgnustep-base-dev libz-dev libbz2-dev libssl-dev libicu-dev unzip
sudo apt-get clean
local unarWork="$(mktemp -d /tmp/unar.XXXXXXXXXXXX)"
pushd "$unarWork" >/dev/null
if [[ $useExternalURL ]]; then
wget -O unar-1.8.1.zip https://github.com/incbee/Unarchiver/archive/unar-1.8.1.zip
unzip -o unar-1.8.1.zip &> /dev/null
fi
if [ ! -d *Unarchiver*/XADMaster ]; then # need single bracket for glob
wget -O unar-1.8.1.zip "${a2cBinaryURL}/source/unar-1.8.1.zip"
unzip -o unar-1.8.1.zip &> /dev/null
fi
cd *Unarchiver*/XADMaster
make -f Makefile.linux
sudo mv lsar unar /usr/local/bin
cd ../Extra
sudo mkdir -p /usr/local/man/man1
sudo mv lsar.1 unar.1 /usr/local/man/man1
popd >/dev/null
rm -rf "$unarWork"
sudo mandb &> /dev/null
fi
else else
echo "A2CLOUD: The Unarchiver has already been installed." echo "a2cloud: unar has already been installed."
fi fi
} }
noPicoPkg= noPicoPkg=
while [[ $1 ]]; do
if [[ $1 == -c ]]; then if [[ $1 == -c ]]; then
noPicoPkg=1 noPicoPkg=1
fi fi
shift
done
install_nulib2 install_nulib2
install_sciibin install_sciibin
install_shk2image install_shk2image