summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTilman Vatteroth2017-12-11 18:16:30 +0100
committerTilman Vatteroth2017-12-11 18:18:42 +0100
commit9a9fa05abdc1d126437db8d514d690621e5ed1b3 (patch)
treeceb97bfdb25e645cefc1a8ce2db39faa5080eac8
parent53a2e800060b8d0788171cd301a20a10f47fcf5d (diff)
downloadaur-9a9fa05abdc1d126437db8d514d690621e5ed1b3.tar.gz
update to version 0.9.27-2
+ created dedicated user + changed working dir + added service run flags file under /etc/conf.d/bubbleupnpserver
-rw-r--r--PKGBUILD38
-rw-r--r--bubbleupnpserver.install33
-rw-r--r--bubbleupnpserver.service11
-rw-r--r--service_config2
-rw-r--r--sysuser.conf4
5 files changed, 58 insertions, 30 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2937fabbe1c1..9e74ad689c71 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: Nick Bair <njbair at gmail dot com>
pkgname=bubbleupnpserver
pkgver=0.9.27
-pkgrel=1
+pkgrel=2
pkgdesc="Stream content to Android devices over the Internet – requires UPNP/DNLA backend e.g. Mediatomb"
arch=('any')
url="http://www.bubblesoftapps.com/bubbleupnpserver/"
@@ -10,27 +10,23 @@ license=('custom:bubbleupnpserver')
depends=('java-runtime>=7' 'ffmpeg')
makedepends=('unzip')
install=${pkgname}.install
-source=("http://www.bubblesoftapps.com/bubbleupnpserver/BubbleUPnPServer-distrib.zip")
-sha256sums=('5053f208f9c61090f512a61069de8255f973a3d2abb55293f75fe9d831fe1b60')
-
+source=(
+"http://www.bubblesoftapps.com/bubbleupnpserver/BubbleUPnPServer-distrib.zip"
+"bubbleupnpserver.service"
+"service_config"
+"sysuser.conf"
+"http://bubblesoftapps.com/bubbleupnpserver/core/BubbleUPnPServer.jar"
+)
+sha256sums=('5053f208f9c61090f512a61069de8255f973a3d2abb55293f75fe9d831fe1b60'
+ '0fd4c1cf2d24745b7ee9165679b8af3c3e16ac8378a0c351a29ce9681ba76d38'
+ '61bf63a84b839b85c0fdf0210310c94242bbb6e1aa69bf0d6c46efa013b52ae5'
+ 'fd764bb4c785ab0e2481d26f4f30656ba756949afa8ed949234e722ded87bf04'
+ 'c88f081189a406f30c68132f1f89af9d543be57908b7e1c0164e7ed011364a4a')
+backup=("etc/conf.d/bubbleupnpserver" "var/lib/bubbleupnp/configuration.xml")
build() {
cd ${srcdir}
-
unzip -qfo "${srcdir}/BubbleUPnPServer-distrib.zip" -d ${srcdir}
- msg2 "Creating a shell-accessible script"
- echo "#! /bin/bash
-sudo /usr/share/${pkgname}/launch.sh
-" > ${srcdir}/${pkgname}.sh
-
- msg2 "Installing systemd service unit file..."
- echo "[Unit]
-Description=BubbleUPnP Server
-[Service]
-ExecStart=/usr/share/${pkgname}/launch.sh
-SuccessExitStatus=1 2 SIGKILL
-[Install]
-WantedBy=network.target" > ${srcdir}/${pkgname}.service
}
package() {
@@ -38,6 +34,8 @@ package() {
install -D -m644 ${srcdir}/bcprov-jdk16-146.jar ${pkgdir}/usr/share/${pkgname}/bcprov-jdk16-146.jar
install -D -m644 ${srcdir}/BubbleUPnPServerLauncher.jar ${pkgdir}/usr/share/${pkgname}/BubbleUPnPServerLauncher.jar
install -D -m755 ${srcdir}/launch.sh ${pkgdir}/usr/share/${pkgname}/launch.sh
- install -D -m644 ${srcdir}/${pkgname}.service ${pkgdir}/usr/lib/systemd/system/${pkgname}.service
- install -D -m755 ${srcdir}/${pkgname}.sh ${pkgdir}/usr/bin/${pkgname}.sh
+ install -D -m644 ${srcdir}/bubbleupnpserver.service ${pkgdir}/usr/lib/systemd/system/${pkgname}.service
+ install -D -m644 ${srcdir}/service_config ${pkgdir}/etc/conf.d/bubbleupnpserver
+ install -D -m644 ${srcdir}/sysuser.conf ${pkgdir}/usr/lib/sysusers.d/bubbleupnpserver.conf
+ install -D -m644 ${srcdir}/BubbleUPnPServer.jar ${pkgdir}/usr/share/${pkgname}/BubbleUPnPServer.jar
}
diff --git a/bubbleupnpserver.install b/bubbleupnpserver.install
index 53afedc7a026..e03c65da3106 100644
--- a/bubbleupnpserver.install
+++ b/bubbleupnpserver.install
@@ -1,16 +1,16 @@
-post_install() {
- echo "
-========================================================================
+ownership() {
+ systemd-sysusers bubbleupnpserver.conf
-Before starting BubbleUPnP Server, have a look at the default config
-file located at /etc/default/bubbleupnpserver and make sure the defaults
-are OK.
+ [ -e var/lib/bubbleupnp ] || mkdir var/lib/bubbleupnp
+ chown bubbleupnp:bubbleupnp var/lib/bubbleupnp
+
+}
-To start BubbleUPnP, you must first enable the service unit file:
- # systemctl enable bubbleupnpserver
+post_install() {
+
-Then start the service:
- # systemctl start bubbleupnpserver
+ echo "
+========================================================================
To complete the configuration once the service has been started, point
your web browser to:
@@ -23,12 +23,24 @@ Full documentation is available at:
========================================================================
"
+ownership
}
post_upgrade() {
+
echo "
+
========================================================================
+If you're upgrading from 0.9.27-1 or prior you may want to look at these
+important changes:
+
+- The server is no longer running as root
+- The working directory is now /var/lib/bubbleupnp
+ - You must move your config to this directory
+
+=========================================================================
+
If BubbleUPnP is already running, you need to restart it to finish the
upgrade.
@@ -40,4 +52,5 @@ Full documentation is available at:
========================================================================
"
+ownership
}
diff --git a/bubbleupnpserver.service b/bubbleupnpserver.service
new file mode 100644
index 000000000000..4a8d71164907
--- /dev/null
+++ b/bubbleupnpserver.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=BubbleUPnP Server
+[Service]
+User=bubbleupnp
+Group=bubbleupnp
+WorkingDirectory=/var/lib/bubbleupnp
+EnvironmentFile=-/etc/conf.d/bubbleupnpserver
+ExecStart=/usr/share/bubbleupnpserver/launch.sh -dataDir /var/lib/bubbleupnp ${RUN_ARGS}
+SuccessExitStatus=1 2 SIGKILL
+[Install]
+WantedBy=network.target
diff --git a/service_config b/service_config
new file mode 100644
index 000000000000..2acc6e8f1bc5
--- /dev/null
+++ b/service_config
@@ -0,0 +1,2 @@
+# Use this file to pass arguments to the bubbleupnp executable
+RUN_ARGS="-nologfile -disableAutoUpdate"
diff --git a/sysuser.conf b/sysuser.conf
new file mode 100644
index 000000000000..847280818e16
--- /dev/null
+++ b/sysuser.conf
@@ -0,0 +1,4 @@
+g bubbleupnp - - -
+u bubbleupnp - "BubbleUPNP Server" /var/lib/bubbleupnp
+m bubbleupnp bubbleupnp
+