diff options
author | Rafael Reggiani Manzo | 2016-12-26 21:11:20 -0200 |
---|---|---|
committer | Rafael Reggiani Manzo | 2016-12-26 21:11:20 -0200 |
commit | 43703ca016da5f30206c708d6595657d354dc3e2 (patch) | |
tree | d53fdcf6e39a9a0b10d04f38541ab07a048bfef0 /mycroft-core.install | |
download | aur-43703ca016da5f30206c708d6595657d354dc3e2.tar.gz |
Initial installation
Still misses a patch to fix mimic path and propoper systemd units.
Diffstat (limited to 'mycroft-core.install')
-rw-r--r-- | mycroft-core.install | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mycroft-core.install b/mycroft-core.install new file mode 100644 index 000000000000..67ca2333d647 --- /dev/null +++ b/mycroft-core.install @@ -0,0 +1,28 @@ +pre_install() { + useradd -r mycroft-core -b /usr/share +} + +post_install() { + chown -R mycroft-core:mycroft-core /usr/share/mycroft-core + + # install packages + 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 -u mycroft-core bash -c 'source ~/.bashrc' &> /dev/null # Initialize virtualenv + + sudo -u mycroft-core bash -c 'source ~/.bashrc && mkvirtualenv mycroft --system-site-packages -p $(which python2)' + sudo -u mycroft-core bash -c 'source ~/.bashrc && workon mycroft && pip install -r /usr/share/mycroft-core/requirements.txt' +} + +post_upgrade() { + sudo -u mycroft-core bash -c "source ~/.bashrc && workon mycroft && pip install -r /usr/share/mycroft-core/requirements.txt" +} + +post_remove() { + userdel mycroft-core + rm -rf /usr/share/mycroft-core +} |