View | Details | Raw Unified | Return to bug 210608 | Differences between
and this patch

Collapse All | Expand All

(-)subsonic-standalone/Makefile (-31 / +26 lines)
Lines 2-12 Link Here
2
# Based on www/subsonic from Nicole Reid <root@cooltrainer.org>
2
# Based on www/subsonic from Nicole Reid <root@cooltrainer.org>
3
# $FreeBSD: head/www/subsonic-standalone/Makefile 382052 2015-03-23 22:21:33Z antoine $
3
# $FreeBSD: head/www/subsonic-standalone/Makefile 382052 2015-03-23 22:21:33Z antoine $
4
4
5
PORTNAME=	subsonic-standalone
5
PORTNAME=	subsonic
6
PORTVERSION=	5.2
6
PORTVERSION=	5.2
7
CATEGORIES=	www java
7
CATEGORIES=	www java
8
MASTER_SITES=	SF/subsonic/subsonic/${PORTVERSION}
8
MASTER_SITES=	SF/subsonic/subsonic/${PORTVERSION}
9
DISTNAME=	subsonic-${PORTVERSION}-standalone
9
PKGNAMESUFFIX=	-standalone
10
DISTNAME=	${PORTNAME}-${PORTVERSION}${PKGNAMESUFFIX}
10
11
11
MAINTAINER=	jlh@FreeBSD.org
12
MAINTAINER=	jlh@FreeBSD.org
12
COMMENT=	Subsonic streaming media server, standalone version
13
COMMENT=	Subsonic streaming media server, standalone version
Lines 29-86 Link Here
29
OPTIONS_DEFAULT=	FFMPEG
30
OPTIONS_DEFAULT=	FFMPEG
30
OPTIONS_SUB=	yes
31
OPTIONS_SUB=	yes
31
32
32
FFMPEG_RUN_DEPENDS=	ffmpeg:${PORTSDIR}/multimedia/ffmpeg
33
FFMPEG_RUN_DEPENDS=	ffmpeg:multimedia/ffmpeg
33
FLAC_RUN_DEPENDS=	flac:${PORTSDIR}/audio/flac
34
FLAC_RUN_DEPENDS=	flac:audio/flac
34
LAME_RUN_DEPENDS=	lame:${PORTSDIR}/audio/lame
35
LAME_RUN_DEPENDS=	lame:audio/lame
35
VORBIS_RUN_DEPENDS=	oggenc:${PORTSDIR}/audio/vorbis-tools
36
VORBIS_RUN_DEPENDS=	oggenc:audio/vorbis-tools
36
FAAC_RUN_DEPENDS=	faac:${PORTSDIR}/audio/faac
37
FAAC_RUN_DEPENDS=	faac:audio/faac
37
FAAD_RUN_DEPENDS=	faad:${PORTSDIR}/audio/faad
38
FAAD_RUN_DEPENDS=	faad:audio/faad
38
XMP_RUN_DEPENDS=	xmp:${PORTSDIR}/audio/xmp
39
XMP_RUN_DEPENDS=	xmp:audio/xmp
39
MPC_RUN_DEPENDS=	mpcdec:${PORTSDIR}/audio/musepack
40
MPC_RUN_DEPENDS=	mpcdec:audio/musepack
40
APE_RUN_DEPENDS=	mac:${PORTSDIR}/audio/mac
41
APE_RUN_DEPENDS=	mac:audio/mac
41
42
42
.include <bsd.port.options.mk>
43
.include <bsd.port.options.mk>
43
44
45
NO_WRKSUBDIR=	yes
44
NO_BUILD=	yes
46
NO_BUILD=	yes
45
USE_JAVA=	yes
47
USE_JAVA=	yes
46
USE_RC_SUBR=	subsonic
48
USE_RC_SUBR=	subsonic
47
JAVA_VERSION=	1.6+
49
JAVA_VERSION=	1.6+
50
JAVA_RUN=	yes
48
USERS=		subsonic
51
USERS=		subsonic
49
GROUPS=		subsonic
52
GROUPS=		subsonic
50
SUBSONIC_HOME=	/var/subsonic
53
SUBSONIC_HOME=	/var/subsonic
51
SUBSONIC_DIR=	${PREFIX}/${PORTDIRNAME}
52
WRKSRC=		${WRKDIR}/${PORTNAME}
53
PKGMESSAGE=	${WRKDIR}/pkg-message
54
PLIST_SUB+=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
54
PLIST_SUB+=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
55
		USER="${USERS}" \
