From 9e9954318436d0e6c885912b36ca2f4b61b490c5 Mon Sep 17 00:00:00 2001 From: jlh Date: Sun, 22 Mar 2015 18:04:48 +0000 Subject: Create a port for Subsonic standalone version (does not require Tomcat to run). Reviewed by: bapt, antoine (earlier version) Approved by: bapt --- www/Makefile | 1 + www/subsonic-standalone/Makefile | 93 +++++++++++++++++++++ www/subsonic-standalone/distinfo | 2 + .../files/message-transcoding.in | 38 +++++++++ www/subsonic-standalone/files/pkg-message.in | 7 ++ www/subsonic-standalone/files/subsonic.in | 94 ++++++++++++++++++++++ www/subsonic-standalone/pkg-descr | 7 ++ www/subsonic-standalone/pkg-message-spacer | 3 + www/subsonic-standalone/pkg-plist | 8 ++ 9 files changed, 253 insertions(+) create mode 100644 www/subsonic-standalone/Makefile create mode 100644 www/subsonic-standalone/distinfo create mode 100644 www/subsonic-standalone/files/message-transcoding.in create mode 100644 www/subsonic-standalone/files/pkg-message.in create mode 100644 www/subsonic-standalone/files/subsonic.in create mode 100644 www/subsonic-standalone/pkg-descr create mode 100644 www/subsonic-standalone/pkg-message-spacer create mode 100644 www/subsonic-standalone/pkg-plist (limited to 'www') diff --git a/www/Makefile b/www/Makefile index f7800205078f..a57bf99fa218 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1988,6 +1988,7 @@ SUBDIR += squidview SUBDIR += srg SUBDIR += subsonic + SUBDIR += subsonic-standalone SUBDIR += suphp SUBDIR += surf SUBDIR += surfraw diff --git a/www/subsonic-standalone/Makefile b/www/subsonic-standalone/Makefile new file mode 100644 index 000000000000..cfba42f3a191 --- /dev/null +++ b/www/subsonic-standalone/Makefile @@ -0,0 +1,93 @@ +# Created by: Jeremie Le Hen +# Based on www/subsonic from Nicole Reid +# $FreeBSD$ + +PORTNAME= subsonic-standalone +PORTVERSION= 5.2 +CATEGORIES= www java +MASTER_SITES= SF/subsonic/subsonic/${PORTVERSION} +DISTNAME= subsonic-${PORTVERSION}-standalone + +MAINTAINER= jlh@FreeBSD.org +COMMENT= Subsonic streaming media server, standalone version + +LICENSE= GPLv3 + +OPTIONS_GROUP= TRANSCODING +TRANSCODING_DESC= Transcoding support +OPTIONS_GROUP_TRANSCODING= FFMPEG FLAC LAME VORBIS FAAC FAAD XMP MPC APE +FFMPEG_DESC= Depend on FFmpeg for audio and video transcoding +FLAC_DESC= Depend on FLAC for transcoding +LAME_DESC= Depend on LAME for MP3 transcoding +VORBIS_DESC= Depend on oggenc/oggdec for Vorbis transcoding +FAAC_DESC= Depend on FAAD for AAC/M4A transcoding +FAAD_DESC= Depend on FAAC for AAC/M4A transcoding +XMP_DESC= Depend on XMP for module file transcoding +MPC_DESC= Depend on mpcdec for MPC transcoding +APE_DESC= Depend on mac for Monkey's Audio transcoding #' + +OPTIONS_DEFAULT= FFMPEG +OPTIONS_SUB= yes + +FFMPEG_RUN_DEPENDS= ffmpeg:${PORTSDIR}/multimedia/ffmpeg +FLAC_RUN_DEPENDS= flac:${PORTSDIR}/audio/flac +LAME_RUN_DEPENDS= lame:${PORTSDIR}/audio/lame +VORBIS_RUN_DEPENDS= oggenc:${PORTSDIR}/audio/vorbis-tools +FAAC_RUN_DEPENDS= faac:${PORTSDIR}/audio/faac +FAAD_RUN_DEPENDS= faad:${PORTSDIR}/audio/faad +XMP_RUN_DEPENDS= xmp:${PORTSDIR}/audio/xmp +MPC_RUN_DEPENDS= mpcdec:${PORTSDIR}/audio/musepack +APE_RUN_DEPENDS= mac:${PORTSDIR}/audio/mac + +.include + +NO_BUILD= yes +USE_JAVA= yes +USE_RC_SUBR= subsonic +JAVA_VERSION= 1.6+ +USERS= subsonic +GROUPS= subsonic +SUBSONIC_HOME= /var/subsonic +SUBSONIC_DIR= ${PREFIX}/${PORTDIRNAME} +WRKSRC= ${WRKDIR}/${PORTNAME} +PKGMESSAGE= ${WRKDIR}/pkg-message +PLIST_SUB+= SUBSONIC_HOME="${SUBSONIC_HOME}" \ + USER="${USERS}" \ + GROUP="${GROUPS}" +SUB_FILES= pkg-message \ + message-common \ + message-transcoding \ + subsonic +SUB_LIST= SUBSONIC_HOME="${SUBSONIC_HOME}" \ + SUBSONIC_DIR="${SUBSONIC_DIR}" \ + USER="${USERS}" \ + GROUP="${GROUPS}" \ + JAVA="${JAVA}" + +do-extract: + @${MKDIR} ${WRKSRC} + @${TAR} -xf ${DISTDIR}/${DISTNAME}.tar.gz -C ${WRKSRC} --no-same-owner --no-same-permission + +do-install: + @${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE} + @${CAT} ${WRKDIR}/message-transcoding >> ${PKGMESSAGE} + @${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE} + ${INSTALL} -d ${STAGEDIR}${SUBSONIC_DIR} + ${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/LICENSE.TXT ${STAGEDIR}${SUBSONIC_DIR}/ + ${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/README.TXT ${STAGEDIR}${SUBSONIC_DIR}/ + ${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/subsonic.war ${STAGEDIR}${SUBSONIC_DIR}/ + ${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/subsonic-booter-jar-with-dependencies.jar ${STAGEDIR}${SUBSONIC_DIR}/ + ${INSTALL_SCRIPT} ${WRKDIR}/${PORTDIRNAME}/subsonic.sh ${STAGEDIR}${SUBSONIC_DIR}/ + ${INSTALL} -d ${STAGEDIR}${SUBSONIC_HOME} + ${INSTALL} -d ${STAGEDIR}${SUBSONIC_HOME}/transcode +.if ${PORT_OPTIONS:MFFMEG} + ${LN} -sf ${PREFIX}/bin/ffmeg ${STAGEDIR}${SUBSONIC_HOME}/transcode/ffmpeg +.endif +.if ${PORT_OPTIONS:MFLAC} + ${LN} -sf ${PREFIX}/bin/flac ${STAGEDIR}${SUBSONIC_HOME}/transcode/flac +.endif +.if ${PORT_OPTIONS:MLAME} + ${LN} -sf ${PREFIX}/bin/lame ${STAGEDIR}${SUBSONIC_HOME}/transcode/lame +.endif + +.include diff --git a/www/subsonic-standalone/distinfo b/www/subsonic-standalone/distinfo new file mode 100644 index 000000000000..0cfe827af13e --- /dev/null +++ b/www/subsonic-standalone/distinfo @@ -0,0 +1,2 @@ +SHA256 (subsonic-5.2-standalone.tar.gz) = f6131bd628cff00071ba5177182eb3454ce23906472c56712f9d7e53366aee63 +SIZE (subsonic-5.2-standaline.tar.gz) = 43671147 diff --git a/www/subsonic-standalone/files/message-transcoding.in b/www/subsonic-standalone/files/message-transcoding.in new file mode 100644 index 000000000000..6601ba9bc5b0 --- /dev/null +++ b/www/subsonic-standalone/files/message-transcoding.in @@ -0,0 +1,38 @@ +Transcoding in Subsonic is a way to re-encode music on the fly to a format +your listening device supports. A common use is transcoding FLAC, WMA, +and Vorbis audio to MP3 for devices supporting only that codec. + +Configuring transcoding uses up to three commands one would use on a normal +command line pipe but with a whitelist of executables installed or linked into +%%SUBSONIC_HOME%%/transcode. The transcoding configuration page takes +transcoding rules in the form of: + + [rule name] [convert from] [convert to] [command 1] [command 2] [command 3] + +The most compatible single audio transcoding command is with FFmpeg, transcoding +any input to MP3, mapping all streams to output, and limiting metadata to the +more-compatible ID3v2.3: + + [All to MP3] [ogg flac wma aiff m4a] [mp3] ... + [ffmpeg -i %s -ab %bk -id3v2_version 3 -map_metadata 0 -map 0:0 -ar 44100 -ac 2 -v 0 -f mp3 -] + +You can also transcode with multiple single-codec commands to avoid +the heavy FFmpeg dependency: + + [FLAC to MP3] [flac] [mp3] ... + [flac --silent --decode --stdout %s] [lame --silent -h -b %b -] + + [AAC to MP3] [m4a] [mp3] ... + [faad -s -o - %s] [lame --silent -h -b %b -] + + [Vorbis to MP3] [ogg] [mp3] ... + [oggdec -Q -o /dev/stdout %s] [lame --silent -h -b %b -] + + [MPC to MP3] [mpc] [mp3] ... + [mpcdec %s -] [lame --silent -h -b %b -] + + [APE to MP3] [ape] [mp3] ... + [mac %s - -d] [lame --silent -h -b %b -] + + [Trackers to MP3] [mod s3m xm it] [mp3] ... + [xmp -q -c %s] [lame --silent -h -b %b -] diff --git a/www/subsonic-standalone/files/pkg-message.in b/www/subsonic-standalone/files/pkg-message.in new file mode 100644 index 000000000000..a00073cfeb84 --- /dev/null +++ b/www/subsonic-standalone/files/pkg-message.in @@ -0,0 +1,7 @@ + +======================================================================== + +Enable Subsonic by putting the following line in /etc/rc.conf + subsonic_enable="YES" + +See %%LOCALBASE%%/etc/rc.d/subsonic for all the options. diff --git a/www/subsonic-standalone/files/subsonic.in b/www/subsonic-standalone/files/subsonic.in new file mode 100644 index 000000000000..3155eefaf5fe --- /dev/null +++ b/www/subsonic-standalone/files/subsonic.in @@ -0,0 +1,94 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: subsonic + +# +# Configuration settings for subsonic in /etc/rc.conf: +# +# subsonic_enable (bool): +# Set to "NO" by default. +# Set it to "YES" to enable subsonic +# +# subsonic_home (str): +# Set to "%%SUBSONIC_HOME%%" by default. +# +# subsonic_music_folder (str): +# Set to "%%SUBSONIC_HOME%%"/music by default. +# +# subsonic_playlist_folder (str): +# Set to "%%SUBSONIC_HOME%%"/playlist by default. +# +# subsonic_pidfile (str): +# Set to "${subsonic_home}/subsonic.pid" by default. +# +# subsonic_host (str): +# Set to "0.0.0.0" by default. +# Specify which IP address to listen to. +# +# subsonic_http_port (int): +# Set to "4040" by default. +# Specify which port to listen on for HTTP. +# +# subsonic_https_port (int): +# Set to "0" by default. +# Specify which port to listen on for HTTPS. +# +# subsonic_context_path (str): +# Set to "/" by default. +# Specify the last part of the Subsonic URL, typically "/" or "/subsonic". +# +# subsonic_max_memory (int): +# Set to "100" by defaut. +# Specify the memory limit (Java heap size) in megabytes. +# + +. /etc/rc.subr + +case $0 in +/etc/rc*) + # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), + # so get the name of the script from $_file + name=$_file + ;; +*) + name=$0 + ;; +esac + +name=${0##*/} +rcvar=${name}_enable +procname="%%JAVA%%" + +load_rc_config "${name}" + +eval "${rcvar}=\${${rcvar}:-'NO'}" +eval "${name}_user=\${${name}_user:-'subsonic'}" +eval "${name}_group=\${${name}_group:-'subsonic'}" +eval "_subsonic_max_memory=\${${name}_max_memory:-'100'}" +eval "_subsonic_home=\${${name}_home:-'%%SUBSONIC_HOME%%'}" +eval "_subsonic_music_folder=\${${name}_music_folder:-'%%SUBSONIC_HOME%%/music'}" +eval "_subsonic_playlist_folder=\${${name}folder:-'%%SUBSONIC_HOME%%/playlist'}" +eval "_subsonic_host=\${${name}_host:-'0.0.0.0'}" +eval "_subsonic_http_port=\${${name}_http_port:-'4040'}" +eval "_subsonic_https_port=\${${name}_https_port:-'0'}" +eval "_subsonic_context_path=\${${name}_context_path:-'/'}" +eval "_subsonic_pidfile=\${${name}_pidfile:-'%%SUBSONIC_HOME%%/subsonic.pid'}" +pidfile="${_subsonic_pidfile}" + + + +command="%%SUBSONIC_DIR%%/subsonic.sh" +command_args="--home=${_subsonic_home} \ + --host=${_subsonic_host} \ + --port=${_subsonic_http_port} \ + --https-port=${_subsonic_https_port} \ + --context-path=${_subsonic_context_path} \ + --max-memory=${_subsonic_max_memory} \ + --pidfile=${_subsonic_pidfile} \ + --default-music-folder=${_subsonic_music_folder} \ + --default-playlist-folder=${_subsonic_playlist_folder}" + +run_rc_command "$1" diff --git a/www/subsonic-standalone/pkg-descr b/www/subsonic-standalone/pkg-descr new file mode 100644 index 000000000000..1cadc7bae709 --- /dev/null +++ b/www/subsonic-standalone/pkg-descr @@ -0,0 +1,7 @@ +Subsonic instantly transports your media to any HTTP connected device +regardless of bitrate. You can stream to multiple players simultaneously. +Subsonic is designed to handle very large music collections. By using +transcoder plug-ins, Subsonic supports on-the-fly conversion and streaming +of virtually any audio format, including MP3, OGG, WMA, FLAC, APE and more. + +WWW: http://www.subsonic.org diff --git a/www/subsonic-standalone/pkg-message-spacer b/www/subsonic-standalone/pkg-message-spacer new file mode 100644 index 000000000000..c2c7e42958f6 --- /dev/null +++ b/www/subsonic-standalone/pkg-message-spacer @@ -0,0 +1,3 @@ + +======================================================================== + diff --git a/www/subsonic-standalone/pkg-plist b/www/subsonic-standalone/pkg-plist new file mode 100644 index 000000000000..1919de305254 --- /dev/null +++ b/www/subsonic-standalone/pkg-plist @@ -0,0 +1,8 @@ +subsonic-standalone/LICENSE.TXT +subsonic-standalone/README.TXT +subsonic-standalone/subsonic.war +subsonic-standalone/subsonic-booter-jar-with-dependencies.jar +subsonic-standalone/subsonic.sh +@unexec test -d %%SUBSONIC_HOME%% && (echo "Configuration information and database saved." && echo "If you you are permanently uninstalling this package" && echo "please remove %%SUBSONIC_HOME%% and its contents manually.") +@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%/transcode +@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%% -- cgit