summarylogtreecommitdiffstats
path: root/slimbookbattery.install
blob: 681ba5a05044e1cb55fc1a12af9661066f1025f0 (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
post_install() {
    python3 -OO -m py_compile /usr/share/slimbookbattery/preferences.py
    python3 -OO -m py_compile /usr/share/slimbookbattery/slimbookbattery
    python3 -OO -m py_compile /usr/share/slimbookbattery/slimbookbattery-changemode.py
    python3 -OO -m py_compile /usr/share/slimbookbattery/slimbookbattery-report.py

    rm /usr/share/slimbookbattery/preferences.py
    rm /usr/share/slimbookbattery/slimbookbattery
    rm /usr/share/slimbookbattery/slimbookbattery-changemode.py
    rm /usr/share/slimbookbattery/slimbookbattery-report.py

    cp /usr/share/slimbookbattery/__pycache__/preferences.cpython-*.pyc /usr/share/slimbookbattery/preferences.pyc
    cp /usr/share/slimbookbattery/__pycache__/slimbookbatterycpython-*.pyc /usr/share/slimbookbattery/slimbookbattery
    cp /usr/share/slimbookbattery/__pycache__/slimbookbattery-changemode.cpython-*.pyc /usr/share/slimbookbattery/slimbookbattery-changemode.pyc
    cp /usr/share/slimbookbattery/__pycache__/slimbookbattery-report.cpython-*.pyc /usr/share/slimbookbattery/slimbookbattery-report.pyc

    rm /usr/share/slimbookbattery/__pycache__/*
    rmdir /usr/share/slimbookbattery/__pycache__

    chmod +x /usr/share/slimbookbattery/bin/*
}

post_upgrade() {
    post_install
}

post_remove() {
    rm -rf /usr/share/slimbookbattery
}