55
		USER="${USERS}" \
56
		GROUP="${GROUPS}"
56
		GROUP="${GROUPS}"
57
SUB_FILES= 	pkg-message \
57
SUB_FILES=	pkg-message \
58
		message-transcoding \
58
		message-transcoding
59
		subsonic
60
SUB_LIST=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
59
SUB_LIST=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
61
		SUBSONIC_DIR="${SUBSONIC_DIR}" \
62
		USER="${USERS}" \
60
		USER="${USERS}" \
63
		GROUP="${GROUPS}" \
61
		GROUP="${GROUPS}" \
64
		JAVA="${JAVA}"
62
		JAVA="${JAVA}"
65
63
66
do-extract:
64
CONFLICTS_INSTALL=	subsonic-jetty subsonic-resin3 subsonic-tomcat[678]
67
	@${MKDIR} ${WRKSRC}
68
	@${TAR} -xf ${DISTDIR}/${DISTNAME}.tar.gz -C ${WRKSRC} --no-same-owner --no-same-permission
69
65
70
do-install:
66
do-install:
71
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
67
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
72
	@${CAT} ${WRKDIR}/message-transcoding >> ${PKGMESSAGE}
68
	@${CAT} ${WRKDIR}/message-transcoding >> ${PKGMESSAGE}
73
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
69
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
74
	${INSTALL} -d ${STAGEDIR}${SUBSONIC_DIR}
70
	${MKDIR} ${STAGEDIR}${DATADIR}
75
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/LICENSE.TXT ${STAGEDIR}${SUBSONIC_DIR}/
71
	${INSTALL_MAN} ${WRKSRC}/README.TXT ${STAGEDIR}${DATADIR}/
76
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/README.TXT ${STAGEDIR}${SUBSONIC_DIR}/
72
	${INSTALL_DATA} ${WRKSRC}/subsonic.war ${STAGEDIR}${DATADIR}/
77
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/subsonic.war ${STAGEDIR}${SUBSONIC_DIR}/
73
	${INSTALL_DATA} ${WRKSRC}/subsonic-booter-jar-with-dependencies.jar ${STAGEDIR}${DATADIR}/
78
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/subsonic-booter-jar-with-dependencies.jar ${STAGEDIR}${SUBSONIC_DIR}/
74
79
	${INSTALL_SCRIPT} ${WRKDIR}/${PORTDIRNAME}/subsonic.sh ${STAGEDIR}${SUBSONIC_DIR}/
75
post-install:
80
	${INSTALL} -d ${STAGEDIR}${SUBSONIC_HOME}
76
	${MKDIR} ${STAGEDIR}${SUBSONIC_HOME}/transcode
81
	${INSTALL} -d ${STAGEDIR}${SUBSONIC_HOME}/transcode
77
.if ${PORT_OPTIONS:MFFMPEG}
82
.if ${PORT_OPTIONS:MFFMEG}
78
	${LN} -sf ${PREFIX}/bin/ffmpeg ${STAGEDIR}${SUBSONIC_HOME}/transcode/ffmpeg
83
	${LN} -sf ${PREFIX}/bin/ffmeg ${STAGEDIR}${SUBSONIC_HOME}/transcode/ffmpeg
84
.endif
79
.endif
85
.if ${PORT_OPTIONS:MFLAC}
80
.if ${PORT_OPTIONS:MFLAC}
86
	${LN} -sf ${PREFIX}/bin/flac ${STAGEDIR}${SUBSONIC_HOME}/transcode/flac
81
	${LN} -sf ${PREFIX}/bin/flac ${STAGEDIR}${SUBSONIC_HOME}/transcode/flac
