sferum.sh 1.01 KB
Newer Older
1
#!/bin/sh
Vitaly Lipatov's avatar
Vitaly Lipatov committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

# TODO: common place
fatal()
{
    echo "FATAL: $*" >&2
    exit 1
}

PKGNAME=sferum

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

17
[ "$1" != "--run" ] && echo "Sferum for Linux from the official site" && exit
Vitaly Lipatov's avatar
Vitaly Lipatov committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

arch=$($DISTRVENDOR --distro-arch)
case $arch in
    x86_64|amd64)
        arch=$arch ;;
    i686|i386)
        arch=$arch ;;
    i586)
        arch=i686 ;;
    *)
        fatal "Unsupported arch $arch for $($DISTRVENDOR -d)"
esac

repack=''
[ "$($DISTRVENDOR -d)" = "ALTLinux" ] && repack='--repack'

#https://st.mycdn.me/static/sferum/latest/sferum-i386.deb
#https://st.mycdn.me/static/sferum/latest/sferum-amd64.deb
#https://st.mycdn.me/static/sferum/latest/sferum-i686.rpm
#https://st.mycdn.me/static/sferum/latest/sferum-x86_64.rpm

39
# can't use constructname due '-' before arch
Vitaly Lipatov's avatar
Vitaly Lipatov committed
40 41
#epm install "https://st.mycdn.me/static/sferum/latest/$(epm print constructname $PKGNAME '' $arch '' '-')"
epm $repack install "https://st.mycdn.me/static/sferum/latest/$PKGNAME-$arch.$($DISTRVENDOR -p)"