diff options
author | M0Rf30 | 2019-10-14 22:25:05 +0200 |
---|---|---|
committer | M0Rf30 | 2019-10-14 22:25:05 +0200 |
commit | ab1f8b91802f9931921b927546c7c9f6f6051a64 (patch) | |
tree | a93ae9cbba6e3b7bdf0e75ca43b34c909b20ec86 | |
parent | 605d8b4b79e9bd4490d1144d78fe20aa3b5f505d (diff) | |
download | aur-ab1f8b91802f9931921b927546c7c9f6f6051a64.tar.gz |
mycroft-core: a big cleanup
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 23 | ||||
-rw-r--r-- | mycroft-core.install | 35 | ||||
-rw-r--r-- | mycroft.pulseaudio | 6 | ||||
-rw-r--r-- | mycroft.sysusers | 2 | ||||
-rw-r--r-- | mycroft.tmpfiles | 4 |
6 files changed, 39 insertions, 39 deletions
@@ -1,7 +1,7 @@ pkgbase = mycroft-core pkgdesc = The Mycroft Artificial Intelligence platform. pkgver = 19.8.1 - pkgrel = 1 + pkgrel = 2 url = https://github.com/MycroftAI/mycroft-core install = mycroft-core.install arch = i686 @@ -33,10 +33,12 @@ pkgbase = mycroft-core source = mycroft.tmpfiles source = mycroft.sysusers source = mycroft.service + source = mycroft.pulseaudio md5sums = 04ec4428ad8ee3787e798bcd5a7ed23a - md5sums = e9a8f1095bb32a05946650e2993bdb37 - md5sums = 7c2f6981ea856fc10c64eab60d69569c + md5sums = 5fafd69eb177046827b9cb93c91e3802 + md5sums = f4b41cc9e1a7308c8833f0f7804d8c02 md5sums = a587888fcaf792ab9ceb6c698bb03ac3 + md5sums = ffd5e294798abaa35bb79f2b1afd40e1 pkgname = mycroft-core @@ -1,8 +1,9 @@ -# Maintainer: Thorben Guenther <echo YWRtaW5AeGVucm94Lm5ldAo= | base64 -d> +# Maintainer: robertfoster +# Contributor: Thorben Guenther <echo YWRtaW5AeGVucm94Lm5ldAo= | base64 -d> pkgname=mycroft-core pkgver=19.8.1 -pkgrel=1 +pkgrel=2 pkgdesc="The Mycroft Artificial Intelligence platform." arch=('i686' 'x86_64') url='https://github.com/MycroftAI/mycroft-core' @@ -28,7 +29,8 @@ install=mycroft-core.install source=("https://github.com/MycroftAI/mycroft-core/archive/release/v${pkgver}.tar.gz" "mycroft.tmpfiles" "mycroft.sysusers" -"mycroft.service") + "mycroft.service" +"mycroft.pulseaudio") prepare() { cd $srcdir/$pkgname-release-v$pkgver @@ -52,16 +54,21 @@ package() { install -D -m644 "${srcdir}/mycroft.sysusers" "${pkgdir}/usr/lib/sysusers.d/mycroft.conf" install -D -m644 "${srcdir}/mycroft.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/mycroft.conf" - # venv + # Virtualenv cd $pkgdir/usr/share/mycroft-core virtualenv .venv source .venv/bin/activate pip install -r requirements.txt - pip install py_mplayer + pip install https://github.com/JarbasAl/py_mplayer/archive/master.zip sed -i 's/^VIRTUAL_ENV=.*/VIRTUAL_ENV="\/usr\/share\/mycroft-core\/.venv"/g' .venv/bin/activate + rm .venv/bin/activate.{fish,csh} + find . -name "*.py[co]" -o -name __pycache__ -exec rm -rf {} + + install -D -m644 "${srcdir}/mycroft.pulseaudio" "${pkgdir}/usr/share/mycroft-core/pulse-client.conf" + } md5sums=('04ec4428ad8ee3787e798bcd5a7ed23a' - 'e9a8f1095bb32a05946650e2993bdb37' - '7c2f6981ea856fc10c64eab60d69569c' -'a587888fcaf792ab9ceb6c698bb03ac3') + '5fafd69eb177046827b9cb93c91e3802' + 'f4b41cc9e1a7308c8833f0f7804d8c02' + 'a587888fcaf792ab9ceb6c698bb03ac3' +'ffd5e294798abaa35bb79f2b1afd40e1') diff --git a/mycroft-core.install b/mycroft-core.install index af66b7303f23..6c71e9dba059 100644 --- a/mycroft-core.install +++ b/mycroft-core.install @@ -1,32 +1,15 @@ -usr=mycroft -home=/var/lib/mycroft -data=/usr/share/mycroft-core - post_install() { - _mkuser - _chown + echo "====> Please add mycroft user to audio group" + echo "==== sudo gpassd -a mycroft audio" + echo "====> Add this line to your default.pa PulseAudio file configuration" + echo "==== load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/pulse-socket" + echo "====> Read instructions under /usr/share/mycroft-core/pulseaudio-client.conf" + echo "====> Add this line into /etc/pulse/client.conf" + echo "==== autospawn=1" + echo "====> Finally run:" + echo "==== systemctl start mycroft.service" } post_upgrade() { post_install $1 } - -pre_remove() { - userdel $usr &> /dev/null - groupdel $usr &> /dev/null || true - rm -rf /var/log/$usr/ &> /dev/null || true -} - -_chown() { - chown -R $usr:$usr $home - chown -R $usr:$usr $data -} - -_mkuser() { - getent passwd $usr &>/dev/null || { - echo -n "Creating $usr user... " - grep -E "^$usr:" /etc/group >/dev/null || groupadd $usr - useradd -m -d $home -g $usr -G audio -s /usr/bin/nologin $usr 2>/dev/null - echo "done" - } -} diff --git a/mycroft.pulseaudio b/mycroft.pulseaudio new file mode 100644 index 000000000000..784060916c09 --- /dev/null +++ b/mycroft.pulseaudio @@ -0,0 +1,6 @@ +# This is a working example to get PulseAudio working when no root privileges are involved +# References to: +# https://wiki.archlinux.org/index.php/PulseAudio/Examples#Allowing_multiple_users_to_use_PulseAudio_at_the_same_time +# +# Copy this file into /var/lib/mycroft/.config/pulse/client.conf +default-server = unix:/tmp/pulse-socket diff --git a/mycroft.sysusers b/mycroft.sysusers index fcbe359ddb8d..ee92d9cf6a45 100644 --- a/mycroft.sysusers +++ b/mycroft.sysusers @@ -1,2 +1,2 @@ -u mycroft - - +u mycroft - "Mycroft" /var/lib/mycroft /usr/bin/login g mycroft - - diff --git a/mycroft.tmpfiles b/mycroft.tmpfiles index 30a77737090a..a376b96de142 100644 --- a/mycroft.tmpfiles +++ b/mycroft.tmpfiles @@ -1,4 +1,6 @@ -d /var/lib/mycroft 0755 mycroft mycroft +d /usr/share/mycroft-core 0755 mycroft mycroft +d /var/lib/mycroft 0755 mycroft mycroft +d /var/lib/mycroft/ 0755 mycroft mycroft d /var/log/mycroft 0755 mycroft mycroft d /opt/mycroft/ 0755 mycroft mycroft d /tmp/mycroft/ 0755 mycroft mycroft |