summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuperpiffer2017-11-05 18:54:24 +0100
committerSuperpiffer2017-11-05 18:54:24 +0100
commit02c40824fe33590fa7f53a41e702700f8cb70457 (patch)
tree23b07ccd4f6c550a3f263730164e96feb29020cd
parent94687b9f99a33c3cc47148c9ba4faa9766372a35 (diff)
downloadaur-02c40824fe33590fa7f53a41e702700f8cb70457.tar.gz
Update to v10.1.0 and systemd service rewrite
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD19
-rw-r--r--airsonic-systemd-env31
-rw-r--r--airsonic.install6
-rw-r--r--airsonic.service27
-rw-r--r--airsonic.sh127
6 files changed, 70 insertions, 154 deletions
diff --git a/.SRCINFO b/.SRCINFO
index db81b0942f53..66a0f4675d3c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = airsonic
pkgdesc = A free, web-based media streamer and jukebox.
- pkgver = 10.0.1
+ pkgver = 10.1.0
pkgrel = 1
url = https://github.com/Airsonic/airsonic/
install = airsonic.install
@@ -13,13 +13,13 @@ pkgbase = airsonic
conflicts = subsonic-beta
conflicts = libresonic
noextract = airsonic.war
- backup = var/lib/airsonic/airsonic.sh
- source = https://github.com/airsonic/airsonic/releases/download/v10.0.1/airsonic.war
- source = airsonic.sh
+ backup = etc/sysconfig/airsonic
+ source = https://github.com/airsonic/airsonic/releases/download/v10.1.0/airsonic.war
+ source = airsonic-systemd-env
source = airsonic.service
- sha256sums = 8c2eaf42437a946f240359e0fbc69e1f82785eb173470082710088447e437ee2
- sha256sums = c80475ea59cfb02fd667fafcfc5367513a5d31d98878e2317ef98d47689b7e25
- sha256sums = 5ba2274f536fb7d16f6c0266500419a0c3834f6acdeeca81ba9b83264e839a1a
+ sha256sums = bf5f396f0aba49c022e4c3694c94b1a1edc16c4e1a9137062b0f2899368ff04e
+ sha256sums = 0d4115c892b8e78f6443f5550d3c0a018650268fd05eba56fd9aa48b39cdd094
+ sha256sums = 4af3a549a40a7f1a65688d6f8d60c4b7667ef4f603550842fa7bc51fbdbf27a3
pkgname = airsonic
diff --git a/PKGBUILD b/PKGBUILD
index 69578ac6a13e..ae709a4c2b04 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Federico Giuliani <federico.giuliani86 at gmail dot com>
pkgname=airsonic
-pkgver=10.0.1
+pkgver=10.1.0
pkgrel=1
pkgdesc="A free, web-based media streamer and jukebox."
arch=('any')
@@ -9,11 +9,11 @@ url="https://github.com/Airsonic/airsonic/"
license=('GPL3')
depends=('java-runtime-headless')
conflicts=('subsonic' 'subsonic-kang' 'subsonic-kang-git' 'subsonic-beta' 'libresonic')
-backup=('var/lib/airsonic/airsonic.sh')
+backup=('etc/sysconfig/airsonic')
noextract=(airsonic.war)
install=$pkgname.install
source=(https://github.com/airsonic/airsonic/releases/download/v${pkgver}/airsonic.war
- 'airsonic.sh'
+ 'airsonic-systemd-env'
'airsonic.service')
package() {
@@ -21,13 +21,12 @@ package() {
mkdir -p $pkgdir/var/lib/airsonic
mkdir -p $pkgdir/var/lib/airsonic/playlists
mkdir -p $pkgdir/usr/lib/systemd/system
- mkdir -p $pkgdir/etc/
- cp * $pkgdir/var/lib/airsonic
- ln -fs /var/lib/airsonic/airsonic.sh $pkgdir/etc/airsonic.conf
+ mkdir -p $pkgdir/etc/sysconfig
+ cp airsonic.war $pkgdir/var/lib/airsonic
cp $srcdir/airsonic.service $pkgdir/usr/lib/systemd/system
- chmod +x $pkgdir/var/lib/airsonic/airsonic.sh
+ cp airsonic-systemd-env $pkgdir/etc/sysconfig/airsonic
}
-sha256sums=('8c2eaf42437a946f240359e0fbc69e1f82785eb173470082710088447e437ee2'
- 'c80475ea59cfb02fd667fafcfc5367513a5d31d98878e2317ef98d47689b7e25'
- '5ba2274f536fb7d16f6c0266500419a0c3834f6acdeeca81ba9b83264e839a1a')
+sha256sums=('bf5f396f0aba49c022e4c3694c94b1a1edc16c4e1a9137062b0f2899368ff04e'
+ '0d4115c892b8e78f6443f5550d3c0a018650268fd05eba56fd9aa48b39cdd094'
+ '4af3a549a40a7f1a65688d6f8d60c4b7667ef4f603550842fa7bc51fbdbf27a3')
diff --git a/airsonic-systemd-env b/airsonic-systemd-env
new file mode 100644
index 000000000000..3f1fe249e91d
--- /dev/null
+++ b/airsonic-systemd-env
@@ -0,0 +1,31 @@
+# Set the location of the standalone war to use
+JAVA_JAR=/var/lib/airsonic/airsonic.war
+
+# Set any java opts separated by spaces
+#JAVA_OPTS=-Xmx700m
+
+# Set a different location for airsonic home.
+# If this path is /var/libresonic or even contains "libresonic",
+# the data from a previous libresonic can be used as is (i.e. without
+# renaming libresonic.properties,db/libresonic*,etc
+AIRSONIC_HOME=/var/lib/airsonic
+
+# Change the port to listen on
+PORT=4040
+
+# Change the path that is listened on
+CONTEXT_PATH=/
+
+# Add any java args. These are different than JAVA_OPTS in that
+# they are passed directly to the program. The default is empty:
+#JAVA_ARGS=
+
+# Note that there are several settings for spring boot, not explicitly listed
+# here, but can be used in either JAVA_OPTS or JAVA_ARGS. The full list
+# can be found here:
+# https://docs.spring.io/spring-boot/docs/1.4.5.RELEASE/reference/htmlsingle/#common-application-properties
+# For example to set debug across the board:
+#JAVA_ARGS=--debug
+
+# Or to change the ip address that is listened on:
+#JAVA_ARGS=--server.address=127.0.0.1
diff --git a/airsonic.install b/airsonic.install
index 480c1df21cac..ff0eb3e9849f 100644
--- a/airsonic.install
+++ b/airsonic.install
@@ -14,9 +14,9 @@ post_install() {
passwd --lock airsonic &> /dev/null
fix_permissions
- echo "*************************************************"
- echo "* Edit /etc/airsonic.conf to configure airsonic *"
- echo "*************************************************"
+ echo "******************************************************"
+ echo "* Edit /etc/sysconfig/airsonic to configure airsonic *"
+ echo "******************************************************"
systemctl daemon-reload
}
diff --git a/airsonic.service b/airsonic.service
index e54fb1b96956..3cf141f6aeca 100644
--- a/airsonic.service
+++ b/airsonic.service
@@ -1,12 +1,25 @@
[Unit]
-Description=Airsonic
-After=network.target
-
+Description=Airsonic Media Server
+After=remote-fs.target network.target
+AssertPathExists=/var/lib/airsonic
+
[Service]
+Type=simple
+Environment="JAVA_JAR=/var/lib/airsonic/airsonic.war"
+Environment="JAVA_OPTS=-Xmx700m"
+Environment="AIRSONIC_HOME=/var/lib/airsonic"
+Environment="PORT=4040"
+Environment="CONTEXT_PATH=/airsonic"
+Environment="JAVA_ARGS="
+EnvironmentFile=-/etc/sysconfig/airsonic
+ExecStart=/usr/bin/java \
+ $JAVA_OPTS \
+ -Dairsonic.home=${AIRSONIC_HOME} \
+ -Dserver.context-path=${CONTEXT_PATH} \
+ -Dserver.port=${PORT} \
+ -jar ${JAVA_JAR} $JAVA_ARGS
User=airsonic
-ExecStart=/var/lib/airsonic/airsonic.sh
-ExecStop=/bin/kill -15 $MAINPID
-Type=forking
-
+Group=airsonic
+
[Install]
WantedBy=multi-user.target
diff --git a/airsonic.sh b/airsonic.sh
deleted file mode 100644
index e971cc8d184d..000000000000
--- a/airsonic.sh
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/sh
-
-AIRSONIC_HOME=/var/lib/airsonic
-AIRSONIC_HOST=0.0.0.0
-AIRSONIC_PORT=8080
-AIRSONIC_HTTPS_PORT=0
-AIRSONIC_CONTEXT_PATH=/
-AIRSONIC_MAX_MEMORY=256
-AIRSONIC_PIDFILE=airsonic.pid
-AIRSONIC_DEFAULT_MUSIC_FOLDER=/var/lib/airsonic/music
-AIRSONIC_DEFAULT_PODCAST_FOLDER=/var/lib/airsonic/podcast
-AIRSONIC_DEFAULT_PLAYLIST_FOLDER=/var/lib/airsonic/playlists
-
-quiet=0
-
-usage() {
- echo "Usage: airsonic.sh [options]"
- echo " --help This small usage guide."
- echo " --home=DIR The directory where Airsonic will create files."
- echo " Make sure it is writable. Default: /var/lib/airsonic"
- echo " --host=HOST The host name or IP address on which to bind Airsonic."
- echo " Only relevant if you have multiple network interfaces and want"
- echo " to make Airsonic available on only one of them. The default value"
- echo " will bind Airsonic to all available network interfaces. Default: 0.0.0.0"
- echo " --port=PORT The port on which Airsonic will listen for"
- echo " incoming HTTP traffic. Default: 8080"
- echo " --https-port=PORT The port on which Airsonic will listen for"
- echo " incoming HTTPS traffic. Default: 0 (disabled)"
- echo " --context-path=PATH The context path, i.e., the last part of the Airsonic"
- echo " URL. Typically '/' or '/airsonic'. Default '/'"
- echo " --max-memory=MB The memory limit (max Java heap size) in megabytes."
- echo " Default: 100"
- echo " --pidfile=PIDFILE Write PID to this file. Default not created."
- echo " --quiet Don't print anything to standard out. Default false."
- echo " --default-music-folder=DIR Configure Airsonic to use this folder for music. This option "
- echo " only has effect the first time Airsonic is started. Default '/var/lib/airsonic/music'"
- echo " --default-podcast-folder=DIR Configure Airsonic to use this folder for Podcasts. This option "
- echo " only has effect the first time Airsonic is started. Default '/var/lib/airsonic/podcast'"
- echo " --default-playlist-folder=DIR Configure Airsonic to use this folder for playlists. This option "
- echo " only has effect the first time Airsonic is started. Default '/var/lib/airsonic/playlists'"
- exit 1
-}
-
-# Parse arguments.
-while [ $# -ge 1 ]; do
- case $1 in
- --help)
- usage
- ;;
- --home=?*)
- AIRSONIC_HOME=${1#--home=}
- ;;
- --host=?*)
- AIRSONIC_HOST=${1#--host=}
- ;;
- --port=?*)
- AIRSONIC_PORT=${1#--port=}
- ;;
- --https-port=?*)
- AIRSONIC_HTTPS_PORT=${1#--https-port=}
- ;;
- --context-path=?*)
- AIRSONIC_CONTEXT_PATH=${1#--context-path=}
- ;;
- --max-memory=?*)
- AIRSONIC_MAX_MEMORY=${1#--max-memory=}
- ;;
- --pidfile=?*)
- AIRSONIC_PIDFILE=${1#--pidfile=}
- ;;
- --quiet)
- quiet=1
- ;;
- --default-music-folder=?*)
- AIRSONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=}
- ;;
- --default-podcast-folder=?*)
- AIRSONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=}
- ;;
- --default-playlist-folder=?*)
- AIRSONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=}
- ;;
- *)
- usage
- ;;
- esac
- shift
-done
-
-# Use JAVA_HOME if set, otherwise assume java is in the path.
-JAVA=java
-if [ -e "${JAVA_HOME}" ]
- then
- JAVA=${JAVA_HOME}/bin/java
-fi
-
-# Create Airsonic home directory.
-mkdir -p ${AIRSONIC_HOME}
-LOG=${AIRSONIC_HOME}/airsonic_sh.log
-rm -f ${LOG}
-
-cd $(dirname $0)
-if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
- cd $(dirname $(readlink $0))
-fi
-
-${JAVA} -Xmx${AIRSONIC_MAX_MEMORY}m \
- -Dserver.address=${AIRSONIC_HOST} \
- -Dserver.port=${AIRSONIC_PORT} \
- -Dserver.httpsPort=${AIRSONIC_HTTPS_PORT} \
- -Dserver.contextPath=${AIRSONIC_CONTEXT_PATH} \
- -Dairsonic.home=${AIRSONIC_HOME} \
- -Dairsonic.defaultMusicFolder=${AIRSONIC_DEFAULT_MUSIC_FOLDER} \
- -Dairsonic.defaultPodcastFolder=${AIRSONIC_DEFAULT_PODCAST_FOLDER} \
- -Dairsonic.defaultPlaylistFolder=${AIRSONIC_DEFAULT_PLAYLIST_FOLDER} \
- -Djava.awt.headless=true \
- -jar airsonic.war > ${LOG} 2>&1 &
-
-# Write pid to pidfile if it is defined.
-if [ $AIRSONIC_PIDFILE ]; then
- echo $! > ${AIRSONIC_PIDFILE}
-fi
-
-if [ $quiet = 0 ]; then
- echo Started Airsonic [PID $!, ${LOG}]
-fi
-