From fa1c09c45b64e180f8deb8c7d4858e1a2eb5fb01 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 9 Dec 2013 11:55:44 -0600
Subject: runit-scripts: add mpd

The config file is stock, and will need to be changed for each persons setup

refs #931
---
 abs/core/runit-scripts/runitscripts/services/mpd/log/run | 5 +++++
 abs/core/runit-scripts/runitscripts/services/mpd/run     | 9 +++++++++
 2 files changed, 14 insertions(+)
 create mode 100755 abs/core/runit-scripts/runitscripts/services/mpd/log/run
 create mode 100755 abs/core/runit-scripts/runitscripts/services/mpd/run

diff --git a/abs/core/runit-scripts/runitscripts/services/mpd/log/run b/abs/core/runit-scripts/runitscripts/services/mpd/log/run
new file mode 100755
index 0000000..bc856fe
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/mpd/log/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+exec 2>&1
+. /etc/systemconfig
+ /usr/bin/logger -t mpd
+
diff --git a/abs/core/runit-scripts/runitscripts/services/mpd/run b/abs/core/runit-scripts/runitscripts/services/mpd/run
new file mode 100755
index 0000000..c4bd347
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/mpd/run
@@ -0,0 +1,9 @@
+#!/bin/sh
+export TERM=linux
+. /etc/rc.conf
+. /etc/rc.d/functions
+stat_runit "Starting mpd"
+
+
+exec 2>&1
+exec /usr/bin/mpd --no-daemon --stdout 2>&1
-- 
cgit v0.12


From bbf857eb8190fce32a4191e61dd28b890a7ea059 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 9 Dec 2013 11:57:09 -0600
Subject: runit-scripts:  fix cron and frontend logging to their own file

---
 abs/core/runit-scripts/PKGBUILD                    | 11 ++++---
 abs/core/runit-scripts/fbsplash-runit.sh           | 37 ++++++++++++++++++++++
 .../runitscripts/services/cron/log/run             |  2 +-
 .../runitscripts/services/frontend/log/run         |  2 +-
 4 files changed, 46 insertions(+), 6 deletions(-)
 create mode 100644 abs/core/runit-scripts/fbsplash-runit.sh

diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index 745edb3..1f1c12c 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=runit-scripts
 pkgver=8.1
-pkgrel=2
+pkgrel=3
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
@@ -10,7 +10,7 @@ conflicts=()
 replaces=()
 backup=('etc/runit/1.local' 'etc/runit/3.local')
 install=runit.install
