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

Collapse All | Expand All

(-)madsonic-standalone/Makefile (-25 / +19 lines)
Lines 4-14 Link Here
4
# $FreeBSD: head/www/madsonic-standalone/Makefile 382052 2015-03-23 22:21:33Z antoine $
4
# $FreeBSD: head/www/madsonic-standalone/Makefile 382052 2015-03-23 22:21:33Z antoine $
5
#
5
#
6
6
7
PORTNAME=	madsonic-standalone
7
PORTNAME=	madsonic
8
PORTVERSION=	5.1
8
PORTVERSION=	6.0
9
DISTVERSIONSUFFIX=	.7860
10
DISTDATE=	20160109
9
CATEGORIES=	www java
11
CATEGORIES=	www java
10
MASTER_SITES=	http://madsonic.org/download/${PORTVERSION}/
12
MASTER_SITES=	http://madsonic.org/download/${PORTVERSION}/
11
DISTNAME=	20140927_madsonic-5.1.5150-standalone
13
PKGNAMESUFFIX=	-standalone
14
DISTNAME=	${DISTDATE}_${PORTNAME}-${PORTVERSION}${DISTVERSIONSUFFIX}${PKGNAMESUFFIX}
12
15
13
MAINTAINER=	jlh@FreeBSD.org
16
MAINTAINER=	jlh@FreeBSD.org
14
COMMENT=	Subsonic streaming media server, standalone version
17
COMMENT=	Subsonic streaming media server, standalone version
Lines 43-90 Link Here
43
46
44
.include <bsd.port.options.mk>
47
.include <bsd.port.options.mk>
45
48
49
NO_WRKSUBDIR=	yes
46
NO_BUILD=	yes
50
NO_BUILD=	yes
47
USE_JAVA=	yes
51
USE_JAVA=	yes
48
USE_RC_SUBR=	madsonic
49
JAVA_VERSION=	1.6+
52
JAVA_VERSION=	1.6+
53
JAVA_RUN=	yes
54
USE_RC_SUBR=	madsonic
50
# Don't waste UID/GID and reuse Subsonic's user.
55
# Don't waste UID/GID and reuse Subsonic's user.
51
USERS=		subsonic
56
USERS=		subsonic
52
GROUPS=		subsonic
57
GROUPS=		subsonic
53
# Keep the same variable names as in the Subsonic port to minimize diffs.
58
# Keep the same variable names as in the Subsonic port to minimize diffs.
54
SUBSONIC_HOME=	/var/madsonic
59
SUBSONIC_HOME=	/var/madsonic
55
SUBSONIC_DIR=	${PREFIX}/${PORTDIRNAME}
56
WRKSRC=		${WRKDIR}/${PORTNAME}
57
PKGMESSAGE=	${WRKDIR}/pkg-message
58
PLIST_SUB+=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
60
PLIST_SUB+=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
59
		USER="${USERS}" \
61
		USER="${USERS}" \
60
		GROUP="${GROUPS}"
62
		GROUP="${GROUPS}"
61
SUB_FILES= 	pkg-message \
63
SUB_FILES=	pkg-message \
62
		message-transcoding \
64
		message-transcoding
63
		madsonic
64
SUB_LIST=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
65
SUB_LIST=	SUBSONIC_HOME="${SUBSONIC_HOME}" \
65
		SUBSONIC_DIR="${SUBSONIC_DIR}" \
66
		USER="${USERS}" \
66
		USER="${USERS}" \
67
		GROUP="${GROUPS}" \
67
		GROUP="${GROUPS}" \
68
		JAVA="${JAVA}"
68
		JAVA="${JAVA}"
69
69
70
do-extract:
71
	@${MKDIR} ${WRKSRC}
72
	@${TAR} -xf ${DISTDIR}/${DISTNAME}.tar.gz -C ${WRKSRC} --no-same-owner --no-same-permission
73
74
do-install:
70
do-install:
75
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
71
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
76
	@${CAT} ${WRKDIR}/message-transcoding >> ${PKGMESSAGE}
72
	@${CAT} ${WRKDIR}/message-transcoding >> ${PKGMESSAGE}
