diff options
-rw-r--r-- | .SRCINFO | 33 | ||||
-rw-r--r-- | PKGBUILD | 57 | ||||
-rw-r--r-- | libresonic.sh | 134 |
3 files changed, 179 insertions, 45 deletions
@@ -1,26 +1,29 @@ pkgbase = libresonic - pkgdesc = Media streaming software - pkgver = 6.0.1 - pkgrel = 3 - url = https://github.com/Libresonic/libresonic + pkgdesc = A free, web-based media streamer and jukebox. + pkgver = 6.1 + pkgrel = 1 + url = https://github.com/Libresonic/libresonic/ install = libresonic.install arch = any - license = GPL - depends = bash - depends = java-environment + license = GPL3 + depends = java-runtime-headless conflicts = subsonic conflicts = subsonic-kang conflicts = subsonic-kang-git conflicts = subsonic-beta - noextract = libresonic-v${pkgver}.war - backup = opt/libresonic/subsonic.properties - backup = opt/libresonic/subsonic.sh - source = http://prdownloads.sourceforge.net/subsonic/subsonic-6.0-standalone.tar.gz - source = https://github.com/Libresonic/libresonic/releases/download/v6.0.1/libresonic-v6.0.1.war + noextract = libresonic-v6.1.war + noextract = libresonic-booter-jar-with-dependencies.jar + backup = var/lib/libresonic/db + backup = var/lib/libresonic/libresonic.properties + backup = var/lib/libresonic/libresonic.sh + source = https://jenkins.undocumented.software/job/libresonic/232/artifact/libresonic-booter/target/libresonic-booter-jar-with-dependencies.jar + source = https://github.com/Libresonic/libresonic/releases/download/v6.1/libresonic-v6.1.war + source = libresonic.sh source = libresonic.service - sha256sums = df14d05e3b52f07486782e3e16922688968c95b0c8cc4987941bc3b9cea7872b - sha256sums = 52413b38ffb4e035f2d450faadc1cc52d5bd7bc65e9cd9223696a728d3ac9fba - sha256sums = 8d2ceae3cd0e14aeef9efd3281813dd4c0db411b950cbea6c4caf48a793dedce + sha256sums = 042ab6833a8fa351712ff34899d6c0ba0024e420f16f81661a17405df081f246 + sha256sums = 34e4771f730f6de17aa2ba039cfab26772af3ab08e3f0c36d3f0c7a6e315a8e0 + sha256sums = f1f4a22efb411d1f31f834f9f229e81c39d7f4db720281d9b0862c2f1b4d0697 + sha256sums = afcef7b8ce8ceab58569440ed17d5828f39da072ea0d6e3e9fb82ac2feafcf9f pkgname = libresonic @@ -1,40 +1,37 @@ # Maintainer: Federico Giuliani <federico.giuliani86@gmail.com> pkgname=libresonic -pkgver=6.0.1 -_subver=6.0 -pkgrel=3 - -pkgdesc="Media streaming software" -url="https://github.com/Libresonic/libresonic" +pkgver=6.1 +pkgrel=1 +pkgdesc="A free, web-based media streamer and jukebox." arch=('any') -license=('GPL') -depends=('bash' 'java-environment') +url="https://github.com/Libresonic/libresonic/" +license=('GPL3') +depends=('java-runtime-headless') conflicts=('subsonic' 'subsonic-kang' 'subsonic-kang-git' 'subsonic-beta') -backup=('opt/libresonic/subsonic.properties' 'opt/libresonic/subsonic.sh') -noextract=('libresonic-v${pkgver}.war') -install='libresonic.install' -source=("http://prdownloads.sourceforge.net/subsonic/subsonic-${_subver}-standalone.tar.gz" - "https://github.com/Libresonic/libresonic/releases/download/v${pkgver}/libresonic-v${pkgver}.war" +backup=('var/lib/libresonic/db' 'var/lib/libresonic/libresonic.properties' 'var/lib/libresonic/libresonic.sh') +noextract=(libresonic-v${pkgver}.war libresonic-booter-jar-with-dependencies.jar) +install=$pkgname.install +source=(https://jenkins.undocumented.software/job/libresonic/232/artifact/libresonic-booter/target/libresonic-booter-jar-with-dependencies.jar + https://github.com/Libresonic/libresonic/releases/download/v${pkgver}/libresonic-v${pkgver}.war + 'libresonic.sh' 'libresonic.service') package() { - war_name="libresonic-v${pkgver}.war" - install -dm 755 "${pkgdir}"/{opt/libresonic,etc/conf.d,usr/lib/systemd/system,/var/lib/libresonic/playlists} - cp -dr --no-preserve='ownership' * "${pkgdir}"/opt/libresonic/ - cp --no-preserve='ownership' "${war_name}" "${pkgdir}"/opt/libresonic/subsonic.war - find "${pkgdir}"/opt/libresonic/ -type d -exec chmod 755 {} \; - find "${pkgdir}"/opt/libresonic/ -type f -exec chmod 664 {} \; - sed -i 's/SUBSONIC_HOME=\/var\/subsonic/SUBSONIC_HOME=\/opt\/libresonic/' "${pkgdir}"/opt/libresonic/subsonic.sh - sed -i 's/\/var/\/var\/lib\/libresonic/' "${pkgdir}"/opt/libresonic/subsonic.sh - touch "${pkgdir}"/opt/libresonic/subsonic.properties - ln -fs /opt/libresonic/subsonic.sh "${pkgdir}"/etc/conf.d/libresonic.conf - install -m 644 libresonic.service "${pkgdir}"/usr/lib/systemd/system/ - rm -f "${pkgdir}"/opt/libresonic/{subsonic.bat,subsonic-"${_subver}"-standalone.tar.gz,"${war_name}",libresonic.service} + cd ${srcdir} + mkdir -p $pkgdir/var/lib/libresonic + mkdir -p $pkgdir/var/playlists + mkdir -p $pkgdir/usr/lib/systemd/system + mkdir -p $pkgdir/etc/ + sed -i 's/LIBRESONIC_HOME=\/var\/libresonic/LIBRESONIC_HOME=\/var\/lib\/libresonic/' libresonic.sh + mv libresonic-v${pkgver}.war libresonic.war + cp * $pkgdir/var/lib/libresonic + ln -fs /var/lib/libresonic/libresonic.sh $pkgdir/etc/libresonic.conf + cp $srcdir/libresonic.service $pkgdir/usr/lib/systemd/system + chmod +x $pkgdir/var/lib/libresonic/libresonic.sh } -sha256sums=('df14d05e3b52f07486782e3e16922688968c95b0c8cc4987941bc3b9cea7872b' - '52413b38ffb4e035f2d450faadc1cc52d5bd7bc65e9cd9223696a728d3ac9fba' - '8d2ceae3cd0e14aeef9efd3281813dd4c0db411b950cbea6c4caf48a793dedce') - -# vim: ts=2 sw=2 et: +sha256sums=('042ab6833a8fa351712ff34899d6c0ba0024e420f16f81661a17405df081f246' + '34e4771f730f6de17aa2ba039cfab26772af3ab08e3f0c36d3f0c7a6e315a8e0' + 'f1f4a22efb411d1f31f834f9f229e81c39d7f4db720281d9b0862c2f1b4d0697' + 'afcef7b8ce8ceab58569440ed17d5828f39da072ea0d6e3e9fb82ac2feafcf9f') diff --git a/libresonic.sh b/libresonic.sh new file mode 100644 index 000000000000..2d058bebbb11 --- /dev/null +++ b/libresonic.sh @@ -0,0 +1,134 @@ +#!/bin/sh + +################################################################################### +# Shell script for starting Libresonic. See http://libresonic.org. +# +# Author: Sindre Mehus +################################################################################### + +LIBRESONIC_HOME=/var/libresonic +LIBRESONIC_HOST=0.0.0.0 +LIBRESONIC_PORT=4040 +LIBRESONIC_HTTPS_PORT=0 +LIBRESONIC_CONTEXT_PATH=/ +LIBRESONIC_MAX_MEMORY=150 +LIBRESONIC_PIDFILE= +LIBRESONIC_DEFAULT_MUSIC_FOLDER=/var/music +LIBRESONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast +LIBRESONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists + +quiet=0 + +usage() { + echo "Usage: libresonic.sh [options]" + echo " --help This small usage guide." + echo " --home=DIR The directory where Libresonic will create files." + echo " Make sure it is writable. Default: /var/libresonic" + echo " --host=HOST The host name or IP address on which to bind Libresonic." + echo " Only relevant if you have multiple network interfaces and want" + echo " to make Libresonic available on only one of them. The default value" + echo " will bind Libresonic to all available network interfaces. Default: 0.0.0.0" + echo " --port=PORT The port on which Libresonic will listen for" + echo " incoming HTTP traffic. Default: 4040" + echo " --https-port=PORT The port on which Libresonic will listen for" + echo " incoming HTTPS traffic. Default: 0 (disabled)" + echo " --context-path=PATH The context path, i.e., the last part of the Libresonic" + echo " URL. Typically '/' or '/libresonic'. 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 Libresonic to use this folder for music. This option " + echo " only has effect the first time Libresonic is started. Default '/var/music'" + echo " --default-podcast-folder=DIR Configure Libresonic to use this folder for Podcasts. This option " + echo " only has effect the first time Libresonic is started. Default '/var/music/Podcast'" + echo " --default-playlist-folder=DIR Configure Libresonic to use this folder for playlists. This option " + echo " only has effect the first time Libresonic is started. Default '/var/playlists'" + exit 1 +} + +# Parse arguments. +while [ $# -ge 1 ]; do + case $1 in + --help) + usage + ;; + --home=?*) + LIBRESONIC_HOME=${1#--home=} + ;; + --host=?*) + LIBRESONIC_HOST=${1#--host=} + ;; + --port=?*) + LIBRESONIC_PORT=${1#--port=} + ;; + --https-port=?*) + LIBRESONIC_HTTPS_PORT=${1#--https-port=} + ;; + --context-path=?*) + LIBRESONIC_CONTEXT_PATH=${1#--context-path=} + ;; + --max-memory=?*) + LIBRESONIC_MAX_MEMORY=${1#--max-memory=} + ;; + --pidfile=?*) + LIBRESONIC_PIDFILE=${1#--pidfile=} + ;; + --quiet) + quiet=1 + ;; + --default-music-folder=?*) + LIBRESONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=} + ;; + --default-podcast-folder=?*) + LIBRESONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=} + ;; + --default-playlist-folder=?*) + LIBRESONIC_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 Libresonic home directory. +mkdir -p ${LIBRESONIC_HOME} +LOG=${LIBRESONIC_HOME}/libresonic_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${LIBRESONIC_MAX_MEMORY}m \ + -Dlibresonic.home=${LIBRESONIC_HOME} \ + -Dlibresonic.host=${LIBRESONIC_HOST} \ + -Dlibresonic.port=${LIBRESONIC_PORT} \ + -Dlibresonic.httpsPort=${LIBRESONIC_HTTPS_PORT} \ + -Dlibresonic.contextPath=${LIBRESONIC_CONTEXT_PATH} \ + -Dlibresonic.defaultMusicFolder=${LIBRESONIC_DEFAULT_MUSIC_FOLDER} \ + -Dlibresonic.defaultPodcastFolder=${LIBRESONIC_DEFAULT_PODCAST_FOLDER} \ + -Dlibresonic.defaultPlaylistFolder=${LIBRESONIC_DEFAULT_PLAYLIST_FOLDER} \ + -Djava.awt.headless=true \ + -verbose:gc \ + -jar libresonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 & + +# Write pid to pidfile if it is defined. +if [ $LIBRESONIC_PIDFILE ]; then + echo $! > ${LIBRESONIC_PIDFILE} +fi + +if [ $quiet = 0 ]; then + echo Started Libresonic [PID $!, ${LOG}] +fi + |