-source=()
+source=('fbsplash-runit.sh')
 arch=('i686' 'x86_64')
 
 build() {
@@ -24,11 +24,14 @@ package() {
   install -d $pkgdir/etc/sv
   install -d $pkgdir/sbin
   install -d $pkgdir/etc/rc.d/functions.d
-
+  
+  #this file contains the function runit-stat  which is needed by the runit service scripts
+  install -m755 $srcdir/fbsplash-runit.sh $pkgdir/etc/rc.d/functions.d/fbsplash-runit.sh
+  
   install -m0700 1 2 3 1.local 3.local ctrlaltdel $pkgdir/etc/runit
   install -m0755 reboot-runit halt-runit logger $pkgdir/sbin
   rsync -a --exclude=.svn services/* $pkgdir/etc/sv
   chmod -R  755 $pkgdir/etc/sv
   chown -R root:root $pkgdir/etc/sv
 }
-md5sums=()
+md5sums=('30b944b91aa1f57c5469c8bd210cb497')
diff --git a/abs/core/runit-scripts/fbsplash-runit.sh b/abs/core/runit-scripts/fbsplash-runit.sh
new file mode 100644
index 0000000..9fb9591
--- /dev/null
+++ b/abs/core/runit-scripts/fbsplash-runit.sh
@@ -0,0 +1,37 @@
+# fbsplash functions.d runit script #
+
+printhlr() {
+               printf "${C_OTHER}${PREFIX_REG} ${C_H1}${1}${C_CLEAR} \n"
+           }
+
+stat_runit(){
+    printf ""
+    printhlr "${C_MAIN}${1}${C_CLEAR} "
+}
+
+
+# splash stuff #
+if [ -e /etc/conf.d/fbcondecor ]
+then
+    . /etc/conf.d/fbcondecor
+    . /sbin/splash-functions.sh
+
+    case $0 in /etc/runit/1 )
+        # Prevent splash destruction
+        CONSOLEFONT=""
+        # Continue to use a splash daemon started in initcpio
+        if /bin/mountpoint -q /run/.splash-cache; then
+            /bin/mount --move /run/.splash-cache $spl_cachedir || return
+        # Mount a tmpfs
+        else
+            ( splash_cache_prep ) || return
+        fi
+
+        splash_comm_send set message "$SPLASH_BOOT_MESSAGE"
+
+    ;; /etc/runit/3 )
+        ( splash_cache_prep ) || return
+
+        splash_comm_send set message "$SPLASH_SHUTDOWN_MESSAGE"
+    esac
+fi
diff --git a/abs/core/runit-scripts/runitscripts/services/cron/log/run b/abs/core/runit-scripts/runitscripts/services/cron/log/run
index 9dd37e3..785d6c7 100755
--- a/abs/core/runit-scripts/runitscripts/services/cron/log/run
+++ b/abs/core/runit-scripts/runitscripts/services/cron/log/run
@@ -1,5 +1,5 @@
 #!/bin/sh
 exec 2>&1
 . /etc/systemconfig
- /usr/bin/logger -p local6.info -t cron 
+ /usr/bin/logger -t cron 
 
diff --git a/abs/core/runit-scripts/runitscripts/services/frontend/log/run b/abs/core/runit-scripts/runitscripts/services/frontend/log/run
index 801eaf2..bd431b2 100755
--- a/abs/core/runit-scripts/runitscripts/services/frontend/log/run
+++ b/abs/core/runit-scripts/runitscripts/services/frontend/log/run
@@ -1,5 +1,5 @@
 #!/bin/sh
 exec 2>&1
 . /etc/systemconfig
- /usr/bin/logger -p local6.info -t frontend 
+ /usr/bin/logger -t frontend 
 
-- 
cgit v0.12


From 28a76e0968386d28face2850d039aa624becd5cc Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 9 Dec 2013 12:04:12 -0600
Subject: mpd: first checkin

The config file is stock, and will need to be changed for each persons setup

refs #931
---
 abs/extra/mpd/PKGBUILD   | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
 abs/extra/mpd/install    | 11 +++++++++++
 abs/extra/mpd/tmpfiles.d |  1 +
 3 files changed, 63 insertions(+)
 create mode 100644 abs/extra/mpd/PKGBUILD
 create mode 100644 abs/extra/mpd/install
 create mode 100644 abs/extra/mpd/tmpfiles.d

diff --git a/abs/extra/mpd/PKGBUILD b/abs/extra/mpd/PKGBUILD
new file mode 100644
index 0000000..4f36986
--- /dev/null
+++ b/abs/extra/mpd/PKGBUILD
@@ -0,0 +1,51 @@
+# $Id: PKGBUILD 182602 2013-04-10 23:39:58Z bisson $
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+# Contributor: Angel Velasquez <angvp@archlinux.org>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
+# Contributor: Ben <ben@benmazer.net>
+
+pkgname=mpd
+pkgver=0.17.4
+pkgrel=1
+pkgdesc='Flexible, powerful, server-side application for playing music'
+url='http://www.musicpd.org/'
+license=('GPL')
+arch=('i686' 'x86_64')
+depends=('libao' 'ffmpeg' 'libmodplug' 'audiofile' 'libshout' 'libmad' 'curl' 'faad2'
+         'sqlite'  'libmms' 'wavpack' 'avahi' 'libid3tag' 'yajl' 'libsoup')
+makedepends=('doxygen')
+source=("http://www.musicpd.org/download/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"
+        'tmpfiles.d')
+sha1sums=('f60b54e368fe74fde2fd4571227b0428fe0ae3cb'
+          'f4d5922abb69abb739542d8e93f4dfd748acdad7')
+
+backup=('etc/mpd.conf')
+install=install
+
+build() {
+	cd "${srcdir}/${pkgname}-${pkgver}"
+	./configure \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--enable-lastfm \
+		--enable-soundcloud \
+		--disable-sidplay \
+		--with-systemdsystemunitdir=/usr/lib/systemd/system
+	make
+}
+
+package() {
+	cd "${srcdir}/${pkgname}-${pkgver}"
+	make DESTDIR="${pkgdir}" install
+	install -d -g 45 -o 45 "${pkgdir}"/var/lib/mpd/playlists
+	install -Dm644 doc/mpdconf.example "${pkgdir}"/etc/mpd.conf
+	install -Dm644 ../tmpfiles.d "${pkgdir}"/usr/lib/tmpfiles.d/mpd.conf
+	sed \
+		-e '/^#playlist_directory/c playlist_directory "/var/lib/mpd/playlists"' \
+		-e '/^#db_file/c db_file "/var/lib/mpd/mpd.db"' \
+		-e '/^#pid_file/c pid_file "/run/mpd/mpd.pid"' \
+		-e '/^#state_file/c state_file "/var/lib/mpd/mpdstate"' \
+		-e '/^#user/c user "mpd"' \
+		-i "${pkgdir}"/etc/mpd.conf
+}
diff --git a/abs/extra/mpd/install b/abs/extra/mpd/install
new file mode 100644
index 0000000..12742b9
--- /dev/null
+++ b/abs/extra/mpd/install
@@ -0,0 +1,11 @@
+post_install() {
+	getent group mpd &>/dev/null || groupadd -r -g 45 mpd >/dev/null
+	getent passwd mpd &>/dev/null || useradd -r -u 45 -g mpd -d /var/lib/mpd -s /bin/false -G audio mpd >/dev/null
+	usr/bin/systemd-tmpfiles --create mpd.conf || true
+}
+
+post_remove() {
+	getent passwd mpd &>/dev/null && userdel mpd >/dev/null
+	getent group mpd &>/dev/null && groupdel mpd >/dev/null
+	true
+}
diff --git a/abs/extra/mpd/tmpfiles.d b/abs/extra/mpd/tmpfiles.d
new file mode 100644
index 0000000..41c4e74
--- /dev/null
+++ b/abs/extra/mpd/tmpfiles.d
@@ -0,0 +1 @@
+d /run/mpd 0755 mpd mpd
-- 
cgit v0.12


From b7e124567f44d259655c79181f1af9bcd6586341 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 9 Dec 2013 12:04:31 -0600
Subject: libmms:  first checkin  required for mpd refs #931

---
 abs/extra/libmms/PKGBUILD | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 abs/extra/libmms/PKGBUILD

diff --git a/abs/extra/libmms/PKGBUILD b/abs/extra/libmms/PKGBUILD
new file mode 100644
index 0000000..fd9ab3e
--- /dev/null
+++ b/abs/extra/libmms/PKGBUILD
@@ -0,0 +1,25 @@
+#$Id: PKGBUILD 134220 2011-08-02 15:22:22Z jgc $
+#Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=libmms
+pkgver=0.6.2
+pkgrel=1
+pkgdesc="MMS stream protocol library"
+arch=(i686 x86_64)
+url="http://sourceforge.net/projects/libmms/"
+license=(LGPL)
+depends=('glib2')
+options=('!libtool')
+source=(http://download.sourceforge.net/libmms/${pkgname}-${pkgver}.tar.gz)
+md5sums=('9f63aa363deb4874e072a45850161bff')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  ./configure --prefix=/usr --disable-static
+  make
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make DESTDIR="${pkgdir}" install
+}
-- 
cgit v0.12


From efb028d99b56e06e48dfc3d762e9d699ee1f24b7 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 9 Dec 2013 14:26:43 -0600
Subject: LinHES-system: add msg that connection to mythbackend was made.
 Adjust the timing of the be check just a bit

---
 abs/core/LinHES-system/LinHES-session | 8 +++++++-
 abs/core/LinHES-system/PKGBUILD       | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/abs/core/LinHES-system/LinHES-session b/abs/core/LinHES-system/LinHES-session
index d7b70ea..c6d0b09 100755
--- a/abs/core/LinHES-system/LinHES-session
+++ b/abs/core/LinHES-system/LinHES-session
@@ -299,10 +299,16 @@ function start_myth() {
         while [ $rc -ne 0 ]
         do
             msg "Waiting for connection to MythBackend"
+            sleep 6
             /usr/LH/bin/be_check.py
             rc=$?
-            sleep 6
+            if [ $rc -eq 0 ]
+            then
+                msg "Successful Connection to MythBackend"
+            fi
         done
+        sleep 3 #give time for MBE to be fully operational
+        
     fi
 
     #continue on with starting mythtv
diff --git a/abs/core/LinHES-system/PKGBUILD b/abs/core/LinHES-system/PKGBUILD
index 406cc05..d400e6d 100755
--- a/abs/core/LinHES-system/PKGBUILD
+++ b/abs/core/LinHES-system/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=LinHES-system
 pkgver=8.1
-pkgrel=6
+pkgrel=7
 arch=('i686' 'x86_64')
 install=system.install
 pkgdesc="Everything that makes LinHES an automated system"
@@ -75,7 +75,7 @@ package() {
 
 }
 
-md5sums=('49e9847cedcf26a977d64fd44e460b11'
+md5sums=('7f5624a2d965a4cd3ed6a37ebee13fd9'
          'de32a1c50101265dd7f6ca5037f7a26a'
          'a875ee97f86e46f34a741c2bc455f894'
          '76b2637cac0452b3acdbeeb4e8a5474b'
-- 
cgit v0.12