(-)subsonic-standalone/files/subsonic.in (-42 / +47 lines)
Lines 4-47 Link Here
4
#
4
#
5
5
6
# PROVIDE: subsonic
6
# PROVIDE: subsonic
7
# REQUIRE: LOGIN
8
# KEYWORD: shutdown
7
9
8
#
10
#
9
# Configuration settings for subsonic in /etc/rc.conf:
11
# Configuration settings for subsonic in /etc/rc.conf:
10
#
12
#
11
# subsonic_enable (bool):
13
# subsonic_enable (bool):
12
#   Set to "NO" by default.
14
#   Set to "NO" by default.
13
#   Set it to "YES" to enable subsonic
15
#   Set it to "YES" to enable subsonic.
14
#
16
#
15
# subsonic_home (str):
17
# subsonic_home (str):
16
#   Set to "%%SUBSONIC_HOME%%" by default.
18
#   Set to "%%SUBSONIC_HOME%%" by default.
17
#
19
#
18
# subsonic_music_folder (str):
19
#   Set to "%%SUBSONIC_HOME%%"/music by default.
20
#
21
# subsonic_playlist_folder (str):
22
#   Set to "%%SUBSONIC_HOME%%"/playlist by default.
23
#
24
# subsonic_pidfile (str):
25
#   Set to "${subsonic_home}/subsonic.pid" by default.
26
#
27
# subsonic_host (str):
20
# subsonic_host (str):
28
#   Set to "0.0.0.0" by default.
21
#   Set to "0.0.0.0" by default.
29
#   Specify which IP address to listen to.
22
#   Specify which IP address to listen to.
30
#
23
#
31
# subsonic_http_port (int):
24
# subsonic_port (int):
32
#   Set to "4040" by default.
25
#   Set to "4040" by default.
33
#   Specify which port to listen on for HTTP.
26
#   Specify which port to listen on for HTTP(S).
27
#
28
# subsonic_ssl (bool):
29
#   Set to "NO" by default.
30
#   Set it to "YES" to enable SSL.
34
#
31
#
35
# subsonic_https_port (int):
32
# subsonic_ssl_keystore (str):
36
#   Set to "0" by default.
33
#   Optionally set path to custom SSL keystore.
37
#   Specify which port to listen on for HTTPS.
34
#
35
# subsonic_ssl_password (str):
36
#   Optionally set password for custom SSL keystore.
38
#
37
#
39
# subsonic_context_path (str):
38
# subsonic_context_path (str):
40
#   Set to "/" by default.
39
#   Set to "/" by default.
41
#   Specify the last part of the Subsonic URL, typically "/" or "/subsonic".
40
#   Specify the last part of the Subsonic URL, typically "/" or "/subsonic".
42
#
41
#
43
# subsonic_max_memory (int):
42
# subsonic_max_memory (int):
44
#   Set to "100" by defaut.
43
#   Set to "100" by default.
45
#   Specify the memory limit (Java heap size) in megabytes.
44
#   Specify the memory limit (Java heap size) in megabytes.
46
#
45
#
47
46
Lines 53-83 Link Here
53
52
54
load_rc_config "${name}"
53
load_rc_config "${name}"
55
54
56
eval "${rcvar}=\${${rcvar}:-'NO'}"
55
: ${subsonic_enable:="NO"}
57
eval "${name}_user=\${${name}_user:-'subsonic'}"
56
: ${subsonic_user:="%%USER%%"}
58
eval "${name}_group=\${${name}_group:-'subsonic'}"
57
: ${subsonic_group:="%%GROUP%%"}
59
eval "_subsonic_max_memory=\${${name}_max_memory:-'100'}"
58
: ${subsonic_home:="%%SUBSONIC_HOME%%"}
60
eval "_subsonic_home=\${${name}_home:-'%%SUBSONIC_HOME%%'}"
59
: ${subsonic_host:="0.0.0.0"}
61
eval "_subsonic_music_folder=\${${name}_music_folder:-'%%SUBSONIC_HOME%%/music'}"
60
: ${subsonic_port:="4040"}
62
eval "_subsonic_playlist_folder=\${${name}folder:-'%%SUBSONIC_HOME%%/playlist'}"
61
: ${subsonic_ssl:="NO"}
63
eval "_subsonic_host=\${${name}_host:-'0.0.0.0'}"
62
: ${subsonic_context_path:="/"}
64
eval "_subsonic_http_port=\${${name}_http_port:-'4040'}"
63
: ${subsonic_max_memory:="100"}
65
eval "_subsonic_https_port=\${${name}_https_port:-'0'}"
64
66
eval "_subsonic_context_path=\${${name}_context_path:-'/'}"
65
if checkyesno subsonic_ssl; then
67
eval "_subsonic_pidfile=\${${name}_pidfile:-'%%SUBSONIC_HOME%%/subsonic.pid'}"
66
	SUBSONIC_SSL_FLAGS="-Dsubsonic.httpsPort=${subsonic_port}" && subsonic_port="0"
