Update scripts

This commit is contained in:
Tiago Conceição
2023-04-22 18:45:50 +01:00
parent b4504f83a5
commit a384c8584c
5 changed files with 67 additions and 79 deletions
+4 -4
View File
@@ -36,24 +36,24 @@ elif testcmd apt; then
#apt install -y libdc1394-22 libopenexr24
#apt install -y libdc1394-25 libopenexr25
#apt install -y libjpeg-dev libpng-dev libgeotiff-dev libgeotiff5 libavcodec-dev libavformat-dev libswscale-dev libtbb-dev libgl1-mesa-dev libgdiplus
apt install -y libgeotiff5 libgdiplus
#apt install -y libgeotiff5 libgdiplus
# mini only requires: libgdiplus libgeotiff-dev libgeotiff5
elif testcmd pacman; then
osVariant="arch"
pacman -Syu
#pacman -S openjpeg2 libjpeg-turbo libpng libgeotiff libdc1394 ffmpeg openexr tbb libgdiplus
pacman -S libgeotiff libgdiplus
#pacman -S libgeotiff libgdiplus
elif testcmd dnf; then
osVariant="rhel"
dnf update -y
#dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
#dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
#dnf install -y libjpeg-devel libjpeg-turbo-devel libpng-devel libgeotiff-devel libdc1394-devel ffmpeg-devel tbb-devel mesa-libGL libgdiplus
dnf install -y libgeotiff libgdiplus
#dnf install -y libgeotiff libgdiplus
elif testcmd zypper; then
osVariant="suse"
zypper refresh
zypper install -y libgeotiff5 libgdiplus0
#zypper install -y libgeotiff5 libgdiplus0
else
echo "Error: Base operative system / package manager not identified, nothing was installed"
exit -1
+15 -14
View File
@@ -175,21 +175,22 @@ else
fi
LDCONFIG=''
if testcmd ldconfig; then
LDCONFIG='ldconfig'
else
LDCONFIG="$(whereis ldconfig | awk '{ print $2 }')"
fi
# Not required for mini
#LDCONFIG=''
#if testcmd ldconfig; then
# LDCONFIG='ldconfig'
#else
# LDCONFIG="$(whereis ldconfig | awk '{ print $2 }')"
#fi
if [ -n "$LDCONFIG" ]; then
if [ -z "$($LDCONFIG -p | grep libgeotiff)" -o -z "$($LDCONFIG -p | grep libgdiplus)" ]; then
echo "- Missing dependencies found, installing..."
sudo bash -c "$(curl -fsSL $dependencies_url)"
fi
else
echo "Unable to detect for missing dependencies, ldconfig not found, however installation will continue."
fi
#if [ -n "$LDCONFIG" ]; then
# if [ -z "$($LDCONFIG -p | grep libgeotiff)" -o -z "$($LDCONFIG -p | grep libgdiplus)" ]; then
# echo "- Missing dependencies found, installing..."
# sudo bash -c "$(curl -fsSL $dependencies_url)"
# fi
#else
# echo "Unable to detect for missing dependencies, ldconfig not found, however installation will continue."
#fi
echo '- Detecting download'
response="$(curl -s "$api_url")"
-49
View File
@@ -1,49 +0,0 @@
#!/bin/bash
# Attempts to create symbolic for libdl.so
# And to solve the OpenCV "unable to load shared library 'cvextern' or one of its dependencies" error
# Note: Run with sudo bash not sh!
#
# Author: Tiago Conceição
# Version: 1
#
if [ $EUID -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
#####################
## CONFIGURATION ##
#####################
libdlso="libdl.so"
libdlso2="libdl.so.2"
directories="/lib"
directories="$directories /usr/lib64"
directories="$directories /lib/x86_64-linux-gnu"
#####################
## DON'T TOUCH ##
#####################
checks=0
links=0
echo "Attempting to create symbolic from '$libdlso2' to '$libdlso' on known path's:"
ldconfig -p | grep libdl
echo ""
for directory in $directories; do
let "checks++"
echo "Checking for $directory/$libdlso2"
if [[ -f "$directory/$libdlso2" && ! -f "$directory/$libdlso" ]]; then
echo "Match: Creating symbolic link to $libdlso"
ln -s "$directory/$libdlso2" "$directory/$libdlso"
let "links++"
fi
done
echo ""
echo "######## Results #########"
echo "File checks: $checks"
echo "Created links: $links"
echo "Finished!"
echo "##########################"