#!/bin/bash

echo "Installing Dinfio 3.2.01..."

[ -d /usr/local/dinfio ] || sudo mkdir /usr/local/dinfio

sudo cp -f dinfio /usr/local/dinfio/
sudo cp -f LICENSE /usr/local/dinfio/
sudo cp -f interactive.fio /usr/local/dinfio/
sudo cp -f help.fio /usr/local/dinfio/
sudo cp -f lib/* /lib/aarch64-linux-gnu/
sudo cp -rf modules/ /usr/local/dinfio/
sudo cp -rf dima/ /usr/local/dinfio/
sudo chmod +x /usr/local/dinfio/dinfio
sudo chmod +x /usr/local/dinfio/dima/dima
sudo rm -f /usr/local/bin/dinfio
sudo rm -f /usr/local/bin/dima
sudo ln -s /usr/local/dinfio/dinfio /usr/local/bin/dinfio
sudo ln -s /usr/local/dinfio/dima/dima /usr/local/bin/dima

sudo cp -f Dinfio.desktop /usr/share/applications/
sudo cp -f dinfio-icon.png /usr/share/pixmaps/

sudo rm -f /usr/local/dinfio/license.txt

echo "Dinfio 3.2.01 was successfully installed."
