assistant.sh 1.5 KB
Newer Older
1 2 3
#!/bin/sh

PKGNAME=assistant
4 5
DESCRIPTION="Assistant (Ассистент) from the official site"

6 7 8 9 10 11 12 13
# Assistant reclaim their rpm package supports ALT
repack="--scripts"

if [ "$1" = "--remove" ] ; then
    epm remove $repack $PKGNAME
    exit
fi

14 15
. $(dirname $0)/common.sh

16 17 18 19 20 21 22

[ "$($DISTRVENDOR -a)" != "x86_64" ] && echo "Only x86_64 is supported" && exit 1

pkg="$($DISTRVENDOR -p)"

case $pkg in
    rpm)
23 24
        URL="https://мойассистент.рф/%D1%81%D0%BA%D0%B0%D1%87%D0%B0%D1%82%D1%8C/Download/542"
        OPKG=assistant-4.8-0.x86_64.rpm
25 26
        ;;
    deb)
27 28
        URL="https://мойассистент.рф/%D1%81%D0%BA%D0%B0%D1%87%D0%B0%D1%82%D1%8C/Download/545"
        OPKG=assistant_4.8-0_amd64.deb
29 30 31 32 33 34 35 36 37 38 39 40 41
        ;;
    *)
        fatal "$($DISTRVENDOR -e) is not supported (package type is $pkg)"
        ;;
esac

# after repack on ALT:
#  assistant: Требует: /lib/init/vars.sh но пакет не может быть установлен
#             Требует: libyuv.so()(64bit) но пакет не может быть установлен

#repack=''
#[ "$($DISTRVENDOR -p)" = "deb" ] || repack='--repack'

42
[ "$($DISTRVENDOR -d)" = "ALTLinux" ] && epmi --skip-installed fontconfig-disable-type1-font-for-assistant
43 44 45

OPKG=/tmp/$OPKG
$EGET -O $OPKG $URL
46
epm $repack install "$OPKG" || exit
47 48 49 50 51 52 53
rm -fv $OPKG

[ "$repack" = "--scripts" ] && echo "Warning! Privileged scripts from the vendor were running."

# after install:
#/usr/share/assistantd/daemon.sh --install
#/opt/assistant/scripts/fonts.sh --install