summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorM0Rf302015-06-17 16:33:25 +0200
committerM0Rf302015-06-17 16:33:25 +0200
commitb573eb7c020f49a2466d61a11b53725005a40756 (patch)
treedd1e57480a481273a8f80e1e39e0c8c20781e407
downloadaur-b573eb7c020f49a2466d61a11b53725005a40756.tar.gz
Initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD50
-rwxr-xr-xsupersonic.rc57
-rw-r--r--supersonic.service11
4 files changed, 139 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f7bb987e81cf
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = supersonic-git
+ pkgdesc = Open-source web-based media streamer and jukebox fork of Subsonic
+ pkgver = 429.330ab98
+ pkgrel = 1
+ url = https://github.com/Mach5/supersonic.git
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = maven
+ makedepends = git
+ depends = java-runtime
+ backup = var/supersonic/db
+ source = git+https://github.com/Mach5/supersonic.git
+ source = supersonic.rc
+ source = supersonic.service
+ md5sums = SKIP
+ md5sums = 51516851d4ea41f639f52c8152a650c3
+ md5sums = 37668217ee341b57a043a8a632727f4d
+
+pkgname = supersonic-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..0eb5bb28299d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+#Mantainer: M0Rf30
+pkgname=supersonic-git
+pkgver=429.330ab98
+pkgrel=1
+pkgdesc="Open-source web-based media streamer and jukebox fork of Subsonic"
+url="https://github.com/Mach5/supersonic.git"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('java-runtime')
+makedepends=('maven' 'git')
+source=('git+https://github.com/Mach5/supersonic.git'
+ 'supersonic.rc'
+ 'supersonic.service')
+backup=('var/supersonic/db')
+
+build() {
+ cd supersonic
+ mvn -P full -Dmaven.test.skip=true -pl subsonic-main -am install
+ mvn -P full -Dmaven.test.skip=true -pl subsonic-booter -am install
+}
+
+package() {
+ cd supersonic
+ mkdir -p $pkgdir/var/supersonic
+ mkdir -p $pkgdir/etc/rc.d
+ mkdir -p $pkgdir/usr/lib/systemd/system
+ cp subsonic-booter/src/main/script/supersonic.sh $pkgdir/var/supersonic/
+ chmod +x $pkgdir/var/supersonic/supersonic.sh
+ cp subsonic-booter/target/supersonic-booter-jar-with-dependencies.jar $pkgdir/var/supersonic/
+ cp subsonic-main/{Getting\ Started.html,README.TXT,LICENSE.TXT} $pkgdir/var/supersonic
+ cp subsonic-main/target/supersonic.war $pkgdir/var/supersonic
+ cp $srcdir/supersonic.rc $pkgdir/etc/rc.d/supersonic
+ chmod +x $pkgdir/etc/rc.d/supersonic
+ cp $srcdir/supersonic.service $pkgdir/usr/lib/systemd/system
+# Change port to avoid conflicts with subsonic
+ sed 's/SUPERSONIC_PORT=4040/SUPERSONIC_PORT=4141/g' -i $pkgdir/var/supersonic/supersonic.sh
+
+# Compatibility with both java runtime available in repos and AUR
+ javahome="JAVA_HOME=/opt/java/jre:/usr/lib/jvm/java-7-openjdk"
+ sed -i "20 i $javahome" $pkgdir/var/supersonic/supersonic.sh
+}
+
+pkgver() {
+ cd supersonic
+ echo $(git rev-list --count master).$(git rev-parse --short master)
+}
+
+md5sums=('SKIP'
+ '51516851d4ea41f639f52c8152a650c3'
+ '37668217ee341b57a043a8a632727f4d')
diff --git a/supersonic.rc b/supersonic.rc
new file mode 100755
index 000000000000..3566ff091df8
--- /dev/null
+++ b/supersonic.rc
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/jre/bin
+DESC="supersonic server"
+NAME=supersonic
+PIDFILE=/var/run/$NAME.pid
+DAEMON=/var/supersonic/supersonic.sh
+DAEMON_ARGS="--pidfile=$PIDFILE"
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(ps ax |grep java |grep subsonic |awk '{ print $1 }')
+case "$1" in
+ start)
+ if [ ! -z "$PID" ]; then
+ stat_fail
+ else
+ stat_busy "Starting $NAME..."
+ $DAEMON $DAEMON_ARGS start&>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon $NAME
+ sleep 2
+ stat_done
+ fi
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping $NAME..."
+ if [ -a $PIDFILE ]; then
+ PID=`cat $PIDFILE`
+ kill $PID > /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm $PIDFILE
+ rm_daemon $NAME
+ stat_done
+ fi
+ else
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ fi
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+esac
+exit 0
diff --git a/supersonic.service b/supersonic.service
new file mode 100644
index 000000000000..1b54f0061bc5
--- /dev/null
+++ b/supersonic.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Supersonic
+After=network.target
+
+[Service]
+ExecStart=/var/supersonic/supersonic.sh
+ExecStop=/bin/kill -15 $MAINPID
+Type=forking
+
+[Install]
+WantedBy=multi-user.target