Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Mar 2021 01:47:24 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r569005 - in head/audio/jamulus: . files
Message-ID:  <202103230147.12N1lOg2097612@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Tue Mar 23 01:47:23 2021
New Revision: 569005
URL: https://svnweb.freebsd.org/changeset/ports/569005

Log:
  audio/jamulus: Favorize by adding the 'server' flavor

Added:
  head/audio/jamulus/files/
  head/audio/jamulus/files/jamulus-server.in   (contents, props changed)
  head/audio/jamulus/pkg-message   (contents, props changed)
Modified:
  head/audio/jamulus/Makefile

Modified: head/audio/jamulus/Makefile
==============================================================================
--- head/audio/jamulus/Makefile	Tue Mar 23 01:05:00 2021	(r569004)
+++ head/audio/jamulus/Makefile	Tue Mar 23 01:47:23 2021	(r569005)
@@ -3,7 +3,7 @@
 PORTNAME=	jamulus
 DISTVERSIONPREFIX=	r
 DISTVERSION=	3_7_0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	audio
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -14,35 +14,58 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 LIB_DEPENDS=	libjack.so:audio/jack
 
+FLAVORS=	desktop server
+FLAVOR?=	${FLAVORS:[1]}
+server_PKGNAMESUFFIX=	-server
+
 USES=		compiler:c++11-lang gl pkgconfig qmake qt:5
-USE_QT=		concurrent core gui network widgets xml buildtools_build linguisttools_build
+USE_QT=		concurrent core network xml buildtools_build linguisttools_build
 USE_GL=		gl
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	jamulussoftware
 
+.if ${FLAVOR:U} == desktop
+USE_QT+=	gui widgets
 PLIST_FILES=	bin/${PORTNAME} \
-		share/applications/jamulus.desktop \
-		share/applications/jamulus-server.desktop \
-		share/pixmaps/jamulus.png \
-		share/pixmaps/jamulus-server.png
+		share/applications/${PORTNAME}.desktop \
+		share/applications/${PORTNAME}-server.desktop \
+		share/pixmaps/${PORTNAME}.png \
+		share/pixmaps/${PORTNAME}-server.png
+.endif
 
-QMAKE_ARGS=	CONFIG+="noupcasename"
+.if ${FLAVOR:U} == server
+COMMENT+=	(headless server)
+QMAKE_ARGS=	CONFIG+="headless nosound"
+USER=		nobody
+SUB_LIST=	USER=${USER}
+USE_RC_SUBR=	${PORTNAME}-server
+PLIST_FILES=	bin/${PORTNAME}-server
+.endif
 
+QMAKE_ARGS+=	CONFIG+="noupcasename"
+
 PORTSCOUT=	limit:^r\d+_ # prevent malformatted tags, like 'latest'
 
+.if ${FLAVOR:U} == desktop
 post-install:
-		# workaround for https://gitlab.xfce.org/xfce/xfdesktop/-/issues/131
-		${MV} ${STAGEDIR}${PREFIX}/share/icons/hicolor/512x512/apps/jamulus.png ${STAGEDIR}${PREFIX}/share/pixmaps/
-		${RM} -r ${STAGEDIR}${PREFIX}/share/icons
-		# add Jamulus Server menu item which is simply 'jamulus -s' with a special icon
-		${CP} ${STAGEDIR}${PREFIX}/share/applications/jamulus.desktop ${STAGEDIR}${PREFIX}/share/applications/jamulus-server.desktop
-		${REINPLACE_CMD} -i '' ' \
-			s|Name=Jamulus|Name=Jamulus Server| ; \
-			s|Comment=Jam Session|Comment=Jam Session Server| ; \
-			s|Exec=jamulus|Exec=jamulus -s| ; \
-			s|Icon=jamulus|Icon=jamulus-server| ; \
-			' ${STAGEDIR}${PREFIX}/share/applications/jamulus-server.desktop
-		${INSTALL_DATA} ${WRKSRC}/src/res/fronticonserver.png ${STAGEDIR}${PREFIX}/share/pixmaps/jamulus-server.png
+	# workaround for https://gitlab.xfce.org/xfce/xfdesktop/-/issues/131
+	${MV} ${STAGEDIR}${PREFIX}/share/icons/hicolor/512x512/apps/jamulus.png ${STAGEDIR}${PREFIX}/share/pixmaps/
+	${RM} -r ${STAGEDIR}${PREFIX}/share/icons
+	# add Jamulus Server menu item which is simply 'jamulus -s' with a special icon
+	${CP} ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}.desktop ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}-server.desktop
+	${REINPLACE_CMD} -i '' ' \
+		s|Name=Jamulus|Name=Jamulus Server| ; \
+		s|Comment=Jam Session|Comment=Jam Session Server| ; \
+		s|Exec=jamulus|Exec=jamulus -s| ; \
+		s|Icon=jamulus|Icon=jamulus-server| ; \
+		' ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}-server.desktop
+	${INSTALL_DATA} ${WRKSRC}/src/res/fronticonserver.png ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}-server.png
+.endif
+
+.if ${FLAVOR:U} == server
+post-install:
+	${MV} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-server
+.endif
 
 .include <bsd.port.mk>

Added: head/audio/jamulus/files/jamulus-server.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/jamulus/files/jamulus-server.in	Tue Mar 23 01:47:23 2021	(r569005)
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: jamulus-server
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable jamulus_server:
+# jamulus_server_enable : set to "YES" to enable the daemon, default is "NO"
+# jamulus_server_flags  : any extra flags, default is ""
+#    - list of all possible flags: https://jamulus.io/wiki/Command-Line-Options
+
+. /etc/rc.subr
+
+name=jamulus_server
+rcvar=jamulus_server_enable
+
+load_rc_config $name
+
+jamulus_server_enable=${jamulus_server_enable:-"NO"}
+jamulus_server_flags=${jamulus_server_flags:-""}
+
+logfile="/var/log/${name}.log"
+
+procname=%%PREFIX%%/bin/jamulus-server
+command="/usr/sbin/daemon"
+command_args="-u %%USER%% -o ${logfile} -t ${name} %%PREFIX%%/bin/jamulus-server -s ${jamulus_server_flags}"
+
+run_rc_command "$1"

Added: head/audio/jamulus/pkg-message
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/jamulus/pkg-message	Tue Mar 23 01:47:23 2021	(r569005)
@@ -0,0 +1,32 @@
+[
+{ type: install
+  message: <<EOM
+You installed Jamulus: Internet jam session software
+
+Most users need Jamulus client to listen to or participate in jam sessions
+hosted by others.
+
+You can run Jamulus client using the menu item or by running the "jamulus"
+command.
+
+Some users also need to run Jamulus server to host jam sessions.
+
+You can run Jamulus server as a graphical program by using the "Jamulus Server"
+menu item, or run the "jamulus -s" command.
+
+You can also run Jamulus Server as a headless server. In order to do this you
+need to install the jamulus-server package and run:
+# sysrc jamulus_server_enable="YES"
+# service jamulus-server start
+and then navigate to your server by your IP address in the Jamulus Client.
+
+You can also start the Jamulus Server service once with:
+# service jamulus-server onestart
+
+Please read https://jamulus.io/wiki/Command-Line-Options and add appropriate
+Jamulus Server options to jamulus_server_flags="{your options}"
+in /etc/rc.config
+
+EOM
+}
+]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103230147.12N1lOg2097612>