summaryrefslogtreecommitdiff
path: root/community/mpdscribble
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-08-04 00:02:16 +0000
committerroot <root@rshg054.dnsready.net>2012-08-04 00:02:16 +0000
commitf8ac5d4703080cc87ba2fe36f68df745d3a5f62f (patch)
tree641ccb335800a868031ab1d89d554e5c1b0f0d9a /community/mpdscribble
parent60f7eab28ba0dd57c8ce519609f393dd3931b621 (diff)
Sat Aug 4 00:02:16 UTC 2012
Diffstat (limited to 'community/mpdscribble')
-rw-r--r--community/mpdscribble/PKGBUILD15
-rw-r--r--community/mpdscribble/rc.d37
-rw-r--r--community/mpdscribble/service12
3 files changed, 59 insertions, 5 deletions
diff --git a/community/mpdscribble/PKGBUILD b/community/mpdscribble/PKGBUILD
index 29398e037..a6f4aa032 100644
--- a/community/mpdscribble/PKGBUILD
+++ b/community/mpdscribble/PKGBUILD
@@ -1,3 +1,4 @@
+# $Id: PKGBUILD 74713 2012-08-02 09:37:39Z bpiotrowski $
# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowwski.pl>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: evr <evanroman at gmail>
@@ -5,17 +6,18 @@
pkgname=mpdscribble
pkgver=0.22
-pkgrel=3
+pkgrel=4
pkgdesc='An mpd client which submits track info to last.fm'
url='http://mpd.wikia.com/wiki/Client:Mpdscribble'
arch=('i686' 'x86_64')
license=('GPL')
depends=('libsoup' 'glib2' 'libmpdclient')
install='mpdscribble.install'
-source=("http://downloads.sourceforge.net/musicpd/mpdscribble-${pkgver}.tar.bz2"
- 'mpdscribble')
+source=(http://downloads.sourceforge.net/musicpd/mpdscribble-${pkgver}.tar.bz2
+ rc.d service)
md5sums=('652ee927b797e9a4cef45494e77047db'
- 'f54c937c7b3ab8e4d39e4b903c2993fc')
+ 'f54c937c7b3ab8e4d39e4b903c2993fc'
+ '7e0a80c12225b0fe7be9c993f0079e95')
build() {
cd mpdscribble-${pkgver}
@@ -33,9 +35,12 @@ package() {
make DESTDIR="${pkgdir}" install
- install -D "${srcdir}"/mpdscribble \
+ install -D "${srcdir}"/rc.d \
"${pkgdir}"/etc/rc.d/mpdscribble
+ install -D "${srcdir}"/service \
+ "${pkgdir}"/usr/lib/systemd/system/mpdscribble.service
+
# default config is really an example
install -D -m644 "${pkgdir}"/etc/mpdscribble.conf \
"${pkgdir}"/usr/share/mpdscribble/mpdscribble.conf.example
diff --git a/community/mpdscribble/rc.d b/community/mpdscribble/rc.d
new file mode 100644
index 000000000..8071c0dbe
--- /dev/null
+++ b/community/mpdscribble/rc.d
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/bin/mpdscribble`
+case "$1" in
+ start)
+ stat_busy "Starting mpdscribble"
+ [ -z "$PID" ] && /usr/bin/mpdscribble &
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ echo $PID > /var/run/mpdscribble.pid
+ add_daemon mpdscribble
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping mpdscribble"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm /var/run/mpdscribble.pid
+ rm_daemon mpdscribble
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
diff --git a/community/mpdscribble/service b/community/mpdscribble/service
new file mode 100644
index 000000000..1475866ce
--- /dev/null
+++ b/community/mpdscribble/service
@@ -0,0 +1,12 @@
+[Unit]
+Description=last.fm updater for MPD
+Wants=mpd.service
+After=mpd.service
+
+[Service]
+Type=forking
+PIDFile=/run/mpdscribble.pid
+ExecStart=/usr/bin/mpdscribble --pidfile /run/mpdscribble.pid
+
+[Install]
+WantedBy=multi-user.target