summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO10
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD31
-rw-r--r--subsonic-beta.install66
-rw-r--r--subsonic.service3
5 files changed, 91 insertions, 24 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 542a4c77a3c..97b46864a9a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = subsonic-beta
pkgdesc = A free, web-based media streamer and jukebox.
- pkgver = 5.0.beta1
+ pkgver = 5.1.beta1
pkgrel = 1
url = http://subsonic.org/
install = subsonic-beta.install
@@ -10,11 +10,11 @@ pkgbase = subsonic-beta
depends = jre7-openjdk-headless
depends = libcups
conflicts = subsonic
- backup = var/subsonic/db
- source = http://prdownloads.sourceforge.net/subsonic/subsonic-5.0.beta1-standalone.tar.gz
+ backup = var/lib/subsonic/db
+ source = http://prdownloads.sourceforge.net/subsonic/subsonic-5.1.beta1-standalone.tar.gz
source = subsonic.service
- md5sums = 04addd4f090b75d09e3831e77982be2e
- md5sums = 0d321009898118fa9390631fd21c5e63
+ sha512sums = 935317342bb608ebb29d3ab2050ec867340d68a5c1fc831d8099ed70bebfb260823b556719fef1c90e7f638c795fb6c6021ec4190506bb7134e48d84bb9f79d4
+ sha512sums = 9026ea4e216f359146cf325083ddbf051d1d141bf6342ec750723ab891e5a212f55411ce8d0dd9697b8636541618220498fc8aa9b4c680a8d2c34ab7ee4db02e
pkgname = subsonic-beta
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..88761c6b5b6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+pkg/
+src/
+subsonic-*.tar.gz
+subsonic-beta-*.pkg.tar.xz
+subsonic-beta-*.pkg.tar.xz.sig
diff --git a/PKGBUILD b/PKGBUILD
index 732b5c4ef63..16986850d87 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,10 @@
-# Maintainer: M0Rf30 <morf3089@gmail.com>
-# Contributors : hoban
-# Contributors : Nrm
+# Maintainer: Thom Wiggers <thom@thomwiggers.nl>
+# Contributors: M0Rf30 <morf3089@gmail.com>
+# Contributors: hoban
+# Contributors: Nrm
pkgname=subsonic-beta
-pkgver=5.0.beta1
+pkgver=5.1.beta1
pkgrel=1
pkgdesc="A free, web-based media streamer and jukebox."
arch=('i686' 'x86_64')
@@ -12,19 +13,23 @@ license=('GPL')
depends=('jre7-openjdk-headless' 'libcups')
conflicts=('subsonic')
source=(http://prdownloads.sourceforge.net/subsonic/subsonic-${pkgver}-standalone.tar.gz
- 'subsonic.service')
-backup=('var/subsonic/db')
+ 'subsonic.service')
+backup=('var/lib/subsonic/db')
install=$pkgname.install
+
+sha512sums=('935317342bb608ebb29d3ab2050ec867340d68a5c1fc831d8099ed70bebfb260823b556719fef1c90e7f638c795fb6c6021ec4190506bb7134e48d84bb9f79d4'
+ '9026ea4e216f359146cf325083ddbf051d1d141bf6342ec750723ab891e5a212f55411ce8d0dd9697b8636541618220498fc8aa9b4c680a8d2c34ab7ee4db02e')
package() {
cd ${srcdir}
- mkdir -p $pkgdir/var/subsonic
+ mkdir -p $pkgdir/var/lib/subsonic
+ mkdir -p $pkgdir/var/playlists
mkdir -p $pkgdir/usr/lib/systemd/system
- cp * $pkgdir/var/subsonic
- rm $pkgdir/var/subsonic/{subsonic.bat,subsonic-${pkgver}-standalone.tar.gz}
+ mkdir -p $pkgdir/etc/
+ sed -i 's/SUBSONIC_HOME=\/var\/subsonic/SUBSONIC_HOME=\/var\/lib\/subsonic/' subsonic.sh
+ cp * $pkgdir/var/lib/subsonic
+ rm $pkgdir/var/lib/subsonic/{subsonic.bat,subsonic-${pkgver}-standalone.tar.gz}
+ ln -fs /var/lib/subsonic/subsonic.sh $pkgdir/etc/subsonic.conf
cp $srcdir/subsonic.service $pkgdir/usr/lib/systemd/system
- chmod +x $pkgdir/var/subsonic/subsonic.sh
+ chmod +x $pkgdir/var/lib/subsonic/subsonic.sh
}
-
-md5sums=('04addd4f090b75d09e3831e77982be2e'
- '0d321009898118fa9390631fd21c5e63')
diff --git a/subsonic-beta.install b/subsonic-beta.install
index 3427acf64ef..bfa017e2708 100644
--- a/subsonic-beta.install
+++ b/subsonic-beta.install
@@ -1,8 +1,64 @@
+_homedir=/var/lib/subsonic
+_playlistdir=/var/playlists
+
post_install() {
- echo "*************************************************"
- echo "* Edit /var/subsonic/subsonic.sh to configure *"
- echo "* subsonic *"
- echo "*************************************************"
-
+
+ getent group subsonic &>/dev/null || groupadd --system subsonic > /dev/null
+ getent passwd subsonic &>/dev/null || useradd --system \
+ --home-dir /var/lib/subsonic \
+ --shell /usr/bin/nologin \
+ --gid subsonic \
+ --groups audio \
+ --comment "Subsonic user" \
+ subsonic > /dev/null
+ passwd --lock subsonic > /dev/null
+
+ fix_permissions
+ echo "*************************************************"
+ echo "* Edit /etc/subsonic.conf to configure subsonic *"
+ echo "*************************************************"
+
}
+post_remove() {
+ getent passwd subsonic &>/dev/null && userdel subsonic >/dev/null
+ getent group subsonic &>/dev/null && groupdel subsonic >/dev/null
+}
+
+fix_permissions() {
+ chown -R subsonic:subsonic ${_homedir}
+ chown subsonic:subsonic ${_playlistdir}
+}
+
+pre_upgrade() {
+ rm -f /tmp/subsonic-was-active
+ if [[ `systemctl is-active subsonic` == 'active' ]]; then
+ touch /tmp/subsonic-was-active
+ echo "Stopping subsonic"
+ systemctl stop subsonic
+ fi
+}
+
+post_upgrade() {
+ post_install
+
+ if [[ $(vercmp 5.0.beta1 $2) == "1" ]]; then
+ echo "!! Subsonics home dir is now located in /var/lib/subsonic."
+ echo " You will have to move the database located in "
+ echo " /var/subsonic/db to this new location."
+ echo ""
+ echo "!! This package now runs subsonic as the user 'subsonic'."
+ echo " You mightneed to edit permissions for your media folders."
+ rm -f /tmp/subsonic-was-active
+ echo ""
+ echo "!! Not restarting subsonic automatically."
+ echo " You might need to change configs"
+ fi
+
+ systemctl daemon-reload
+ if [ -e /tmp/subsonic-was-active ]; then
+ echo "Starting subsonic"
+ systemctl start subsonic
+ rm /tmp/subsonic-was-active
+ fi
+}
diff --git a/subsonic.service b/subsonic.service
index 5e65f03ac41..78889b6a6ea 100644
--- a/subsonic.service
+++ b/subsonic.service
@@ -3,7 +3,8 @@ Description=Subsonic
After=network.target
[Service]
-ExecStart=/var/subsonic/subsonic.sh
+User=subsonic
+ExecStart=/var/lib/subsonic/subsonic.sh
ExecStop=/bin/kill -15 $MAINPID
Type=forking