svn commit: r420615 - in head/www/subsonic-standalone: . files

Jeremie Le Hen jlh at FreeBSD.org
Mon Aug 22 13:33:25 UTC 2016


Author: jlh (src committer)
Date: Mon Aug 22 13:33:23 2016
New Revision: 420615
URL: https://svnweb.freebsd.org/changeset/ports/420615

Log:
  Minor improvements.
  
  Most noticeable changes in no particular order:
  - The rc.d script doesn't use the provided shell script to start the daemon,
    but starts it directly.
  - This is now installed in ${DATADIR}, not in ${PREFIX}/${PORTDIRNAME}.
  - Define CONFLICTS_INSTALL so as to avoid colliding with non standalone version.
  - Use post-install-${OPTION}-on.
  
  PR:		210608
  Submitted by:	joshruehlig at gmail.com
  Reviewed by:	crees
  Approved by:	crees
  Differential Revision:	https://reviews.freebsd.org/D7304

Modified:
  head/www/subsonic-standalone/Makefile
  head/www/subsonic-standalone/files/subsonic.in
  head/www/subsonic-standalone/pkg-plist

Modified: head/www/subsonic-standalone/Makefile
==============================================================================
--- head/www/subsonic-standalone/Makefile	Mon Aug 22 13:27:51 2016	(r420614)
+++ head/www/subsonic-standalone/Makefile	Mon Aug 22 13:33:23 2016	(r420615)
@@ -41,52 +41,46 @@ APE_RUN_DEPENDS=	mac:audio/mac
 
 .include <bsd.port.options.mk>
 
+NO_WRKSUBDIR=	yes
 NO_BUILD=	yes
 USE_JAVA=	yes
 USE_RC_SUBR=	subsonic
 JAVA_VERSION=	1.6+
+JAVA_RUN=	yes
 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-transcoding \
-		subsonic
+SUB_FILES=	pkg-message \
+		message-transcoding
 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
+CONFLICTS_INSTALL=	subsonic-jetty subsonic-resin3 subsonic-tomcat[678]
 
 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}
