blob: 1e8e5361825038218b2ebcde2321e07467f3285e (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
pre_install() {
useradd -r mycroft-core -b /usr/share
}
post_install() {
chown -R mycroft-core:mycroft-core /usr/share/mycroft-core
touch /usr/share/mycroft-core/.bashrc
echo "# Virtualenv initialization" >> /usr/share/mycroft-core/.bashrc
echo "export WORKON_HOME=\$HOME/.virtualenvs" >> /usr/share/mycroft-core/.bashrc
echo "export PROJECT_HOME=\$HOME/Devel" >> /usr/share/mycroft-core/.bashrc
echo "source /usr/bin/virtualenvwrapper.sh" >> /usr/share/mycroft-core/.bashrc
sudo -Hu mycroft-core bash -c 'source ~/.bashrc' &> /dev/null # Initialize virtualenv
sudo -Hu mycroft-core bash -c 'source ~/.bashrc && mkvirtualenv mycroft --system-site-packages -p $(which python2)'
sudo -Hu mycroft-core bash -c 'source ~/.bashrc && workon mycroft && pip install -r /usr/share/mycroft-core/requirements.txt'
echo "*** ATTENTION ***"
echo ""
echo "* The users who will use Mycroft need to be part of the mycroft-core group"
echo ""
echo "* You can configure your Mycroft instance preferences systemwide at:"
echo " /usr/share/mycroft-core/mycroft/configuration/mycroft.conf"
echo ""
echo "* The systemd units are"
echo " - mycroft.target"
echo " - mycroft-service.service"
echo " - mycroft-skills.service"
echo " - mycroft-voice.service"
echo ""
echo "* Those are USER units which you can start issuing:"
echo " systemctl --user start mycroft.target"
echo " More information at: https://wiki.archlinux.org/index.php/Systemd/User"
}
post_upgrade() {
chown -R mycroft-core:mycroft-core /usr/share/mycroft-core
sudo -Hu mycroft-core bash -c "source ~/.bashrc && workon mycroft && pip install -r /usr/share/mycroft-core/requirements.txt"
echo "*** ATTENTION ***"
echo ""
echo "* Upgrading to version v0.8.0 without repairing requires to each of Mycroft's user to run:"
echo " cp ~/.mycroft/identity/identity.json ~/.mycroft/identity/identity2.json"
}
post_remove() {
groupdel mycroftcore
userdel mycroft-core
rm -rf /usr/share/mycroft-core
}
|