You need to sign in or sign up before continuing.
okular-csp.sh 2.57 KB
Newer Older
1 2 3
#!/bin/sh

PKGNAME=okular-csp
4
SKIPREPACK=1
5
SUPPORTEDARCHES="x86_64"
6
VERSION="$2"
7
DESCRIPTION="Okular GOST (free version) with CryptoPro support from the official site"
8
URL="https://packages.lab50.net"
9 10 11 12 13
REPOURL="http://packages.lab50.net"

# TODO: remove repo too
case "$1" in
    "--remove")
14
        epm remove $(epm qp $PKGNAME-) $(epm qp poppler-csp-)
15
        epm repo remove okular
16 17 18 19 20 21
        exit
        ;;
esac

. $(dirname $0)/common.sh

22
warn_version_is_not_supported
23 24 25 26 27

# see
# https://okulargost.ru/info.html
# http://packages.lab50.net/okular/install

28
distr=$(epm print info -e)
29 30
distrib=$(epm print info --repo-name)
vendor=$(epm print info -s)
31 32 33

# Strict supported list
case $(epm print info -e) in
34
    Debian/1*|Ubuntu/20.04)
35
        ;;
36
    AstraLinuxSE/1.7*)
37
        ;;
38
    Fedora/3*|ROSA/2021.1|RedOS/*)
39
        distrib=$vendor
40
        ;;
41
    ALTLinux/*)
42 43 44 45 46 47 48 49
        ;;
    *)
        fatal "Unsupported distro $(epm print info -e). Ask application vendor for a support."
        ;;
esac


# CryptoPro needed for install
50
if ! epm qp "cprocsp-" >/dev/null ; then
51 52
    # TODO: install ecryptomgr here and check ecryptomgr status cryptopro
    fatal "Install CryptoPro before (install ecryptomgr package and check https://github.com/Etersoft/ecryptomgr )"
53 54 55
# TODO: check:
# $ tar -xf linux-amd64_deb.tgz -C /tmp
# $ sudo /tmp/linux-amd64_deb/install.sh cprocsp-rdr-gui-gtk
56 57 58
fi


Vitaly Lipatov's avatar
Vitaly Lipatov committed
59
pkgsystem=$(epm print info -g)
60 61

case $(epm print info -e) in
Vitaly Lipatov's avatar
Vitaly Lipatov committed
62
# TODO:
63
    AstraLinuxCE*)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
64 65 66 67
        pkgsystem=''
        epm repo addkey "$REPOURL/lab50.gpg"
        epm repo add "deb $REPOURL/ce stable main"
        ;;
68
# TODO:
69
    AstraLinuxSE*)
70 71 72
        distrib=alse17
        additional_packages="libkf5js5=5.78.0-0ubuntu2+alse17 libkf5jsapi5=5.78.0-0ubuntu2+alse17"
        ;;
73 74 75 76
esac

case $vendor in
    alt)
77 78
        epm installed lsb-cprocsp-capilite-64 || fatal "lsb-cprocsp-capilite-64 is not installed. Use 'ecryptomgr install cryptopro' to install it."
        epm installed cprocsp-pki-cades-64 || fatal "cprocsp-pki-cades-64 is not installed. Use 'ecryptomgr install cades' to install it."
79 80 81 82 83 84
# TODO get key info from gpg file
        epm repo addkey "$REPOURL/lab50.gpg" "D0C721136AFF9319DCF8276EA98DF0BE319FACDA" "Laboratory 50 (APT Archive Key) <team@lab50.net>"
        epm repo add "rpm [lab50] $REPOURL/okular/alt x86_64 p10"
        ;;
esac

Vitaly Lipatov's avatar
Vitaly Lipatov committed
85
case $pkgsystem in
86 87
    apt-dpkg)
        epm repo addkey "$REPOURL/lab50.gpg"
88
        epm repo add "deb $REPOURL/okular $distrib main non-free"
89 90 91 92 93 94 95 96
        ;;
    dnf-rpm)
        epm repo add "$REPOURL/okular/$distrib/okularcsp.repo"
        ;;
esac

epm update
epm install okular-csp $additional_packages