+	${MKDIR} ${STAGEDIR}${DATADIR}
+	${INSTALL_MAN} ${WRKSRC}/README.TXT ${STAGEDIR}${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/subsonic.war ${STAGEDIR}${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/subsonic-booter-jar-with-dependencies.jar ${STAGEDIR}${DATADIR}/
+
+post-install:
+	${MKDIR} ${STAGEDIR}${SUBSONIC_HOME}/transcode
+
+post-install-FFMPEG-on:
+	${LN} -sf ${PREFIX}/bin/ffmpeg ${STAGEDIR}${SUBSONIC_HOME}/transcode/ffmpeg
+
+post-install-FLAC-on:
 	${LN} -sf ${PREFIX}/bin/flac ${STAGEDIR}${SUBSONIC_HOME}/transcode/flac
-.endif
-.if ${PORT_OPTIONS:MLAME}
+
+post-install-LAME-on:
 	${LN} -sf ${PREFIX}/bin/lame ${STAGEDIR}${SUBSONIC_HOME}/transcode/lame
-.endif
 
 .include <bsd.port.mk>

Modified: head/www/subsonic-standalone/files/subsonic.in
==============================================================================
--- head/www/subsonic-standalone/files/subsonic.in	Mon Aug 22 13:27:51 2016	(r420614)
+++ head/www/subsonic-standalone/files/subsonic.in	Mon Aug 22 13:33:23 2016	(r420615)
@@ -4,44 +4,43 @@
 #
 
 # PROVIDE: subsonic
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
 
 #
 # Configuration settings for subsonic in /etc/rc.conf:
 #
 # subsonic_enable (bool):
 #   Set to "NO" by default.
-#   Set it to "YES" to enable subsonic
+#   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):
+# subsonic_port (int):
 #   Set to "4040" by default.
-#   Specify which port to listen on for HTTP.
+#   Specify which port to listen on for HTTP(S).
+#
+# subsonic_ssl (bool):
+#   Set to "NO" by default.
+#   Set it to "YES" to enable SSL.
 #
-# subsonic_https_port (int):
-#   Set to "0" by default.
-#   Specify which port to listen on for HTTPS.
+# subsonic_ssl_keystore (str):
+#   Optionally set path to custom SSL keystore.
+#
+# subsonic_ssl_password (str):
+#   Optionally set password for custom SSL keystore.
 #
 # 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.
+#   Set to "100" by default.
 #   Specify the memory limit (Java heap size) in megabytes.
 #
 
@@ -53,31 +52,37 @@ 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}"
+: ${subsonic_enable:="NO"}
+: ${subsonic_user:="%%USER%%"}
+: ${subsonic_group:="%%GROUP%%"}
+: ${subsonic_home:="%%SUBSONIC_HOME%%"}
+: ${subsonic_host:="0.0.0.0"}
+: ${subsonic_port:="4040"}
+: ${subsonic_ssl:="NO"}
+: ${subsonic_context_path:="/"}
+: ${subsonic_max_memory:="100"}
+
+if checkyesno subsonic_ssl; then
+	SUBSONIC_SSL_FLAGS="-Dsubsonic.httpsPort=${subsonic_port}" && subsonic_port="0"
+	if [ ! -z ${subsonic_ssl_keystore} ]; then
+		SUBSONIC_SSL_FLAGS=${SUBSONIC_SSL_FLAGS}" -Dsubsonic.ssl.keystore=${subsonic_ssl_keystore} -Dsubsonic.ssl.password=${subsonic_ssl_password}"
+	fi
+fi
+
+start_precmd="export LC_CTYPE='UTF-8'"
+subsonic_chdir="%%DATADIR%%"
+command="/usr/sbin/daemon"
+command_args="-f ${procname} \
+	-Dsubsonic.home=${subsonic_home} \
+	-Dsubsonic.host=${subsonic_host} \
+	-Dsubsonic.port=${subsonic_port} \
+	${SUBSONIC_SSL_FLAGS} \
+	-Dsubsonic.contextPath=${subsonic_context_path} \
+	-Dsubsonic.defaultMusicFolder=${subsonic_home}/music \
+	-Dsubsonic.defaultPodcastFolder=${subsonic_home}/Podcast \
+	-Dsubsonic.defaultPlaylistFolder=${subsonic_home}/playlists \
+	-Xmx${subsonic_max_memory}m \
+	-Djava.awt.headless=true \
+	-jar ${subsonic_chdir}/subsonic-booter-jar-with-dependencies.jar"
 
 run_rc_command "$1"

Modified: head/www/subsonic-standalone/pkg-plist
==============================================================================
--- head/www/subsonic-standalone/pkg-plist	Mon Aug 22 13:27:51 2016	(r420614)
+++ head/www/subsonic-standalone/pkg-plist	Mon Aug 22 13:33:23 2016	(r420615)
@@ -1,8 +1,9 @@
-subsonic-standalone/LICENSE.TXT
-subsonic-standalone/README.TXT
-subsonic-standalone/subsonic.war
-subsonic-standalone/subsonic-booter-jar-with-dependencies.jar
-subsonic-standalone/subsonic.sh
- at 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.")
+%%DATADIR%%/README.TXT
+%%DATADIR%%/subsonic-booter-jar-with-dependencies.jar
+%%DATADIR%%/subsonic.war
+%%FFMPEG%%%%SUBSONIC_HOME%%/transcode/ffmpeg
+%%FLAC%%%%SUBSONIC_HOME%%/transcode/flac
+%%LAME%%%%SUBSONIC_HOME%%/transcode/lame
+ at 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.") || true
 @dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%/transcode
 @dir(%%USER%%,%%GROUP%%,750) %%SUBSONIC_HOME%%


More information about the svn-ports-all mailing list