summarylogtreecommitdiffstats
path: root/lx-music-desktop.install
blob: efbdfa33233be22853fd32a2e64c2cebabd15d3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
post_install() {
    :
#!/bin/bash

if type update-alternatives 2>/dev/null >&1; then
    # Remove previous link if it doesn't use update-alternatives
    if [ -L '/usr/bin/lx-music-desktop' -a -e '/usr/bin/lx-music-desktop' -a "`readlink '/usr/bin/lx-music-desktop'`" != '/etc/alternatives/lx-music-desktop' ]; then
        rm -f '/usr/bin/lx-music-desktop'
    fi
    update-alternatives --install '/usr/bin/lx-music-desktop' 'lx-music-desktop' '/opt/lx-music-desktop/lx-music-desktop' 100 || ln -sf '/opt/lx-music-desktop/lx-music-desktop' '/usr/bin/lx-music-desktop'
else
    ln -sf '/opt/lx-music-desktop/lx-music-desktop' '/usr/bin/lx-music-desktop'
fi

# SUID chrome-sandbox for Electron 5+
chmod 4755 '/opt/lx-music-desktop/chrome-sandbox' || true

if hash update-mime-database 2>/dev/null; then
    update-mime-database /usr/share/mime || true
fi

if hash update-desktop-database 2>/dev/null; then
    update-desktop-database /usr/share/applications || true
fi

}
post_remove() {
    :
#!/bin/bash

# Delete the link to the binary
if type update-alternatives >/dev/null 2>&1; then
    update-alternatives --remove 'lx-music-desktop' '/usr/bin/lx-music-desktop'
else
    rm -f '/usr/bin/lx-music-desktop'
fi

}