68
pidfile="${_subsonic_pidfile}"
67
	if [ ! -z ${subsonic_ssl_keystore} ]; then
69
68
		SUBSONIC_SSL_FLAGS=${SUBSONIC_SSL_FLAGS}" -Dsubsonic.ssl.keystore=${subsonic_ssl_keystore} -Dsubsonic.ssl.password=${subsonic_ssl_password}"
70
69
	fi
71
70
fi
72
command="%%SUBSONIC_DIR%%/subsonic.sh"
71
73
command_args="--home=${_subsonic_home} \
72
start_precmd="export LC_CTYPE='UTF-8'"
74
	--host=${_subsonic_host} \
73
subsonic_chdir="%%DATADIR%%"
75
	--port=${_subsonic_http_port} \
74
command="/usr/sbin/daemon"
76
	--https-port=${_subsonic_https_port} \
75
command_args="-f ${procname} \
77
	--context-path=${_subsonic_context_path} \
76
	-Dsubsonic.home=${subsonic_home} \
78
	--max-memory=${_subsonic_max_memory} \
77
	-Dsubsonic.host=${subsonic_host} \
79
	--pidfile=${_subsonic_pidfile} \
78
	-Dsubsonic.port=${subsonic_port} \
80
	--default-music-folder=${_subsonic_music_folder} \
79
	${SUBSONIC_SSL_FLAGS} \
81
	--default-playlist-folder=${_subsonic_playlist_folder}"
80
	-Dsubsonic.contextPath=${subsonic_context_path} \
81
	-Dsubsonic.defaultMusicFolder=${subsonic_home}/music \
82
	-Dsubsonic.defaultPodcastFolder=${subsonic_home}/Podcast \
83
	-Dsubsonic.defaultPlaylistFolder=${subsonic_home}/playlists \
84
	-Xmx${subsonic_max_memory}m \
85
	-Djava.awt.headless=true \
86
	-jar ${subsonic_chdir}/subsonic-booter-jar-with-dependencies.jar"
82
87
83
run_rc_command "$1"
88
run_rc_command "$1"
(-)subsonic-standalone/pkg-install (+20 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
HTTP_PORT=$(sysrc -i -n subsonic_http_port)
4
HTTPS_PORT=$(sysrc -i -n subsonic_https_port)
5
6
if [ "$HTTPS_PORT" == "0" ]; then
7
	unset HTTPS_PORT
8
	sysrc subsonic_https_port=""
9
fi
10
11
if [ -n "$HTTP_PORT" ]; then
12
	sysrc subsonic_http_port="" \
13
		subsonic_port="$HTTP_PORT"
14
fi
15
16
if [ -n "$HTTPS_PORT" ]; then
17
	sysrc subsonic_https_port="" \
18
		subsonic_port="$HTTPS_PORT" \
19
		subsonic_ssl="YES"
20
fi
(-)subsonic-standalone/pkg-plist (-6 / +7 lines)
Lines 1-8 Link Here
1
subsonic-standalone/LICENSE.TXT
1
%%DATADIR%%/README.TXT
2
subsonic-standalone/README.TXT
2
%%DATADIR%%/subsonic-booter-jar-with-dependencies.jar
3
subsonic-standalone/subsonic.war
3
%%DATADIR%%/subsonic.war
4
subsonic-standalone/subsonic-booter-jar-with-dependencies.jar
4
%%FFMPEG%%%%SUBSONIC_HOME%%/transcode/ffmpeg
5
subsonic-standalone/subsonic.sh
5
%%FLAC%%%%SUBSONIC_HOME%%/transcode/flac
6
@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.")
6
%%LAME%%%%SUBSONIC_HOME%%/transcode/lame
7
@postunexec 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.")
7
@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%/transcode
8
@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%/transcode
8
@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%
9
@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%

Return to bug 210608