77
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
73
	@${CAT} ${PKGDIR}/pkg-message-spacer >> ${PKGMESSAGE}
78
	${INSTALL} -d ${STAGEDIR}${SUBSONIC_DIR}
74
	${MKDIR} ${STAGEDIR}${DATADIR}
79
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/LICENSE.TXT ${STAGEDIR}${SUBSONIC_DIR}/
75
	${INSTALL_DATA} ${WRKSRC}/madsonic.war ${STAGEDIR}${DATADIR}/
80
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/README.TXT ${STAGEDIR}${SUBSONIC_DIR}/
76
	${INSTALL_DATA} ${WRKSRC}/madsonic-booter.jar ${STAGEDIR}${DATADIR}/
81
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/madsonic.war ${STAGEDIR}${SUBSONIC_DIR}/
77
82
	${INSTALL_DATA} ${WRKDIR}/${PORTDIRNAME}/madsonic-booter.jar ${STAGEDIR}${SUBSONIC_DIR}/
78
post-install:
83
	${INSTALL_SCRIPT} ${WRKDIR}/${PORTDIRNAME}/madsonic.sh ${STAGEDIR}${SUBSONIC_DIR}/
79
	${MKDIR} ${STAGEDIR}${SUBSONIC_HOME}/transcode
84
	${INSTALL} -d ${STAGEDIR}${SUBSONIC_HOME}
80
.if ${PORT_OPTIONS:MFFMPEG}
85
	${INSTALL} -d ${STAGEDIR}${SUBSONIC_HOME}/transcode
81
	${LN} -sf ${PREFIX}/bin/ffmpeg ${STAGEDIR}${SUBSONIC_HOME}/transcode/ffmpeg
86
.if ${PORT_OPTIONS:MFFMEG}
87
	${LN} -sf ${PREFIX}/bin/ffmeg ${STAGEDIR}${SUBSONIC_HOME}/transcode/ffmpeg
88
.endif
82
.endif
89
.if ${PORT_OPTIONS:MFLAC}
83
.if ${PORT_OPTIONS:MFLAC}
90
	${LN} -sf ${PREFIX}/bin/flac ${STAGEDIR}${SUBSONIC_HOME}/transcode/flac
84
	${LN} -sf ${PREFIX}/bin/flac ${STAGEDIR}${SUBSONIC_HOME}/transcode/flac
