1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

Create a port for Madsonic standalone version (does not require Tomcat to run).

This is a copy of the Subsonic standalone port.

Approved by:	bapt
This commit is contained in:
Jeremie Le Hen 2015-03-22 18:15:02 +00:00
parent cdfa5212c5
commit fb552b88ac
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=381943
9 changed files with 266 additions and 0 deletions

View File

@ -391,6 +391,7 @@
SUBDIR += lynx
SUBDIR += lynx-current
SUBDIR += madsonic
SUBDIR += madsonic-standalone
SUBDIR += magento
SUBDIR += mahara
SUBDIR += man2web

View File

@ -0,0 +1,97 @@
# Created by: Jeremie Le Hen <jlh@FreeBSD.org>
# Based on www/subsonic-standalone
#
# $FreeBSD$
#
PORTNAME= madsonic-standalone
PORTVERSION= 5.1
CATEGORIES= www java
MASTER_SITES= http://madsonic.org/download/${PORTVERSION}/
DISTNAME= 20140927_madsonic-5.1.5150-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 <bsd.port.options.mk>
NO_BUILD= yes
USE_JAVA= yes
USE_RC_SUBR= madsonic
JAVA_VERSION= 1.6+
# Don't waste UID/GID and reuse Subsonic's user.
USERS= subsonic
GROUPS= subsonic
# Keep the same variable names as in the Subsonic port to minimize diffs.
SUBSONIC_HOME= /var/madsonic
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 \
madsonic
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}/madsonic.war ${STAGEDIR}${SUBSONIC_DIR}/
${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/madsonic-booter.jar ${STAGEDIR}${SUBSONIC_DIR}/
${INSTALL_SCRIPT} ${WRKDIR}/${PORTDIRNAME}/madsonic.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 <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (20140927_madsonic-5.1.5150-standalone.tar.gz) = 1775e4a858640842da59493d9e453c1bfaf53dd23a5b95c0bf22851c2e731e64
SIZE (20140927_madsonic-5.1.5150-standalone.tar.gz) = 53088841

View File

@ -0,0 +1,101 @@
#!/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_init_memory (int):
# Set to "192" by defaut.
# Specify the memory initial size (Java heap size) in megabytes.
#
# subsonic_max_memory (int):
# Set to "384" 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'}"
# Keep the same variable names as subsonic to minimize diffs.
eval "_subsonic_init_memory=\${${name}_init_memory:-'192'}"
eval "_subsonic_max_memory=\${${name}_max_memory:-'384'}"
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} \
--init-memory=${_subsonic_init_memory} \
--max-memory=${_subsonic_max_memory} \
--pidfile=${_subsonic_pidfile} \
--default-music-folder=${_subsonic_music_folder} \
--default-playlist-folder=${_subsonic_playlist_folder}"
run_rc_command "$1"

View File

@ -0,0 +1,38 @@
Transcoding in Madsonic 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 -]

View File

@ -0,0 +1,7 @@
========================================================================
Enable Madsonic by putting the following line in /etc/rc.conf
madsonic_enable="YES"
See %%LOCALBASE%%/etc/rc.d/madsonic for all the options.

View File

@ -0,0 +1,9 @@
Madsonic is a web-based media streamer and jukebox fork of Subsonic.
Madsonic 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.madsonic.org

View File

@ -0,0 +1,3 @@
========================================================================

View File

@ -0,0 +1,8 @@
madsonic-standalone/LICENSE.TXT
madsonic-standalone/README.TXT
madsonic-standalone/madsonic.war
madsonic-standalone/madsonic-booter.jar
madsonic-standalone/madsonic.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%%