commit:     36373359ecce4a3ec54dd5338e578e3267b828f0
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  2 13:40:52 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jul  2 13:40:52 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=36373359

[media-sound/mopidy] Install init script, systemd unit file and mopidyctl

Package-Manager: portage-2.2.20

 media-sound/mopidy/files/mopidy.initd              | 24 ++++++++++++++++++++++
 ...{mopidy-1.0.7.ebuild => mopidy-1.0.7-r1.ebuild} | 15 ++++++++++++--
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/media-sound/mopidy/files/mopidy.initd 
b/media-sound/mopidy/files/mopidy.initd
new file mode 100644
index 0000000..bf6cc10
--- /dev/null
+++ b/media-sound/mopidy/files/mopidy.initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+PIDFILE=/run/mopidy.pid
+
+start() {
+    ebegin "Starting mopidy"
+        start-stop-daemon --start --quiet --background \
+        --user mopidy \
+        --pidfile ${PIDFILE} --make-pidfile \
+        --exec /usr/bin/mopidy \
+        --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf\
+        -- --foreground
+    eend $?
+}
+
+stop() {
+    ebegin "Stopping mopidy"
+        start-stop-daemon --stop --quiet \
+        --pidfile ${PIDFILE}
+    eend $?
+}

diff --git a/media-sound/mopidy/mopidy-1.0.7.ebuild 
b/media-sound/mopidy/mopidy-1.0.7-r1.ebuild
similarity index 76%
rename from media-sound/mopidy/mopidy-1.0.7.ebuild
rename to media-sound/mopidy/mopidy-1.0.7-r1.ebuild
index c1090bf..90b730c 100644
--- a/media-sound/mopidy/mopidy-1.0.7.ebuild
+++ b/media-sound/mopidy/mopidy-1.0.7-r1.ebuild
@@ -5,7 +5,7 @@
 EAPI=5
 PYTHON_COMPAT=(python2_7)
 
-inherit eutils distutils-r1
+inherit eutils systemd distutils-r1
 
 DESCRIPTION="An extensible music server that plays music from local disk and 
more"
 HOMEPAGE="http://mopidy.com https://github.com/mopidy/mopidy";
@@ -30,10 +30,21 @@ DEPEND="test? ( ${RDEPEND}
 
 S=${WORKDIR}/Mopidy-${PV}
 
+pkg_setup() {
+       enewuser mopidy -1 -1 "/etc/mopidy" mopidy
+       enewgroup mopidy
+       distutils-r1_pkg_setup
+}
+
 src_install() {
        distutils-r1_src_install
-       domenu extra/desktop/mopidy.desktop || die
 
+       dobin extra/mopidyctl/mopidyctl
+       doman extra/mopidyctl/mopidyctl.8
+
+       newinitd "${FILESDIR}"/${PN}.initd ${PN}
+       systemd_dounit extra/systemd/mopidy.service
+       domenu extra/desktop/mopidy.desktop || die
 }
 
 python_test() {

Reply via email to