(-)madsonic-standalone/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (20140927_madsonic-5.1.5150-standalone.tar.gz) = 1775e4a858640842da59493d9e453c1bfaf53dd23a5b95c0bf22851c2e731e64
1
SHA256 (20160109_madsonic-6.0.7860-standalone.tar.gz) = 3b343b197d7d2fad10bf70554c1ceede63feb0f1a66df3d135b1dfb2e56e2893
2
SIZE (20140927_madsonic-5.1.5150-standalone.tar.gz) = 53088841
2
SIZE (20160109_madsonic-6.0.7860-standalone.tar.gz) = 81643517
(-)madsonic-standalone/files/madsonic.in (-50 / +53 lines)
Lines 2-51 Link Here
2
#
2
#
3
# $FreeBSD: head/www/madsonic-standalone/files/madsonic.in 389352 2015-06-13 12:21:51Z jlh $
3
# $FreeBSD: head/www/madsonic-standalone/files/madsonic.in 389352 2015-06-13 12:21:51Z jlh $
4
#
4
#
5
6
# PROVIDE: subsonic
5
# PROVIDE: subsonic
7
6
# REQUIRE: LOGIN
7
# KEYWORD: shutdown
8
#
8
#
9
# Configuration settings for madsonic in /etc/rc.conf:
9
# Configuration settings for madsonic in /etc/rc.conf:
10
#
10
#
11
# madsonic_enable (bool):
11
# madsonic_enable (bool):
12
#   Set to "NO" by default.
12
#   Set to "NO" by default.
13
#   Set it to "YES" to enable madsonic
13
#   Set it to "YES" to enable madsonic.
14
#
14
#
15
# madsonic_home (str):
15
# madsonic_home (str):
16
#   Set to "%%SUBSONIC_HOME%%" by default.
16
#   Set to "%%SUBSONIC_HOME%%" by default.
17
#
17
#
18
# madsonic_music_folder (str):
19
#   Set to "%%SUBSONIC_HOME%%"/music by default.
20
#
21
# madsonic_playlist_folder (str):
22
#   Set to "%%SUBSONIC_HOME%%"/playlist by default.
23
#
24
# madsonic_pidfile (str):
25
#   Set to "${madsonic_home}/madsonic.pid" by default.
26
#
27
# madsonic_host (str):
18
# madsonic_host (str):
28
#   Set to "0.0.0.0" by default.
19
#   Set to "0.0.0.0" by default.
29
#   Specify which IP address to listen to.
20
#   Specify which IP address to listen to.
30
#
21
#
31
# madsonic_http_port (int):
22
# madsonic_port (int):
32
#   Set to "4040" by default.
23
#   Set to "4040" by default.
33
#   Specify which port to listen on for HTTP.
24
#   Specify which port to listen on for HTTP(S).
34
#
25
#
35
# madsonic_https_port (int):
26
# madsonic_ssl (bool):
36
#   Set to "0" by default.
27
#   Set to "OFF" by default.
37
#   Specify which port to listen on for HTTPS.
28
#   Set it to "YES" to enable SSL.
29
#
30
# madsonic_ssl_keystore (str):
31
#   Optionally set path to custom SSL keystore.
32
#
33
# madsonic_ssl_password (str):
34
#   Optionally set password for custom SSL keystore.
38
#
35
#
39
# madsonic_context_path (str):
36
# madsonic_context_path (str):
40
#   Set to "/" by default.
37
#   Set to "/" by default.
41
#   Specify the last part of the Subsonic URL, typically "/" or "/madsonic".
38
#   Specify the last part of the Subsonic URL, typically "/" or "/madsonic".
42
#
39
#
43
# madsonic_init_memory (int):
40
# madsonic_init_memory (int):
44
#   Set to "192" by defaut.
41
#   Set to "192" by default.
45
#   Specify the memory initial size (Java heap size) in megabytes.
42
#   Specify the memory initial size (Java heap size) in megabytes.
46
#
43
#
47
# madsonic_max_memory (int):
44
# madsonic_max_memory (int):
48
#   Set to "384" by defaut.
45
#   Set to "384" by default.
49
#   Specify the memory limit (Java heap size) in megabytes.
46
#   Specify the memory limit (Java heap size) in megabytes.
50
#
47
#
51
48
Lines 57-92 Link Here
57
54
58
load_rc_config "${name}"
55
load_rc_config "${name}"
59
56
60
eval "${rcvar}=\${${rcvar}:-'NO'}"
57
: ${madsonic_enable:="NO"}
61
eval "${name}_user=\${${name}_user:-'subsonic'}"
58
: ${madsonic_user:="%%USER%%"}
62
eval "${name}_group=\${${name}_group:-'subsonic'}"
59
: ${madsonic_group:="%%GROUP%%"}
63
# Keep the same variable names as subsonic to minimize diffs.
60
: ${madsonic_home:="%%SUBSONIC_HOME%%"}
64
eval "_subsonic_init_memory=\${${name}_init_memory:-'192'}"
61
: ${madsonic_host:="0.0.0.0"}
65
eval "_subsonic_max_memory=\${${name}_max_memory:-'384'}"
62
: ${madsonic_port:="4040"}
66
eval "_subsonic_home=\${${name}_home:-'%%SUBSONIC_HOME%%'}"
63
: ${madsonic_ssl:="NO"}
67
eval "_subsonic_music_folder=\${${name}_music_folder:-'%%SUBSONIC_HOME%%/music'}"
64
: ${madsonic_context_path:="/"}
68
eval "_subsonic_playlist_folder=\${${name}folder:-'%%SUBSONIC_HOME%%/playlist'}"
65
: ${madsonic_init_memory:="192"}
69
eval "_subsonic_host=\${${name}_host:-'0.0.0.0'}"
66
: ${madsonic_max_memory:="384"}
70
eval "_subsonic_http_port=\${${name}_http_port:-'4040'}"
67
71
eval "_subsonic_https_port=\${${name}_https_port:-'0'}"
68
if checkyesno madsonic_ssl; then
72
eval "_subsonic_context_path=\${${name}_context_path:-'/'}"
69
	MADSONIC_SSL_FLAGS="-Dmadsonic.httpsPort=${madsonic_port}" && madsonic_port="0"
