aboutsummaryrefslogtreecommitdiff
path: root/www/libresonic-standalone
diff options
context:
space:
mode:
authorJeremie Le Hen <jlh@FreeBSD.org>2017-11-09 21:17:14 +0000
committerJeremie Le Hen <jlh@FreeBSD.org>2017-11-09 21:17:14 +0000
commit868f536606bb28cfd175a0d64c51e6cc84225236 (patch)
tree75d818c9243562ad1433ce9af0695a0e8e394c72 /www/libresonic-standalone
parent48f5f5e82eccab195cbdf4b61ce66ef94113e24f (diff)
downloadports-868f536606bb28cfd175a0d64c51e6cc84225236.tar.gz
ports-868f536606bb28cfd175a0d64c51e6cc84225236.zip
Add www/libresonic-standalone port.
Libresonic is a fork of Subsonic under GPLv3. Reviewed by: mat Approved by: mat Differential Revision: https://reviews.freebsd.org/D12597
Notes
Notes: svn path=/head/; revision=453870
Diffstat (limited to 'www/libresonic-standalone')
-rw-r--r--www/libresonic-standalone/Makefile82
-rw-r--r--www/libresonic-standalone/distinfo3
-rw-r--r--www/libresonic-standalone/files/libresonic.in88
-rw-r--r--www/libresonic-standalone/files/pkg-message.in51
-rw-r--r--www/libresonic-standalone/pkg-descr9
-rw-r--r--www/libresonic-standalone/pkg-plist7
6 files changed, 240 insertions, 0 deletions
diff --git a/www/libresonic-standalone/Makefile b/www/libresonic-standalone/Makefile
new file mode 100644
index 000000000000..4db96721669a
--- /dev/null
+++ b/www/libresonic-standalone/Makefile
@@ -0,0 +1,82 @@
+# Created by: Jeremie Le Hen <jlh@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= libresonic
+DISTVERSIONPREFIX= v
+DISTVERSION= 6.2
+CATEGORIES= www java
+MASTER_SITES= https://github.com/Libresonic/libresonic/releases/download/v${DISTVERSION}/
+PKGNAMESUFFIX= -standalone
+EXTRACT_SUFX= .war
+
+MAINTAINER= jlh@FreeBSD.org
+COMMENT= Subsonic streaming media server, standalone version
+
+USE_JAVA= yes
+USE_RC_SUBR= libresonic
+
+LICENSE= GPLv3
+
+OPTIONS_GROUP= TRANSCODING
+TRANSCODING_DESC= Transcoding support
+OPTIONS_GROUP_TRANSCODING= FFMPEG FLAC LAME VORBIS FAAC FAAD XMP MPC APE
+APE_DESC= Depend on mac for Monkey's Audio transcoding #'
+FAAC_DESC= Depend on FAAD for AAC/M4A transcoding
+FAAD_DESC= Depend on FAAC for AAC/M4A transcoding
+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
+MPC_DESC= Depend on mpcdec for MPC transcoding
+VORBIS_DESC= Depend on oggenc/oggdec for Vorbis transcoding
+XMP_DESC= Depend on XMP for module file transcoding
+
+OPTIONS_DEFAULT= FFMPEG
+OPTIONS_SUB= yes
+
+APE_RUN_DEPENDS= mac:audio/mac
+FAAC_RUN_DEPENDS= faac:audio/faac
+FAAD_RUN_DEPENDS= faad:audio/faad
+FFMPEG_RUN_DEPENDS= ffmpeg:multimedia/ffmpeg
+FLAC_RUN_DEPENDS= flac:audio/flac
+LAME_RUN_DEPENDS= lame:audio/lame
+MPC_RUN_DEPENDS= mpcdec:audio/musepack
+VORBIS_RUN_DEPENDS= oggenc:audio/vorbis-tools
+XMP_RUN_DEPENDS= xmp:audio/xmp
+
+# We don't want to extract the .war file, just copy it.
+EXTRACT_CMD= ${CP}
+EXTRACT_BEFORE_ARGS=
+EXTRACT_AFTER_ARGS= libresonic.war
+
+NO_WRKSUBDIR= yes
+NO_BUILD= yes
+JAVA_VERSION= 1.8+
+JAVA_RUN= yes
+# Don't waste UID/GID and reuse Subsonic's user.
+UERS= subsonic
+GROUPS= subsonic
+LIBRESONIC_HOME= /var/libresonic
+PLIST_SUB= LIBRESONIC_HOME="${LIBRESONIC_HOME}" \
+ USER="${USERS}" \
+ GROUP="${GROUPS}"
+SUB_FILES= pkg-message
+SUB_LIST= LIBRESONIC_HOME="${LIBRESONIC_HOME}" \
+ USER="${USERS}" \
+ GROUP="${GROUPS}" \
+ JAVA="${JAVA}"
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/libresonic.war ${STAGEDIR}${DATADIR}/
+ ${MKDIR} ${STAGEDIR}${LIBRESONIC_HOME}/transcode
+
+do-install-FFMPEG-on:
+ ${RLN} ${PREFIX}/bin/ffmpeg ${STAGEDIR}${LIBRESONIC_HOME}/transcode/ffmpeg
+
+do-install-FLAC-on:
+ ${RLN} ${PREFIX}/bin/flac ${STAGEDIR}${LIBRESONIC_HOME}/transcode/flac
+
+do-install-LAME-on:
+ ${RLN} ${PREFIX}/bin/lame ${STAGEDIR}${LIBRESONIC_HOME}/transcode/lame
+
+.include <bsd.port.mk>
diff --git a/www/libresonic-standalone/distinfo b/www/libresonic-standalone/distinfo
new file mode 100644
index 000000000000..f7002133193d
--- /dev/null
+++ b/www/libresonic-standalone/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1507218527
+SHA256 (libresonic-v6.2.war) = 458249eda3f105c0023c7b51d5983ed71a2cb6a3d3a22dd39be656ee359fab99
+SIZE (libresonic-v6.2.war) = 61674004
diff --git a/www/libresonic-standalone/files/libresonic.in b/www/libresonic-standalone/files/libresonic.in
new file mode 100644
index 000000000000..045ee8dcda17
--- /dev/null
+++ b/www/libresonic-standalone/files/libresonic.in
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: libresonic
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Configuration settings for libresonic in /etc/rc.conf:
+#
+# libresonic_enable (bool):
+# Set to "NO" by default.
+# Set it to "YES" to enable libresonic.
+#
+# libresonic_home (str):
+# Set to "%%LIBRESONIC_HOME%%" by default.
+#
+# libresonic_host (str):
+# Set to "0.0.0.0" by default.
+# Specify which IP address to listen to.
+#
+# libresonic_port (int):
+# Set to "4040" by default.
+# Specify which port to listen on for HTTP(S).
+#
+# libresonic_ssl (bool):
+# Set to "NO" by default.
+# Set it to "YES" to enable SSL.
+#
+# libresonic_ssl_keystore (str):
+# Optionally set path to custom SSL keystore.
+#
+# libresonic_ssl_password (str):
+# Optionally set password for custom SSL keystore.
+#
+# libresonic_context_path (str):
+# Set to "/" by default.
+# Specify the last part of the Libresonic URL, typically "/" or "/libresonic".
+#
+# libresonic_max_memory (int):
+# Set to "100" by default.
+# Specify the memory limit (Java heap size) in megabytes.
+#
+
+. /etc/rc.subr
+
+name=libresonic
+rcvar=${name}_enable
+procname="%%JAVA%%"
+
+load_rc_config "${name}"
+
+: ${libresonic_enable:="NO"}
+: ${libresonic_user:="%%USER%%"}
+: ${libresonic_group:="%%GROUP%%"}
+: ${libresonic_home:="%%LIBRESONIC_HOME%%"}
+: ${libresonic_host:="0.0.0.0"}
+: ${libresonic_port:="4040"}
+: ${libresonic_ssl:="NO"}
+: ${libresonic_context_path:="/"}
+: ${libresonic_max_memory:="100"}
+
+if checkyesno libresonic_ssl; then
+ LIBRESONIC_SSL_FLAGS="-Dlibresonic.httpsPort=${libresonic_port}" && libresonic_port="0"
+ if [ ! -z ${libresonic_ssl_keystore} ]; then
+ LIBRESONIC_SSL_FLAGS=${LIBRESONIC_SSL_FLAGS}" -Dlibresonic.ssl.keystore=${libresonic_ssl_keystore} -Dlibresonic.ssl.password=${libresonic_ssl_password}"
+ fi
+fi
+
+start_precmd="export LC_CTYPE='en_US.UTF-8'"
+libresonic_chdir="%%DATADIR%%"
+command="/usr/sbin/daemon"
+command_args="-f ${procname} \
+ -Dlibresonic.home=${libresonic_home} \
+ -Dlibresonic.host=${libresonic_host} \
+ -Dlibresonic.port=${libresonic_port} \
+ ${LIBRESONIC_SSL_FLAGS} \
+ -Dlibresonic.contextPath=${libresonic_context_path} \
+ -Dlibresonic.defaultMusicFolder=${libresonic_home}/music \
+ -Dlibresonic.defaultPodcastFolder=${libresonic_home}/Podcast \
+ -Dlibresonic.defaultPlaylistFolder=${libresonic_home}/playlists \
+ -Xmx${libresonic_max_memory}m \
+ -Djava.awt.headless=true \
+ -jar ${libresonic_chdir}/libresonic.war"
+
+run_rc_command "$1"
diff --git a/www/libresonic-standalone/files/pkg-message.in b/www/libresonic-standalone/files/pkg-message.in
new file mode 100644
index 000000000000..d10c8e1bc3cd
--- /dev/null
+++ b/www/libresonic-standalone/files/pkg-message.in
@@ -0,0 +1,51 @@
+
+========================================================================
+
+Enable Libresonic by putting the following line in /etc/rc.conf
+ libresonic_enable="YES"
+
+See %%LOCALBASE%%/etc/rc.d/libresonic for all the options.
+
+========================================================================
+
+Transcoding in Libresonic 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
+%%LIBRESONIC_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/libresonic-standalone/pkg-descr b/www/libresonic-standalone/pkg-descr
new file mode 100644
index 000000000000..0875ee88dd0c
--- /dev/null
+++ b/www/libresonic-standalone/pkg-descr
@@ -0,0 +1,9 @@
+Libresonic is a web-based media streamer and jukebox fork of Subsonic.
+
+Libresonic instantly transports your media to any HTTP connected device
+regardless of bitrate. You can stream to multiple players simultaneously.
+Libresonic is designed to handle very large music collections. By using
+transcoder plug-ins, Libresonic supports on-the-fly conversion and streaming
+of virtually any audio format, including MP3, OGG, WMA, FLAC, APE and more.
+
+WWW: http://www.libresonic.org
diff --git a/www/libresonic-standalone/pkg-plist b/www/libresonic-standalone/pkg-plist
new file mode 100644
index 000000000000..6f1d0e5ebbb7
--- /dev/null
+++ b/www/libresonic-standalone/pkg-plist
@@ -0,0 +1,7 @@
+%%DATADIR%%/libresonic.war
+%%FFMPEG%%%%LIBRESONIC_HOME%%/transcode/ffmpeg
+%%FLAC%%%%LIBRESONIC_HOME%%/transcode/flac
+%%LAME%%%%LIBRESONIC_HOME%%/transcode/lame
+@postunexec test -d %%LIBRESONIC_HOME%% && (echo "Configuration information and database saved." && echo "If you you are permanently uninstalling this package" && echo "please remove %%LIBRESONIC_HOME%% and its contents manually.") || true
+@dir(%%USER%%,%%GROUP%%,750) %%LIBRESONIC_HOME%%/transcode
+@dir(%%USER%%,%%GROUP%%,750) %%LIBRESONIC_HOME%%