73
eval "_subsonic_pidfile=\${${name}_pidfile:-'%%SUBSONIC_HOME%%/subsonic.pid'}"
70
	if [ ! -z ${madsonic_ssl_keystore} ]; then
74
pidfile="${_subsonic_pidfile}"
71
		MADSONIC_SSL_FLAGS=${MADSONIC_SSL_FLAGS}" -Dmadsonic.ssl.keystore=${madsonic_ssl_keystore} -Dmadsonic.ssl.password=${madsonic_ssl_password}"
75
72
	fi
76
73
fi
77
74
78
command="%%SUBSONIC_DIR%%/madsonic.sh"
75
start_precmd="export LC_CTYPE='UTF-8'"
79
command_args="--home=${_subsonic_home} \
76
madsonic_chdir="%%DATADIR%%"
80
	--host=${_subsonic_host} \
77
command="/usr/sbin/daemon"
81
	--port=${_subsonic_http_port} \
78
command_args="-f ${procname} \
82
	--https-port=${_subsonic_https_port} \
79
	-Dmadsonic.home=${madsonic_home} \
83
	--context-path=${_subsonic_context_path} \
80
	-Dmadsonic.host=${madsonic_host} \
84
	--init-memory=${_subsonic_init_memory} \
81
	-Dmadsonic.port=${madsonic_port} \
85
	--max-memory=${_subsonic_max_memory} \
82
	${MADSONIC_SSL_FLAGS} \
86
	--pidfile=${_subsonic_pidfile} \
83
	-Dmadsonic.contextPath=${madsonic_context_path} \
87
	--default-music-folder=${_subsonic_music_folder} \
84
	-Dmadsonic.defaultMusicFolder=${madsonic_home}/artists \
88
	--default-playlist-import-folder=${_subsonic_playlist_folder}/import \
85
	-Dmadsonic.defaultUploadFolder=${madsonic_home}/incoming \
89
	--default-playlist-export-folder=${_subsonic_playlist_folder}/export \
86
	-Dmadsonic.defaultPodcastFolder=${madsonic_home}/podcasts \
90
	--default-playlist-backup-folder=${_subsonic_playlist_folder}/backup"
87
	-Dmadsonic.defaultPlaylistImportFolder=${madsonic_home}/playlists/import \
88
	-Dmadsonic.defaultPlaylistExportFolder=${madsonic_home}/playlists/export \
89
	-Dmadsonic.defaultPlaylistBackupFolder=${madsonic_home}/playlists/backup \
90
	-Xms${madsonic_init_memory}m \
91
	-Xmx${madsonic_max_memory}m \
92
	-Djava.awt.headless=true \
93
	-jar ${madsonic_chdir}/madsonic-booter.jar"
91
94
92
run_rc_command "$1"
95
run_rc_command "$1"
(-)madsonic-standalone/pkg-plist (-6 / +6 lines)
Lines 1-8 Link Here
1
madsonic-standalone/LICENSE.TXT
1
%%DATADIR%%/madsonic.war
2
madsonic-standalone/README.TXT
2
%%DATADIR%%/madsonic-booter.jar
3
madsonic-standalone/madsonic.war
3
%%FFMPEG%%%%SUBSONIC_HOME%%/transcode/ffmpeg
4
madsonic-standalone/madsonic-booter.jar
4
%%FLAC%%%%SUBSONIC_HOME%%/transcode/flac
5
madsonic-standalone/madsonic.sh
5
%%LAME%%%%SUBSONIC_HOME%%/transcode/lame
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
@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
7
@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%/transcode
8
@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%
8
@dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%

Return to bug 210651